google-news
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle News RSS API
Google News RSS API
Google News is a free news aggregator that collects headlines from thousands of publishers around the world. Google exposes its feeds via public RSS 2.0 endpoints that require no authentication or API key.
Google News是一款免费的新闻聚合器,收集了全球数千家出版商的新闻头条。谷歌通过公开的RSS 2.0端点提供其资讯源,无需身份验证或API密钥。
Base URL
基础URL
https://news.google.com/rssAll feed URLs are built by appending paths and query parameters to this base.
https://news.google.com/rss所有资讯源URL均通过在该基础URL后追加路径和查询参数构建。
Query Parameters
查询参数
Every feed URL accepts the following query parameters to control region and language:
| Parameter | Required | Description | Example |
|---|---|---|---|
| Yes | Interface language / locale code | |
| Yes | Country / geographic location (ISO 3166-1 alpha-2) | |
| Yes | Compound locale key in the form | |
Important: All three parameters should be consistent. Mismatched values may return unexpected or empty results.
所有资讯源URL均支持以下查询参数,用于控制地区和语言:
| 参数 | 是否必填 | 描述 | 示例 |
|---|---|---|---|
| 是 | 界面语言/区域代码 | |
| 是 | 国家/地理位置(ISO 3166-1 alpha-2格式) | |
| 是 | 复合区域密钥,格式为 | |
重要提示:这三个参数的取值必须保持一致。参数不匹配可能会返回意外结果或空数据。
Supported Locations (Validated)
已验证的支持地区
The following locations have been tested and confirmed to return valid RSS feeds (HTTP 200):
| Location | | | | Example URL |
|---|---|---|---|---|
| 🇺🇸 United States | | | | |
| 🇬🇧 United Kingdom | | | | |
| 🇮🇳 India | | | | |
| 🇦🇺 Australia | | | | |
| 🇨🇦 Canada | | | | |
| 🇩🇪 Germany | | | | |
| 🇫🇷 France | | | | |
| 🇯🇵 Japan | | | | |
| 🇧🇷 Brazil | | | | |
| 🇲🇽 Mexico | | | | |
| 🇮🇱 Israel | | | | |
以下地区已通过测试,确认可返回有效RSS源(HTTP 200状态码):
| 地区 | | | | 示例URL |
|---|---|---|---|---|
| 🇺🇸 美国 | | | | |
| 🇬🇧 英国 | | | | |
| 🇮🇳 印度 | | | | |
| 🇦🇺 澳大利亚 | | | | |
| 🇨🇦 加拿大 | | | | |
| 🇩🇪 德国 | | | | |
| 🇫🇷 法国 | | | | |
| 🇯🇵 日本 | | | | |
| 🇧🇷 巴西 | | | | |
| 🇲🇽 墨西哥 | | | | |
| 🇮🇱 以色列 | | | | |
Feed Types
资讯源类型
1. Top Stories (Headlines)
1. 头条新闻
Returns the current top stories for a given location.
URL pattern:
https://news.google.com/rss?hl={hl}&gl={gl}&ceid={gl}:{lang}Example — US top stories:
https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en返回指定地区的当前头条新闻。
URL格式:
https://news.google.com/rss?hl={hl}&gl={gl}&ceid={gl}:{lang}示例 — 美国头条新闻:
https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en2. Topic Feeds
2. 主题资讯源
Returns articles for a specific news topic / section.
URL pattern:
https://news.google.com/rss/topics/{TOPIC_ID}?hl={hl}&gl={gl}&ceid={gl}:{lang}Known Topic IDs (English, US):
| Topic | Topic ID |
|---|---|
| World | |
| Nation / U.S. | |
| Business | |
| Technology | |
| Entertainment | |
| Sports | |
| Science | |
| Health | |
Example — Technology news (US):
https://news.google.com/rss/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US:enNote: Topic IDs are base64-encoded protocol buffer strings. They can differ by language/region. The IDs above are for. To find topic IDs for other locales, inspect the RSS link on the Google News website for that locale.en-US
返回特定新闻主题/板块的文章。
URL格式:
https://news.google.com/rss/topics/{TOPIC_ID}?hl={hl}&gl={gl}&ceid={gl}:{lang}已知主题ID(英文,美国地区):
| 主题 | 主题ID |
|---|---|
| 国际 | |
| 美国国内 | |
| 商业 | |
| 科技 | |
| 娱乐 | |
| 体育 | |
| 科学 | |
| 健康 | |
示例 — 美国科技新闻:
https://news.google.com/rss/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US:en注意:主题ID是经过Base64编码的Protocol Buffer字符串,会因语言/地区而异。上述ID适用于地区。要查找其他区域的主题ID,请查看对应区域Google News网站上的RSS链接。en-US
3. Keyword / Search Feeds
3. 关键词/搜索资讯源
Returns articles matching a search query.
URL pattern:
https://news.google.com/rss/search?q={query}&hl={hl}&gl={gl}&ceid={gl}:{lang}Query modifiers:
| Modifier | Description | Example |
|---|---|---|
| AND (default) | |
| OR operator | |
| Exclude term | |
| Exact phrase (URL-encode the quotes) | |
| Time filter — last N days/hours | |
| Time filter — last 1 hour | |
| Articles after a date | |
| Articles before a date | |
| Restrict to a domain | |
Example — search for "artificial intelligence" in the last 7 days:
https://news.google.com/rss/search?q=artificial+intelligence+when:7d&hl=en-US&gl=US&ceid=US:en返回与搜索查询匹配的文章。
URL格式:
https://news.google.com/rss/search?q={query}&hl={hl}&gl={gl}&ceid={gl}:{lang}查询修饰符:
| 修饰符 | 描述 | 示例 |
|---|---|---|
| 逻辑与(默认) | |
| 逻辑或 | |
| 排除关键词 | |
| 精确匹配短语(需对引号进行URL编码) | |
| 时间过滤 — 最近N天/小时 | |
| 时间过滤 — 最近1小时 | |
| 指定日期之后的文章 | |
| 指定日期之前的文章 | |
| 限制到指定域名 | |
示例 — 搜索最近7天的“人工智能”相关文章:
https://news.google.com/rss/search?q=artificial+intelligence+when:7d&hl=en-US&gl=US&ceid=US:enRSS Response Format
RSS响应格式
All feeds return RSS 2.0 XML. Here is the general structure:
xml
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<generator>NFE/5.0</generator>
<title>Top stories - Google News</title>
<link>https://news.google.com/?hl=en-US&gl=US&ceid=US:en</link>
<language>en-US</language>
<webMaster>news-webmaster@google.com</webMaster>
<copyright>...</copyright>
<lastBuildDate>Wed, 18 Feb 2026 20:50:00 GMT</lastBuildDate>
<item>
<title>Article headline - Publisher Name</title>
<link>https://news.google.com/rss/articles/...</link>
<guid isPermaLink="true">https://news.google.com/rss/articles/...</guid>
<pubDate>Wed, 18 Feb 2026 19:05:07 GMT</pubDate>
<description>
<!-- HTML ordered list of related articles -->
<ol>
<li><a href="...">Article Title</a> <font color="#6f6f6f">Publisher</font></li>
...
</ol>
</description>
<source url="https://publisher-domain.com">Publisher Name</source>
</item>
<!-- more <item> elements -->
</channel>
</rss>所有资讯源均返回RSS 2.0 XML格式数据。以下是通用结构:
xml
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<generator>NFE/5.0</generator>
<title>Top stories - Google News</title>
<link>https://news.google.com/?hl=en-US&gl=US&ceid=US:en</link>
<language>en-US</language>
<webMaster>news-webmaster@google.com</webMaster>
<copyright>...</copyright>
<lastBuildDate>Wed, 18 Feb 2026 20:50:00 GMT</lastBuildDate>
<item>
<title>Article headline - Publisher Name</title>
<link>https://news.google.com/rss/articles/...</link>
<guid isPermaLink="true">https://news.google.com/rss/articles/...</guid>
<pubDate>Wed, 18 Feb 2026 19:05:07 GMT</pubDate>
<description>
<!-- HTML ordered list of related articles -->
<ol>
<li><a href="...">Article Title</a> <font color="#6f6f6f">Publisher</font></li>
...
</ol>
</description>
<source url="https://publisher-domain.com">Publisher Name</source>
</item>
<!-- more <item> elements -->
</channel>
</rss>Key Fields per <item>
<item>每个<item>
的关键字段
<item>| Field | Description |
|---|---|
| Headline text followed by |
| Google News redirect URL. Visiting it in a browser redirects to the actual article. |
| Unique identifier (same as |
| Publication date in RFC 2822 format |
| HTML snippet containing an ordered list ( |
| Publisher name and homepage URL |
| 字段 | 描述 |
|---|---|
| 新闻标题,格式为 |
| Google News重定向URL,在浏览器中访问会跳转到实际文章页面 |
| 唯一标识符(与 |
| 发布日期,采用RFC 2822格式 |
| HTML片段,包含相关/聚类文章的有序列表( |
| 出版商名称及其主页URL |
Common Patterns
常用使用示例
Fetch Top Headlines (curl + grep)
获取头条新闻(curl + grep)
bash
curl -s "https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en" \
| grep -oP '<title>\K[^<]+'bash
curl -s "https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en" \
| grep -oP '<title>\K[^<]+'Fetch Top Headlines (Python)
获取头条新闻(Python)
python
import feedparser
feed = feedparser.parse(
"https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en"
)
for entry in feed.entries:
print(f"{entry.published} — {entry.title}")
print(f" Link: {entry.link}")
print()python
import feedparser
feed = feedparser.parse(
"https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en"
)
for entry in feed.entries:
print(f"{entry.published} — {entry.title}")
print(f" Link: {entry.link}")
print()Fetch Topic Feed (curl + xmllint)
获取主题资讯源(curl + xmllint)
bash
TOPIC="CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB"
curl -s "https://news.google.com/rss/topics/${TOPIC}?hl=en-US&gl=US&ceid=US:en" \
| xmllint --xpath '//item/title/text()' -bash
TOPIC="CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB"
curl -s "https://news.google.com/rss/topics/${TOPIC}?hl=en-US&gl=US&ceid=US:en" \
| xmllint --xpath '//item/title/text()' -Search for Articles (Python)
搜索文章(Python)
python
import feedparser
import urllib.parse
query = urllib.parse.quote("artificial intelligence when:7d")
url = f"https://news.google.com/rss/search?q={query}&hl=en-US&gl=US&ceid=US:en"
feed = feedparser.parse(url)
for entry in feed.entries[:10]:
print(f"• {entry.title}")python
import feedparser
import urllib.parse
query = urllib.parse.quote("artificial intelligence when:7d")
url = f"https://news.google.com/rss/search?q={query}&hl=en-US&gl=US&ceid=US:en"
feed = feedparser.parse(url)
for entry in feed.entries[:10]:
print(f"• {entry.title}")Fetch News for a Specific Location (Node.js)
获取特定地区新闻(Node.js)
javascript
const https = require("https");
const { parseStringPromise } = require("xml2js");
const url =
"https://news.google.com/rss?hl=en-GB&gl=GB&ceid=GB:en";
https.get(url, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", async () => {
const result = await parseStringPromise(data);
const items = result.rss.channel[0].item || [];
items.slice(0, 10).forEach((item) => {
console.log(item.title[0]);
});
});
});javascript
const https = require("https");
const { parseStringPromise } = require("xml2js");
const url =
"https://news.google.com/rss?hl=en-GB&gl=GB&ceid=GB:en";
https.get(url, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", async () => {
const result = await parseStringPromise(data);
const items = result.rss.channel[0].item || [];
items.slice(0, 10).forEach((item) => {
console.log(item.title[0]);
});
});
});Extract Related Articles from Description (Python)
从描述中提取相关文章(Python)
python
import feedparser
from html.parser import HTMLParser
class RelatedParser(HTMLParser):
def __init__(self):
super().__init__()
self.articles = []
self._in_a = False
self._href = ""
self._text = ""
def handle_starttag(self, tag, attrs):
if tag == "a":
self._in_a = True
self._href = dict(attrs).get("href", "")
self._text = ""
def handle_endtag(self, tag):
if tag == "a" and self._in_a:
self.articles.append({"title": self._text, "link": self._href})
self._in_a = False
def handle_data(self, data):
if self._in_a:
self._text += data
feed = feedparser.parse(
"https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en"
)
for entry in feed.entries[:3]:
print(f"\n=== {entry.title} ===")
parser = RelatedParser()
parser.feed(entry.description)
for art in parser.articles:
print(f" • {art['title']}")
print(f" {art['link']}")python
import feedparser
from html.parser import HTMLParser
class RelatedParser(HTMLParser):
def __init__(self):
super().__init__()
self.articles = []
self._in_a = False
self._href = ""
self._text = ""
def handle_starttag(self, tag, attrs):
if tag == "a":
self._in_a = True
self._href = dict(attrs).get("href", "")
self._text = ""
def handle_endtag(self, tag):
if tag == "a" and self._in_a:
self.articles.append({"title": self._text, "link": self._href})
self._in_a = False
def handle_data(self, data):
if self._in_a:
self._text += data
feed = feedparser.parse(
"https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en"
)
for entry in feed.entries[:3]:
print(f"\n=== {entry.title} ===")
parser = RelatedParser()
parser.feed(entry.description)
for art in parser.articles:
print(f" • {art['title']}")
print(f" {art['link']}")Build a Multi-Region News Aggregator (Python)
构建多地区新闻聚合器(Python)
python
import feedparser
REGIONS = {
"US": "hl=en-US&gl=US&ceid=US:en",
"UK": "hl=en-GB&gl=GB&ceid=GB:en",
"DE": "hl=de&gl=DE&ceid=DE:de",
"JP": "hl=ja&gl=JP&ceid=JP:ja",
"BR": "hl=pt-BR&gl=BR&ceid=BR:pt-419",
}
for region, params in REGIONS.items():
feed = feedparser.parse(f"https://news.google.com/rss?{params}")
print(f"\n--- {region} Top 3 ---")
for entry in feed.entries[:3]:
print(f" • {entry.title}")python
import feedparser
REGIONS = {
"US": "hl=en-US&gl=US&ceid=US:en",
"UK": "hl=en-GB&gl=GB&ceid=GB:en",
"DE": "hl=de&gl=DE&ceid=DE:de",
"JP": "hl=ja&gl=JP&ceid=JP:ja",
"BR": "hl=pt-BR&gl=BR&ceid=BR:pt-419",
}
for region, params in REGIONS.items():
feed = feedparser.parse(f"https://news.google.com/rss?{params}")
print(f"\n--- {region} Top 3 ---")
for entry in feed.entries[:3]:
print(f" • {entry.title}")Monitor a Topic with Polling (bash)
轮询监控主题(bash)
bash
#!/usr/bin/env bash
FEED="https://news.google.com/rss/search?q=breaking+news+when:1h&hl=en-US&gl=US&ceid=US:en"
SEEN_FILE="/tmp/gnews_seen.txt"
touch "$SEEN_FILE"
while true; do
curl -s "$FEED" | grep -oP '<guid[^>]*>\K[^<]+' | while read -r guid; do
if ! grep -qF "$guid" "$SEEN_FILE"; then
echo "$guid" >> "$SEEN_FILE"
TITLE=$(curl -s "$FEED" | grep -oP "<item>.*?<guid[^>]*>${guid}.*?</item>" \
| grep -oP '<title>\K[^<]+' | head -1)
echo "[NEW] $TITLE"
fi
done
sleep 120
donebash
#!/usr/bin/env bash
FEED="https://news.google.com/rss/search?q=breaking+news+when:1h&hl=en-US&gl=US&ceid=US:en"
SEEN_FILE="/tmp/gnews_seen.txt"
touch "$SEEN_FILE"
while true; do
curl -s "$FEED" | grep -oP '<guid[^>]*>\K[^<]+' | while read -r guid; do
if ! grep -qF "$guid" "$SEEN_FILE"; then
echo "$guid" >> "$SEEN_FILE"
TITLE=$(curl -s "$FEED" | grep -oP "<item>.*?<guid[^>]*>${guid}.*?</item>" \
| grep -oP '<title>\K[^<]+' | head -1)
echo "[NEW] $TITLE"
fi
done
sleep 120
doneResolving Google News Redirect URLs
解析Google News重定向URL
Article links in the RSS feed point to which redirect (HTTP 302/303) to the actual publisher URL. To resolve the final URL:
https://news.google.com/rss/articles/...RSS源中的文章链接指向,该链接会通过HTTP 302/303重定向到出版商的实际URL。要解析最终URL:
https://news.google.com/rss/articles/...curl
curl
bash
curl -Ls -o /dev/null -w '%{url_effective}' \
"https://news.google.com/rss/articles/CBMiWkFV..."bash
curl -Ls -o /dev/null -w '%{url_effective}' \
"https://news.google.com/rss/articles/CBMiWkFV..."Python
Python
python
import requests
response = requests.head(
"https://news.google.com/rss/articles/CBMiWkFV...",
allow_redirects=True,
timeout=10,
)
print(response.url) # final publisher URLpython
import requests
response = requests.head(
"https://news.google.com/rss/articles/CBMiWkFV...",
allow_redirects=True,
timeout=10,
)
print(response.url) # 最终出版商URLRate Limits
速率限制
Google does not publish official rate limits for the RSS feeds. Based on community observations:
| Guideline | Recommendation |
|---|---|
| Polling interval | ≥ 60 seconds between requests for the same feed |
| Concurrent requests | Keep below ~10 concurrent connections |
| Burst behavior | Rapid bursts may trigger HTTP 429 or CAPTCHA challenges |
| User-Agent | Use a descriptive User-Agent; empty or bot-like strings may be blocked |
If you receive an HTTP 429 response, back off exponentially (e.g., 1 min → 2 min → 4 min).
谷歌未公布RSS源的官方速率限制。根据社区观察:
| 参考准则 | 建议 |
|---|---|
| 轮询间隔 | 同一资讯源的请求间隔≥60秒 |
| 并发请求数 | 保持在10个以下 |
| 突发请求 | 短时间内大量请求可能触发HTTP 429或验证码挑战 |
| User-Agent | 使用描述性的User-Agent,空值或类机器人的字符串可能会被拦截 |
如果收到HTTP 429响应,请采用指数退避策略重试(例如:1分钟→2分钟→4分钟)。
Error Handling
错误处理
| HTTP Status | Meaning | Action |
|---|---|---|
| 200 | Success | Parse the RSS XML |
| 301/302 | Redirect | Follow the redirect (most HTTP clients do this automatically) |
| 404 | Feed not found | Check the URL, topic ID, or locale parameters |
| 429 | Rate limited | Back off and retry after a delay |
| 5xx | Server error | Retry with exponential backoff |
| HTTP状态码 | 含义 | 处理方式 |
|---|---|---|
| 200 | 请求成功 | 解析RSS XML数据 |
| 301/302 | 重定向 | 跟随重定向(多数HTTP客户端会自动处理) |
| 404 | 资讯源不存在 | 检查URL、主题ID或区域参数 |
| 429 | 请求速率超限 | 退避后重试 |
| 5xx | 服务器错误 | 采用指数退避策略重试 |
Tips
提示
- No auth needed — all feeds are fully public. Start fetching immediately.
- Use in Python — it handles RSS parsing, date normalization, and encoding edge cases.
feedparser - Combine search modifiers — for precise results.
q=Tesla+site:reuters.com+when:30d - Topic IDs are locale-specific — an English topic ID may not work with . Inspect the Google News page in that locale to find the correct ID.
hl=de - The field is HTML — it contains clustered/related articles as an
<description>list. Parse the HTML to extract multiple sources per story.<ol> - The includes the publisher — the format is
<title>. Split onHeadline text - Publisher Name(space-dash-space) from the right to separate them.- - Feed results are limited — Google typically returns ~100 items per feed. Use search with date filters to paginate through older results.
- Respect the copyright notice — Google's RSS feeds are intended for personal, non-commercial use in feed readers. Review Google's terms for other uses.
- Resolve redirects lazily — only resolve the Google redirect URL to the publisher URL when you actually need the final link. This saves requests.
- Set a proper User-Agent — e.g., . Some environments may get blocked without one.
User-Agent: MyNewsBot/1.0 (contact@example.com)
- 无需身份验证 — 所有资讯源均为公开状态,可立即开始获取数据。
- Python中使用— 该库可处理RSS解析、日期标准化和编码异常情况。
feedparser - 组合使用查询修饰符 — 例如可获取精准结果。
q=Tesla+site:reuters.com+when:30d - 主题ID与区域绑定 — 英文主题ID可能无法在环境下使用,需查看对应区域Google News页面获取正确ID。
hl=de - 字段为HTML格式 — 包含聚类/相关文章的有序列表,需解析HTML提取每个新闻的多个来源。
<description> - 包含出版商信息 — 格式为
<title>,可从右侧按标题文本 - 出版商名称(空格-空格)拆分。- - 资讯源结果数量有限 — 谷歌通常每个资讯源返回约100条数据,可结合日期过滤的搜索实现历史数据分页。
- 遵守版权声明 — Google的RSS源仅供个人非商业用途(如阅读器),其他用途请查看谷歌条款。
- 延迟解析重定向 — 仅在实际需要最终链接时才解析Google重定向URL,可减少请求次数。
- 设置合适的User-Agent — 例如,部分环境下无User-Agent可能会被拦截。
User-Agent: MyNewsBot/1.0 (contact@example.com)
Changelog
更新日志
- 0.1.0 — Initial release with top stories, topic feeds, search feeds, multi-region support, and common usage patterns.
- 0.1.0 — 初始版本,支持头条新闻、主题资讯源、搜索资讯源、多地区适配以及常用使用示例。