Guide
Alt dataNewsSentiment API key

NewsAPI API guide

NewsAPI.org indexes articles from tens of thousands of publishers and lets you search them by keyword. AlgoGP’s sentiment filter uses it to score recent headlines about your symbol and skip entries when the news is clearly negative.

Last verified · Also known as NewsAPI.org

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-Key header
Free plan
100 requests/day, 24-hour delay, last month only, development use
Used by
filters.sentiment with source news

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.

KeyWhat it is
NEWS_API_KEYOptional NewsAPI.org key: live.py adds its headlines to the news feed (backtests use the keyless Google News archive).
Names the generated code reads. Add values under Keys & secrets or in a local .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

Independent guide. AlgoGP is not affiliated with NewsAPI. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.