google-news

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google 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/rss
All 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:
ParameterRequiredDescriptionExample
hl
YesInterface language / locale code
en-US
,
fr
,
de
,
ja
,
pt-BR
,
es-419
gl
YesCountry / geographic location (ISO 3166-1 alpha-2)
US
,
GB
,
IN
,
DE
,
JP
,
BR
ceid
YesCompound locale key in the form
{gl}:{language}
US:en
,
GB:en
,
DE:de
,
JP:ja
,
BR:pt-419
Important: All three parameters should be consistent. Mismatched values may return unexpected or empty results.

所有资讯源URL均支持以下查询参数,用于控制地区和语言:
参数是否必填描述示例
hl
界面语言/区域代码
en-US
,
fr
,
de
,
ja
,
pt-BR
,
es-419
gl
国家/地理位置(ISO 3166-1 alpha-2格式)
US
,
GB
,
IN
,
DE
,
JP
,
BR
ceid
复合区域密钥,格式为
{gl}:{language}
US:en
,
GB:en
,
DE:de
,
JP:ja
,
BR:pt-419
重要提示:这三个参数的取值必须保持一致。参数不匹配可能会返回意外结果或空数据。

Supported Locations (Validated)

已验证的支持地区

The following locations have been tested and confirmed to return valid RSS feeds (HTTP 200):
Location
hl
gl
ceid
Example URL
🇺🇸 United States
en-US
US
US:en
https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en
🇬🇧 United Kingdom
en-GB
GB
GB:en
https://news.google.com/rss?hl=en-GB&gl=GB&ceid=GB:en
🇮🇳 India
en-IN
IN
IN:en
https://news.google.com/rss?hl=en-IN&gl=IN&ceid=IN:en
🇦🇺 Australia
en-AU
AU
AU:en
https://news.google.com/rss?hl=en-AU&gl=AU&ceid=AU:en
🇨🇦 Canada
en-CA
CA
CA:en
https://news.google.com/rss?hl=en-CA&gl=CA&ceid=CA:en
🇩🇪 Germany
de
DE
DE:de
https://news.google.com/rss?hl=de&gl=DE&ceid=DE:de
🇫🇷 France
fr
FR
FR:fr
https://news.google.com/rss?hl=fr&gl=FR&ceid=FR:fr
🇯🇵 Japan
ja
JP
JP:ja
https://news.google.com/rss?hl=ja&gl=JP&ceid=JP:ja
🇧🇷 Brazil
pt-BR
BR
BR:pt-419
https://news.google.com/rss?hl=pt-BR&gl=BR&ceid=BR:pt-419
🇲🇽 Mexico
es-419
MX
MX:es-419
https://news.google.com/rss?hl=es-419&gl=MX&ceid=MX:es-419
🇮🇱 Israel
en-IL
IL
IL:en
https://news.google.com/rss?hl=en-IL&gl=IL&ceid=IL:en

以下地区已通过测试,确认可返回有效RSS源(HTTP 200状态码):
地区
hl
gl
ceid
示例URL
🇺🇸 美国
en-US
US
US:en
https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en
🇬🇧 英国
en-GB
GB
GB:en
https://news.google.com/rss?hl=en-GB&gl=GB&ceid=GB:en
🇮🇳 印度
en-IN
IN
IN:en
https://news.google.com/rss?hl=en-IN&gl=IN&ceid=IN:en
🇦🇺 澳大利亚
en-AU
AU
AU:en
https://news.google.com/rss?hl=en-AU&gl=AU&ceid=AU:en
🇨🇦 加拿大
en-CA
CA
CA:en
https://news.google.com/rss?hl=en-CA&gl=CA&ceid=CA:en
🇩🇪 德国
de
DE
DE:de
https://news.google.com/rss?hl=de&gl=DE&ceid=DE:de
🇫🇷 法国
fr
FR
FR:fr
https://news.google.com/rss?hl=fr&gl=FR&ceid=FR:fr
🇯🇵 日本
ja
JP
JP:ja
https://news.google.com/rss?hl=ja&gl=JP&ceid=JP:ja
🇧🇷 巴西
pt-BR
BR
BR:pt-419
https://news.google.com/rss?hl=pt-BR&gl=BR&ceid=BR:pt-419
🇲🇽 墨西哥
es-419
MX
MX:es-419
https://news.google.com/rss?hl=es-419&gl=MX&ceid=MX:es-419
🇮🇱 以色列
en-IL
IL
IL:en
https://news.google.com/rss?hl=en-IL&gl=IL&ceid=IL:en

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:en

2. 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):
TopicTopic ID
World
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx1YlY4U0FtVnVHZ0pWVXlnQVAB
Nation / U.S.
CAAqIggKIhxDQkFTRHdvSkwyMHZNRGxqTjNjU0FtVnVLQUFQAQ
Business
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB
Technology
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB
Entertainment
CAAqJggKIiBDQkFTRWdvSUwyMHZNREpxYW5RU0FtVnVHZ0pWVXlnQVAB
Sports
CAAqJggKIiBDQkFTRWdvSUwyMHZNRFp1ZEdvU0FtVnVHZ0pWVXlnQVAB
Science
CAAqJggKIiBDQkFTRWdvSUwyMHZNRFp0Y1RjU0FtVnVHZ0pWVXlnQVAB
Health
CAAqIQgKIhtDQkFTRGdvSUwyMHZNR3QwTlRFU0FtVnVLQUFQAQ
Example — Technology news (US):
https://news.google.com/rss/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US:en
Note: Topic IDs are base64-encoded protocol buffer strings. They can differ by language/region. The IDs above are for
en-US
. To find topic IDs for other locales, inspect the RSS link on the Google News website for that locale.

返回特定新闻主题/板块的文章。
URL格式:
https://news.google.com/rss/topics/{TOPIC_ID}?hl={hl}&gl={gl}&ceid={gl}:{lang}
已知主题ID(英文,美国地区):
主题主题ID
国际
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx1YlY4U0FtVnVHZ0pWVXlnQVAB
美国国内
CAAqIggKIhxDQkFTRHdvSkwyMHZNRGxqTjNjU0FtVnVLQUFQAQ
商业
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB
科技
CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB
娱乐
CAAqJggKIiBDQkFTRWdvSUwyMHZNREpxYW5RU0FtVnVHZ0pWVXlnQVAB
体育
CAAqJggKIiBDQkFTRWdvSUwyMHZNRFp1ZEdvU0FtVnVHZ0pWVXlnQVAB
科学
CAAqJggKIiBDQkFTRWdvSUwyMHZNRFp0Y1RjU0FtVnVHZ0pWVXlnQVAB
健康
CAAqIQgKIhtDQkFTRGdvSUwyMHZNR3QwTlRFU0FtVnVLQUFQAQ
示例 — 美国科技新闻:
https://news.google.com/rss/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US:en
注意:主题ID是经过Base64编码的Protocol Buffer字符串,会因语言/地区而异。上述ID适用于
en-US
地区。要查找其他区域的主题ID,请查看对应区域Google News网站上的RSS链接。

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:
ModifierDescriptionExample
+
or space
AND (default)
q=artificial+intelligence
OR
OR operator
q=Tesla+OR+SpaceX
-
Exclude term
q=Apple+-fruit
"..."
Exact phrase (URL-encode the quotes)
q=%22climate+change%22
when:7d
Time filter — last N days/hours
q=Bitcoin+when:7d
when:1h
Time filter — last 1 hour
q=breaking+news+when:1h
after:YYYY-MM-DD
Articles after a date
q=Olympics+after:2024-07-01
before:YYYY-MM-DD
Articles before a date
q=Olympics+before:2024-08-15
site:
Restrict to a domain
q=AI+site:reuters.com
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}
查询修饰符:
修饰符描述示例
+
或空格
逻辑与(默认)
q=artificial+intelligence
OR
逻辑或
q=Tesla+OR+SpaceX
-
排除关键词
q=Apple+-fruit
"..."
精确匹配短语(需对引号进行URL编码)
q=%22climate+change%22
when:7d
时间过滤 — 最近N天/小时
q=Bitcoin+when:7d
when:1h
时间过滤 — 最近1小时
q=breaking+news+when:1h
after:YYYY-MM-DD
指定日期之后的文章
q=Olympics+after:2024-07-01
before:YYYY-MM-DD
指定日期之前的文章
q=Olympics+before:2024-08-15
site:
限制到指定域名
q=AI+site:reuters.com
示例 — 搜索最近7天的“人工智能”相关文章:
https://news.google.com/rss/search?q=artificial+intelligence+when:7d&hl=en-US&gl=US&ceid=US:en

RSS 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&amp;gl=US&amp;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>&nbsp;&nbsp;<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&amp;gl=US&amp;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>&nbsp;&nbsp;<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>
的关键字段

FieldDescription
<title>
Headline text followed by
 - Publisher Name
<link>
Google News redirect URL. Visiting it in a browser redirects to the actual article.
<guid>
Unique identifier (same as
<link>
)
<pubDate>
Publication date in RFC 2822 format
<description>
HTML snippet containing an ordered list (
<ol>
) of related/clustered articles with links and publisher names
<source url="...">
Publisher name and homepage URL

字段描述
<title>
新闻标题,格式为
标题文本 - 出版商名称
<link>
Google News重定向URL,在浏览器中访问会跳转到实际文章页面
<guid>
唯一标识符(与
<link>
内容相同)
<pubDate>
发布日期,采用RFC 2822格式
<description>
HTML片段,包含相关/聚类文章的有序列表(
<ol>
),带有链接和出版商名称
<source url="...">
出版商名称及其主页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
done

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
done

Resolving Google News Redirect URLs

解析Google News重定向URL

Article links in the RSS feed point to
https://news.google.com/rss/articles/...
which redirect (HTTP 302/303) to the actual publisher URL. To resolve the final URL:
RSS源中的文章链接指向
https://news.google.com/rss/articles/...
,该链接会通过HTTP 302/303重定向到出版商的实际URL。要解析最终URL:

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 URL

python
import requests

response = requests.head(
    "https://news.google.com/rss/articles/CBMiWkFV...",
    allow_redirects=True,
    timeout=10,
)
print(response.url)  # 最终出版商URL

Rate Limits

速率限制

Google does not publish official rate limits for the RSS feeds. Based on community observations:
GuidelineRecommendation
Polling interval≥ 60 seconds between requests for the same feed
Concurrent requestsKeep below ~10 concurrent connections
Burst behaviorRapid bursts may trigger HTTP 429 or CAPTCHA challenges
User-AgentUse 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 StatusMeaningAction
200SuccessParse the RSS XML
301/302RedirectFollow the redirect (most HTTP clients do this automatically)
404Feed not foundCheck the URL, topic ID, or locale parameters
429Rate limitedBack off and retry after a delay
5xxServer errorRetry 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
    feedparser
    in Python
    — it handles RSS parsing, date normalization, and encoding edge cases.
  • Combine search modifiers
    q=Tesla+site:reuters.com+when:30d
    for precise results.
  • Topic IDs are locale-specific — an English topic ID may not work with
    hl=de
    . Inspect the Google News page in that locale to find the correct ID.
  • The
    <description>
    field is HTML
    — it contains clustered/related articles as an
    <ol>
    list. Parse the HTML to extract multiple sources per story.
  • The
    <title>
    includes the publisher
    — the format is
    Headline text - Publisher Name
    . Split on
    -
    (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.,
    User-Agent: MyNewsBot/1.0 (contact@example.com)
    . Some environments may get blocked without one.

  • 无需身份验证 — 所有资讯源均为公开状态,可立即开始获取数据。
  • Python中使用
    feedparser
    — 该库可处理RSS解析、日期标准化和编码异常情况。
  • 组合使用查询修饰符 — 例如
    q=Tesla+site:reuters.com+when:30d
    可获取精准结果。
  • 主题ID与区域绑定 — 英文主题ID可能无法在
    hl=de
    环境下使用,需查看对应区域Google News页面获取正确ID。
  • <description>
    字段为HTML格式
    — 包含聚类/相关文章的有序列表,需解析HTML提取每个新闻的多个来源。
  • <title>
    包含出版商信息
    — 格式为
    标题文本 - 出版商名称
    ,可从右侧按
    -
    (空格-空格)拆分。
  • 资讯源结果数量有限 — 谷歌通常每个资讯源返回约100条数据,可结合日期过滤的搜索实现历史数据分页。
  • 遵守版权声明 — Google的RSS源仅供个人非商业用途(如阅读器),其他用途请查看谷歌条款。
  • 延迟解析重定向 — 仅在实际需要最终链接时才解析Google重定向URL,可减少请求次数。
  • 设置合适的User-Agent — 例如
    User-Agent: MyNewsBot/1.0 (contact@example.com)
    ,部分环境下无User-Agent可能会被拦截。

Changelog

更新日志

  • 0.1.0 — Initial release with top stories, topic feeds, search feeds, multi-region support, and common usage patterns.
  • 0.1.0 — 初始版本,支持头条新闻、主题资讯源、搜索资讯源、多地区适配以及常用使用示例。