Mediastack
面向实时新闻和博客文章的免费、简单 REST API
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 新闻
简介
Mediastack(APILayer 产品)提供来自 7,500+ 来源的实时世界新闻,支持关键词搜索和筛选。认证是免费 API 密钥(无效密钥返回 401,已实测)。
快速开始
最新新闻(替换 YOUR_KEY):
curl "http://api.mediastack.com/v1/news?access_key=YOUR_KEY&countries=us,gb&languages=en&limit=5"
{
"pagination": { "limit": 5, "offset": 0, "count": 5, "total": 12800 },
"data": [
{
"author": "...",
"title": "...",
"description": "...",
"url": "https://...",
"image": "https://...",
"category": "technology",
"language": "en",
"country": "us",
"published_at": "2026-08-22T06:00:00+00:00"
}
]
}
搜索:
curl "http://api.mediastack.com/v1/news?access_key=YOUR_KEY&keywords=spacex"
来源:
curl "http://api.mediastack.com/v1/sources?access_key=YOUR_KEY"
认证方式
- 在 mediastack.com 注册 → 免费 API 密钥(邮件发送)。
- 通过
access_key查询参数携带(无效密钥返回 401——已实测)。
速率限制与注意事项
- 免费层:500 次请求/月(数据限 2 周内);付费档可扩展。
- 筛选:
keywords、countries、languages、categories、sort。 - API 走 http(部分档位 https 付费)——可用时用 https。
- 响应含
pagination,带total用于翻页。
常见问题
Mediastack 免费吗? 免费层:500 次/月;更多需要付费。
如何获取密钥? 在 mediastack.com 注册——密钥会邮件发送。
可以按国家筛选吗?
可以——countries=us,gb 和 languages=en。
新闻 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| Associated Press Search for news and metadata from Associated Press | API Key | Yes | Unknown | ↗ |
| Chronicling America Provides access to millions of pages of historic US newspapers from the Library of Congress | No auth | No | Unknown | ↗ |
| Currents Real-time and historical global news with multilingual support | API Key | Yes | Yes | ↗ |
| DataCube AI Daily curated AI industry news, funding rounds and trends in 8 languages | No auth | Yes | No | ↗ |
| Feedbin RSS reader | OAuth | Yes | Unknown | ↗ |