mcpField
G
Google Trends (via Apify)

Google Trends (via Apify)

远程服务
apify.com数据与分析03 周前更新

关于 Google Trends (via Apify)

Google Trends Scraper 是面向开发者和 AI Agent 的 Apify Actor,可获取关键词及各地区的搜索趋势。它提供历史热度、地区数据、相关查询和当前热门搜索,并支持筛选与词条比较。

主要功能

  1. 01热度时间线与趋势变化
  2. 02国家、州和城市数据
  3. 03热门及上升相关查询
  4. 04含增幅和搜索量的热门搜索
  5. 05按地区、日期或搜索类型筛选并比较词条

适用场景

  1. 01跟踪关键词热度变化
  2. 02比较不同词条的搜索需求
  3. 03监控某个国家的新兴搜索
  4. 04为 AI Agent 提供趋势数据

MCP 相关

通过 Apify 托管的 MCP 服务提供,MCP 客户端可调用 Google Trends Scraper Actor。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://mcp.apify.com/?tools=automationnation/google-trends-scraper
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

全部服务地址
Streamable HTTPhttps://mcp.apify.com/?tools=automationnation/google-trends-scraper需要授权

工具

详细介绍

Google Trends 抓取器与 API:关键词趋势和实时热门趋势

在 Apify 上运行

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 的更多内容


此存储库包含用法示例。爬虫本身运行在 Apify 平台 上;你需要一个免费的 Apify 账户和 API 令牌。示例采用 MIT 许可证。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。