Mediastack API
Live and historical news data from thousands of sources.
What it does
mediastack provides live and historical news articles from 7,500+ sources in 50+ countries and 13 languages, filterable by keyword, source, category, country, language and date, with simple limit/offset pagination.
Base URL
Authentication
Sign up for a free API key and pass it as ?access_key=YOUR_KEY. The free plan is historically HTTP only — check your plan for HTTPS support.
Code examples
curl -s "http://api.mediastack.com/v1/news?access_key=$MS_KEY&keywords=technology&languages=en&limit=5"
import requests
r = requests.get("http://api.mediastack.com/v1/news", params={
"access_key": KEY, "categories": "business",
"countries": "gb", "sort": "published_desc", "limit": 5}, timeout=10)
for a in r.json()["data"]:
print(a["published_at"][:10], a["source"], "-", a["title"])Rate limits & quotas
Free plan: about 100 requests/month, HTTP only, live news only (no historical), max limit 100 per request. Responses include a pagination object (limit, offset, count, total). Errors return a JSON error with a code.
Key response fields
| data[].title / description / url | Article headline, snippet, link |
| data[].source / author | Publisher and byline |
| data[].published_at | ISO 8601 timestamp |
| data[].category / country / language | Classification |
| pagination.total | Total matching articles |
Common errors
| 401 invalid_access_key | Key missing or wrong. |
| 403 https_access_restricted | HTTPS on a free plan — use HTTP or upgrade. |
| 429 rate_limit_reached | Monthly quota or per-second rate exceeded. |
| 422 validation_error | Bad parameter value (e.g. unknown category). |
When to use it (and alternatives)
Only viable if 100 requests/month covers you (a low-frequency cron). For an actually usable free tier, Currents (~600/day) or newsdata.io (~200/day) are far better starting points.
FAQ
Is the free plan really 100 calls a month?
Yes — mediastack’s free tier is small and HTTP-only, best treated as an evaluation tier. Budget for a paid plan or a different provider for anything regular.
Can I get historical articles?
Not on free — pass a date range only on paid plans. The free plan serves live news.
How do I page through results?
Use limit (max 100) and offset. pagination.total tells you how many pages exist — but each page is another request against your tiny monthly quota.
New to APIs?
Short guides for working with this API — and any other.