关于 google-news
google-news 是基于 Apify 的 Google News 搜索服务,面向开发者和 AI 工具,以结构化 JSON 返回新闻结果。支持地域与语言定向、重复项过滤和分页获取。
主要功能
- 01聚合搜索 Google News 来源
- 02按地点和语言定向结果
- 03切换安全搜索与重复项过滤
- 04控制自动更正和分页
- 05返回文章链接、摘要和排名
适用场景
- 01按地区监测新闻报道
- 02跨出版方追踪主题
- 03为研究工作流收集头条
MCP 相关
通过 Apify 托管的 MCP 服务提供 johnvc/GoogleNewsAPI Actor,供 MCP 客户端搜索 Google News。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.apify.com/?tools=johnvc/GoogleNewsAPIclaude mcp add --transport http johnisanerd-google-news https://mcp.apify.com/?tools=johnvc/GoogleNewsAPI{"mcpServers":{"johnisanerd-google-news":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/GoogleNewsAPI"}}}在 Cursor 中打开{"servers":{"johnisanerd-google-news":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/GoogleNewsAPI"}}}在 VS Code 中打开{"mcpServers":{"johnisanerd-google-news":{"type":"http","url":"https://mcp.apify.com/?tools=johnvc/GoogleNewsAPI"}}}{"mcpServers":{"johnisanerd-google-news":{"serverUrl":"https://mcp.apify.com/?tools=johnvc/GoogleNewsAPI"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
📰 Google News API:以整洁的 JSON 获取新闻搜索结果
高效、可靠且便于开发者使用的 Google News API。
Actor 页面: apify.com/johnvc/GoogleNewsAPI 输入架构: apify.com/johnvc/GoogleNewsAPI/input-schema
Google News API 会搜索 Google News,并以整洁、结构化的 JSON 返回结果,每页结果对应一个条目。每个条目都包含搜索参数、搜索元数据(结果总数、已处理页数)以及一个 news_results 数组,其中每篇文章都包含标题、链接、来源、摘要和排名位置。支持按地理位置定位、按国家和语言筛选、安全搜索、重复项筛选以及分页控制。
视频演示
快速开始
前提条件
- Python 3.11 或更高版本
- Apify 账户和 API 密钥(在此获取免费密钥)
-
克隆代码仓库
git clone https://github.com/johnisanerd/Apify-Google-News-Scraper.git cd Apify-Google-News-Scraper -
使用 UV 安装依赖项
# Install UV if you do not have it: curl -LsSf https://astral.sh/uv/install.sh | sh # Install project dependencies: uv sync -
配置 API 密钥
cp .env.example .env # Edit .env and add your Apify API key # Get your free API key at: https://apify.com?fpr=9n7kx3 -
运行示例
uv run python google-news-scraper.py
替代方式:直接设置 API 密钥
export APIFY_API_TOKEN="your_api_key_here"
uv run python google-news-scraper.py
为什么使用这个 Google News API?
大规模实时覆盖。 Google News 汇总了数以万计的出版商内容。无需为每家媒体维护一个客户端,只需查询聚合索引,一次调用即可获取所有媒体的排名结果。
按地理位置定位结果。 通过国家代码(gl)、语言(hl)、Google 域名和位置字符串进行筛选,精准控制地理和语言范围。
可配置的搜索深度。 设置 max_pages,即可快速浏览头条,也可进行更深入的搜索。每页结果都会作为独立条目返回,便于流式处理、筛选或载入工作流。
价格可预测,按使用量付费。 每次运行收取少量设置费,另加每页费用,无需订阅。你可以通过页面上限控制成本。
JSON 输出一致。 每篇文章都会返回相同字段(标题、链接、来源、摘要、排名位置),因此不同出版商的结果不会出现架构差异。
易于自动化。 只需几行 Python 代码即可调用,也可以将其作为 MCP 工具加载,让 Claude 和 Cursor 等助手按需获取最新新闻。
功能
核心能力
- 聚合新闻搜索,一次调用即可搜索数千家出版商
- 按地理位置定位,支持国家代码(
gl)、语言(hl)和 Google 域名 - 安全搜索和重复项筛选开关
- 使用
nfpr控制自动更正,实现精确匹配查询 - 通过可配置的页面上限控制分页
数据质量
- 每页对应一个条目,结构稳定
news_results数组,包含每篇文章的标题、链接、来源、摘要和排名位置- 每个条目都包含搜索元数据(结果总数、已处理页数)
- 回显搜索参数,确保每个条目都包含完整信息
- 每次查询的 JSON 结构一致
使用示例
基本搜索
{
"q": "artificial intelligence",
"max_pages": 1
}
按地理位置定位并筛选语言
{
"q": "artificial intelligence breakthroughs",
"google_domain": "google.com",
"gl": "us",
"hl": "en",
"safe": "off",
"max_pages": 2
}
输入参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
q | string | 是 | - | 搜索查询,例如 artificial intelligence、coffee。 |
location | string | 否 | - | 用于获取本地化结果的位置字符串,例如 Austin, TX, Texas, United States。 |
google_domain | string | 否 | google.com | 要搜索的 Google 域名,例如 google.co.uk。 |
gl | string | 否 | - | 国家代码(ISO 3166-1 alpha-2),例如 us、gb。 |
hl | string | 否 | - | 语言代码(ISO 639-1),例如 en、fr。 |
lr | string | 否 | - | 语言限制,例如 lang_en。 |
safe | string | 否 | off | 安全搜索:active 或 off。 |
nfpr | string | 否 | 0 | 排除自动更正的结果:0 或 1。 |
filter | string | 否 | 0 | 筛除重复结果:0 或 1。 |
max_pages | integer | 否 | 1 | 要抓取的最大页数(每页约 10 篇文章);0 = 不限。每页单独计费。 |
output_file | string | 否 | - | 可选的结果保存文件名。 |
输出格式
artificial intelligence 的实际结果(每页一项;此处的 news_results 数组已精简为单篇文章,search_information 则包含其他字段)。
{
"search_parameters": {
"q": "artificial intelligence",
"gl": "us",
"hl": "en",
"safe": "off",
"nfpr": "0",
"filter": "0",
"max_pages": 1
},
"search_metadata": {
"total_results": 9,
"news_count": 9,
"pages_processed": 1,
"max_pages_set": 1,
"pagination_limit_reached": false
},
"search_information": {
"query_displayed": "artificial intelligence"
},
"search_timestamp": "2026-05-29T11:27:03",
"page_number": 1,
"news_results": [
{
"position": 1,
"title": "Improving multimodal wearable sensing for healthcare with artificial intelligence",
"link": "https://www.nature.com/articles/s41587-026-03134-z",
"source": "Nature",
"snippet": "This Comment explores artificial intelligence-driven strategies to accelerate the clinical translation of multimodal wearable sensors."
}
]
}
每个页面项目都会回显你发送的 search_parameters,报告 search_metadata(结果总数和已处理页数),并在 news_results 中列出每篇文章及其排名、标题、链接、来源和摘要。
用作 MCP 工具
你可以将 Google News API 加载为 MCP 工具,让助手代你调用。MCP 服务 URL 仅预加载了这一个 Actor:
https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI
出现提示时,可在浏览器中通过 OAuth 进行身份验证,也可以使用 Apify API 令牌(与 Python 示例中使用的 APIFY_API_TOKEN 相同)。可在 https://console.apify.com/settings/integrations 获取令牌,并在 https://apify.com?fpr=9n7kx3 注册免费的 Apify 账号。
在 Claude Cowork Desktop 中安装

Cowork 是桌面应用的自动化模式。若要将 Google News API 作为工具提供给它,请添加 Apify MCP 服务作为连接器。
- 打开 Claude 桌面应用,然后前往 Settings → Connectors(或前往 Settings → Developer → Edit Config,直接编辑
claude_desktop_config.json)。- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- 添加 Apify MCP 服务,其中仅预加载了这一个 Actor:
{
"mcpServers": {
"apify": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI"
]
}
}
}
- 重启应用。Cowork 首次调用工具时,请在浏览器中完成 OAuth 提示,或在连接器设置中添加 Apify API 令牌以跳过 OAuth。
- 在 Cowork 聊天中确认工具可用,然后让它运行 Google News API。
下载桌面应用并开始免费试用:https://claude.ai/referral/uIlpa7nPLg 更多帮助:https://docs.apify.com/platform/integrations/claude-desktop
在 Claude Code 中安装

Claude Code 是命令行工具。使用一条命令添加 Actor 的 MCP 服务:
claude mcp add --transport http apify \
"https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI"
若要使用令牌而非浏览器 OAuth:
claude mcp add --transport http apify \
"https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI" \
--header "Authorization: Bearer YOUR_APIFY_TOKEN"
然后使用 claude mcp list 验证,或在会话中运行 /mcp。让 Claude Code 调用 Google News API。
免费试用 Claude Code:https://claude.ai/referral/uIlpa7nPLg Claude Code MCP 文档:https://code.claude.com/docs/en/mcp
在 Claude(网站)中安装

在 claude.ai 上,将 Apify 添加为连接器,然后只启用此 Actor 的工具。
- 前往 Settings → Connectors → Browse connectors,搜索 Apify MCP server。安装它(如果出现提示,请启用或更新)。
- 连接时,使用 Apify API 令牌进行身份验证,并启用工具
johnvc/GoogleNewsAPI。 - 在任意聊天中,打开 + → Connectors,然后启用 Apify。
- 或者,选择 Add custom connector 并粘贴完整的 MCP URL
https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI,出现提示时使用 OAuth。 - 让 Claude 运行 Google News API。
在网页上打开 Claude:https://claude.ai/referral/uIlpa7nPLg
在 Cursor 中安装

Cursor 从项目文件 .cursor/mcp.json 中读取 MCP 服务。
- 在项目中创建
.cursor/mcp.json:
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI"
}
}
}
- 如果你更倾向于使用令牌身份验证,而不是浏览器 OAuth,请添加一个标头:
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI",
"headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
}
}
}
- 打开 Cursor → Settings → MCP,并确认 apify 服务已连接(显示绿点)。
- 在 Composer 或 Chat 中,让 Cursor 调用 Google News API。
刚接触 Cursor?从这里获取:https://cursor.com/referral?code=XQP4VBLI3NNX
在 ChatGPT 中安装

ChatGPT 通过开发者模式连接到 Apify MCP 服务(适用于 ChatGPT Pro、Plus、Business、Enterprise 和 Education 套餐)。
- 点击个人资料图标,然后前往 Settings > Apps。如果看不到 Create app 按钮,请打开 Advanced settings 并启用 Developer mode。
- 点击 Create app 并填写表单:
- Name: Apify
- MCP Server URL:
https://mcp.apify.com/?tools=actors,docs,johnvc/GoogleNewsAPI - Authentication: OAuth
- 点击 Create,并授权与 Apify 的连接。
- 要在对话中使用该应用,请点击聊天中的 +,选择 Developer mode,然后选择 Apify。
更多帮助:https://docs.apify.com/platform/integrations/mcp
使用 Google News API,为媒体监测、竞争情报、趋势检测和大模型上下文流水线提供可靠、结构化的结果。
精选任务
Apify Store 上可立即运行的示例。
🤖 向 AI 助手询问此 Actor
在你选择的 AI 中打开一条关于 Google News API 的即用提示词:
- 💬 ChatGPT
- 🧠 Claude
- 🔍 Perplexity
- 🅒 Copilot
最后更新:2026.10.27
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。
