API Directory › 📰 News › NewsAPI
API KeyHTTPS

NewsAPI

Search headlines and articles from thousands of news sources worldwide.

Category
Auth
API Key
HTTPS
Yes
CORS
No
Open NewsAPI docs ↗

What it does

NewsAPI.org indexes headlines and articles from 150,000+ sources worldwide. Three endpoints: /top-headlines (breaking news by country, category or source), /everything (full-text search across all articles), and /sources (the source catalogue).

Base URL

https://newsapi.org/v2

Authentication

Register for an API key and send it as the X-Api-Key header (or ?apiKey=). The free Developer plan is for non-commercial use and testing only.

Code examples

curl
curl -s "https://newsapi.org/v2/top-headlines?country=us&category=technology" \
  -H "X-Api-Key: $NEWSAPI_KEY"
Python
import requests

r = requests.get("https://newsapi.org/v2/everything", params={
    "q": "renewable energy", "language": "en",
    "sortBy": "publishedAt", "pageSize": 5},
    headers={"X-Api-Key": KEY}, timeout=10)
for a in r.json()["articles"]:
    print(a["publishedAt"][:10], a["source"]["name"], "-", a["title"])

Rate limits & quotas

Developer plan: 100 requests/day, results delayed ~24 hours, /everything limited to articles from the last month, max pageSize 100, and no browser (CORS) requests — you must call it server-side. Over the limit: HTTP 429 rateLimited. Paid plans remove the delay and CORS block.

Key response fields

statusok or error (with code + message)
totalResultsTotal matches (you can only page through the first 100 on free)
articles[].title / description / contentcontent is truncated to ~200 chars
articles[].source.name / url / publishedAtAttribution and link
articles[].urlToImageLead image URL (may be null)

Common errors

401 apiKeyInvalid / apiKeyMissingBad or absent key.
426You called it from a browser on the free plan — move the call to your backend.
429 rateLimitedDaily 100-request cap reached.
400 parameterInvalide.g. /everything with no q, sources or domain filter.

When to use it (and alternatives)

Fine for prototypes and internal dashboards where a 24-hour delay and 100 calls/day are acceptable. For a free tier you can use in the browser, try Currents or newsdata.io; for a specific publisher use The Guardian or NYT.

FAQ

Why can't I call NewsAPI from my React app?

The free plan blocks browser-origin requests (HTTP 426). Proxy through your own server, which also keeps your key secret. Paid plans allow CORS.

Why is the news a day old?

The Developer plan intentionally delays results by about 24 hours. Real-time results require a paid plan.

Can I use it on a public commercial site?

Not on the free plan — it is licensed for development and non-commercial personal projects. A paid plan is required for commercial use.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related News APIs

← Back

More News APIs · All 196 APIs