Quick answer
NewsAPI.org searches headlines from many publishers via /v2/everything with an X-Api-Key header. The free Developer plan allows 100 requests a day, delays articles 24 hours, reaches back about a month and is for development only.
NewsAPI API at a glance
- Pricing
- Free developer plan: 100 requests/day
- Availability
- Worldwide
- Paper trading
- Not applicable (data only)
- Integration type
- REST + API key
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Endpoint
GET https://newsapi.org/v2/everything?q=bitcoin- Auth
X-Api-Keyheader- Free plan
- 100 requests/day, 24-hour delay, last month only, development use
- Used by
filters.sentimentwith sourcenews
How the news sentiment filter works
Strategies read news point-in-time through strategy_runtime.news: every headline is hidden until it was published. In-app backtests replay a keyless Google News archive, so no key is needed to test a news idea. When the exported live.py runs, live_feeds.py adds NewsAPI headlines matching news_query to the same feed, and the sentiment filter blocks new entries while the score over lookback_days is below min_sentiment.
Use NewsAPI in AlgoGP
NewsAPI is read by the generated data_sources.py. Turn it on from config.json under filters.sentiment. In-app backtests replay news and sentiment from dated, keyless archives, so a key, if any, is only used when the exported live.py runs; store it in the project’s Keys & secrets or a local .env.
| Key | What it is |
|---|---|
NEWS_API_KEY | Optional NewsAPI.org key: live.py adds its headlines to the news feed (backtests use the keyless Google News archive). |
.env.New to NewsAPI? Follow the step-by-step NewsAPI API key guide.
NewsAPI API: frequently asked questions
Can I use the free NewsAPI plan in production?
No. The Developer plan is for development and testing; production and commercial use need a paid plan.
Why are NewsAPI results a day old?
The free plan delays articles by 24 hours. Paid plans are real time.
Add NewsAPI signals to a strategy
Combine price rules with news and sentiment filters, test them point-in-time so nothing leaks from the future, and export the code.
- Sentiment filters that block entries on bad news
- Point-in-time replay in every backtest
- Exported Python reads the same feed live
Free plan, no card required.
NewsAPI alternatives
- Finnhub API Built into AlgoGP (data)Stock, FX and crypto prices plus fundamentals, estimates, news and alternative data behind one API key.
- X (Twitter) API GuideRecent posts from X for social sentiment; read with an app-only bearer token.
- CoinDesk Data API GuideThe renamed CryptoCompare (then CCData): crypto prices, OHLCV, order books and news across hundreds of exchanges.
Independent guide. AlgoGP is not affiliated with NewsAPI. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.