关于 Google Trends (via Apify)
Google Trends Scraper 是面向开发者和 AI Agent 的 Apify Actor,可获取关键词及各地区的搜索趋势。它提供历史热度、地区数据、相关查询和当前热门搜索,并支持筛选与词条比较。
主要功能
- 01热度时间线与趋势变化
- 02国家、州和城市数据
- 03热门及上升相关查询
- 04含增幅和搜索量的热门搜索
- 05按地区、日期或搜索类型筛选并比较词条
适用场景
- 01跟踪关键词热度变化
- 02比较不同词条的搜索需求
- 03监控某个国家的新兴搜索
- 04为 AI Agent 提供趋势数据
MCP 相关
通过 Apify 托管的 MCP 服务提供,MCP 客户端可调用 Google Trends Scraper Actor。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.apify.com/?tools=automationnation/google-trends-scraperclaude mcp add --transport http retracn-google-trends https://mcp.apify.com/?tools=automationnation/google-trends-scraper{"mcpServers":{"retracn-google-trends":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-trends-scraper"}}}在 Cursor 中打开{"servers":{"retracn-google-trends":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-trends-scraper"}}}在 VS Code 中打开{"mcpServers":{"retracn-google-trends":{"type":"http","url":"https://mcp.apify.com/?tools=automationnation/google-trends-scraper"}}}{"mcpServers":{"retracn-google-trends":{"serverUrl":"https://mcp.apify.com/?tools=automationnation/google-trends-scraper"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://mcp.apify.com/?tools=automationnation/google-trends-scraper需要授权工具
详细介绍
Google Trends 抓取器与 API:关键词趋势和实时热门趋势
Google Trends Scraper 是一款 Apify Actor,可提取任意关键词和地区的 Google Trends 数据,包括随时间变化的关注度、按地区和城市划分的关注度、上升趋势和热门相关查询,以及任意国家的热门搜索,每 1,000 份关键词报告收费 $1。它可作为 Google Trends API 使用:从代码中调用、安排定期运行以获取趋势提醒,或通过 Apify 的 MCP 服务供 AI Agent 使用。
**价格:**每 1,000 份关键词报告 $1(付费方案为 $0.27–$0.90)· 每 1,000 条热门搜索 $0.50 · 运行地址:https://apify.com/automationnation/google-trends-scraper · 指南:https://retracn.github.io/automationnation-actors/google-trends-scraper/
快速了解
- 每个关键词对应一行数据:包含 0–100 的时间线及日期、趋势方向和变化百分比、峰值日期、一句话摘要、按国家/州/城市划分的关注度,以及包含增长百分比和 Breakout 标记的热门及上升相关查询。
- 从 pytrends 迁移?开源的 pytrends-cloud 软件包(github.com/retracn/pytrends-cloud)保留了 pytrends 的 TrendReq 接口,并在此 Actor 上运行:只需更改一处导入,即可告别 429 错误。
- 任意国家的热门趋势:搜索量、增长百分比、开始时间、相关搜索和新闻文章;“仅限新趋势”模式可将定期运行变为提醒。
- 与 Google Trends 一样,最多比较 5 个词条;也可在同一尺度上比较任意数量的词条(通过共享锚点词条重新缩放)。
- 支持所有 Google Trends 选项:任意国家或次级地区、过去 1 小时至 2004 年至今的时间范围或自定义日期、类别,以及网页/图片/新闻/YouTube/Shopping 搜索;输入可使用关键词、Google Trends URL 或 Google Sheet。
- 价格:Free 方案每 1,000 份关键词报告收费 $1,每 1,000 条热门搜索收费 $0.50(付费方案价格更低);搜索量过低的关键词免费。Apify 每月 $5 的免费额度可用于约 5,000 份关键词报告。
- 输入字段与 apify/google-trends-scraper 相同,而且每行还包含该 Actor 的输出字段。
- 使用 Node.js?开源的 google-trends-api-cloud 软件包(github.com/retracn/google-trends-api-cloud)保留了 google-trends-api npm API 和 JSON,可在此 Actor 上运行,并让 dailyTrends 和 realTimeTrends 再次正常工作。
输入示例
{
"searchTerms": [
"chatgpt",
"gemini",
"claude ai"
],
"geo": "US",
"timeRange": "today 12-m"
}
从代码中运行
REST API
curl -X POST "https://api.apify.com/v2/acts/automationnation~google-trends-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms": ["chatgpt", "gemini", "claude ai"], "geo": "US", "timeRange": "today 12-m"}'
Python — 参见 examples/python_example.py
# pip install apify-client
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("automationnation/google-trends-scraper").call(run_input={
"searchTerms": [
"chatgpt",
"gemini",
"claude ai"
],
"geo": "US",
"timeRange": "today 12-m"
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item.get("searchTerm"), item.get("trendDirection"), item.get("changePercent"), item.get("summary"))
JavaScript — 参见 examples/node_example.mjs
// npm install apify-client
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('automationnation/google-trends-scraper').call({
"searchTerms": [
"chatgpt",
"gemini",
"claude ai"
],
"geo": "US",
"timeRange": "today 12-m"
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) console.log(item.searchTerm, item.trendDirection, item.changePercent, item.summary);
与 AI Agent 配合使用(MCP)
托管的 MCP 服务 URL(适用于 Claude、ChatGPT、Cursor 以及其他支持远程 MCP 的客户端):
https://mcp.apify.com?tools=automationnation/google-trends-scraper
Claude Desktop / Cursor 的本地配置 — mcp/claude_desktop_config.json:
{
"mcpServers": {
"google-trends-scraper": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server",
"--tools",
"automationnation/google-trends-scraper"
],
"env": {
"APIFY_TOKEN": "YOUR_APIFY_TOKEN"
}
}
}
}
常见问题
有官方的 Google Trends API 吗? Google 于 2025 年向一小群 Alpha 测试者开放了官方 Google Trends API。其他用户可以通过 Apify 上的 Google Trends Scraper,借助 Apify 的 REST API、Python 和 JavaScript 客户端、集成和 MCP 获取 Google Trends 数据。
Google Trends Scraper 会返回哪些内容? 每个关键词都会返回:随时间变化的热度(0–100,含日期)、趋势方向、变化百分比、峰值日期、一句话摘要、按地区和城市划分的热度,以及相关查询中的热门内容和上升趋势内容。“当前热门”结果还包括搜索量、增长百分比、开始时间、相关搜索和新闻文章。
可以比较超过 5 个关键词吗? 可以。使用“在同一尺度上比较所有搜索词”后,系统会围绕一个共同的锚点词分批处理搜索词并重新缩放,因此任意数量的搜索词都能显示在同一条 0–100 刻度上。
费用是多少? 在 Apify 的免费计划中,每 1,000 份关键词报告收费 $1,每 1,000 次热门搜索收费 $0.50;付费计划的价格更低。搜索量不足的关键词和失败的搜索均免费。
可以从 apify/google-trends-scraper 切换过来吗? 可以。保留现有输入(searchTerms、isMultiple、timeRange、customTimeRange、geo、category、startUrls、spreadsheetId、maxItems),并更改 Actor ID;结果行会在更简洁的字段名称旁保留该 Actor 的字段名称。
AutomationNation 的更多内容
- AI 可见度追踪器 — 每次检查答案收费 $0.05(Gold 方案为 $0.04)+ 每份可选报告收费 $0.50 · GitHub 示例
- Google Jobs 抓取工具 — 每 1,000 个职位收费 $2(付费方案为 $1.50)+ 每次搜索收费 $0.03 · GitHub 示例
- YouTube 字幕抓取工具 — 每 1,000 份字幕收费 $1.50(Gold 及以上方案为 $1.20)· GitHub 示例
- Google Shopping 抓取工具 — 每 1,000 个商品收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Flights 抓取工具 — 每 1,000 个航班收费 $0.20(Gold 及以上方案为 $0.16)· GitHub 示例
- Google Hotels 抓取工具 — 每 1,000 家酒店收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Ads Transparency 抓取工具 — 每 1,000 条广告收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google News 抓取工具 — 每 1,000 篇文章收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- Google Images 抓取工具 — 每 1,000 张图片收费 $0.25(Gold 及以上方案为 $0.20)· GitHub 示例
- Google Custom Search API 替代方案 — 每 1,000 次搜索(每次最多 10 条结果)收费 $5(Gold 及以上方案为 $4)· GitHub 示例
- Google Videos 抓取工具 — 每 1,000 个视频收费 $1(Gold 及以上方案为 $0.80)· GitHub 示例
- App Store 评论抓取工具 — 每 1,000 条评论收费 $0.08(付费方案为 $0.05–$0.07)· GitHub 示例
- Google Play 评论抓取工具 — 每 1,000 条评论收费 $0.08(付费方案为 $0.05–$0.07)· GitHub 示例
- AEO 与 GEO 追踪器 — Google AI Overview 引用检查器 — 每个关键词收费 $0.04(Gold 方案为 $0.032),自 2026 年 11 月 17 日起每次运行另收 $2;截至 2026 年 10 月 16 日,每个关键词收费 $0.01 · GitHub 示例
- Google Maps 潜在客户抓取工具 — 每条潜在客户信息收费 $0.03(Gold 方案为 $0.024);使用无网站或未认领筛选条件时,每家找到的企业收费 $0.08 · GitHub 示例
- Google Maps 英国潜在客户抓取工具 — 每条潜在客户信息收费 $0.05(Gold 方案为 $0.04)· GitHub 示例
- App Store 与 Google Play 评论抓取工具 + AI — 每份应用报告收费 $0.05(Gold 方案为 $0.04)· GitHub 示例
- 英国 Companies House 潜在客户 — 申报信号与 AI 外联 — 每条潜在客户信息收费 $0.008
- 联系人瀑布式信息补充 — 电子邮件与董事 — 每家公司收费 $0.015
- 所有 Actor 和指南 · AI 可见度追踪器对比 · Google Jobs 抓取工具对比 · Google Trends 抓取工具对比 · App Store 评论抓取工具对比 · Google Play 评论抓取工具对比 · YouTube 字幕抓取工具对比 · Google Flights 抓取工具对比 · Google Hotels 抓取工具对比 · Google Ads Transparency 抓取工具对比 · Google Shopping 抓取工具对比 · Google News 抓取工具对比
此存储库包含用法示例。爬虫本身运行在 Apify 平台 上;你需要一个免费的 Apify 账户和 API 令牌。示例采用 MIT 许可证。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。