Google Trends Scraper

io.github.RalfIJ由 GitHub 帳號 RalfIJ 發布v1.0.0更新於 Oct 24, 2026

Google Trends for any number of keywords on one scale: interest over time, regions, rising queries.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取資料與分析

概覽

AI 產生的概覽

一個託管在 Apify 上的 MCP 伺服器,用來取得關鍵字的 Google Trends 資料,包括隨時間變化的關注度、地區熱度和相關查詢。

可以做什麼
取得一個或多個關鍵字在同一尺度下的 Google Trends 資料,包括關注度隨時間變化與按地區分布,未完成的最後時段會標記為部分資料。取得熱門與相關上升查詢,包括突破性查詢。取得計算指標,例如平均、最新與峰值關注度、峰值日期、趨勢方向與變化百分比、最繁忙月份,以及比較關鍵字時的搜尋佔比。透過將每五個關鍵字分為一組、以各組領先詞串接並重新縮放,比較超過 Google 本身限制的關鍵字數量。
適用情境
適合需要讓助理查詢搜尋熱度趨勢、在同一尺度上比較多個關鍵字,或取得地區與相關查詢資料,同時不想自行撰寫擷取程式碼或處理 Google 的速率限制與工作階段 Cookie 的情境。
執行需求
遠端 MCP 端點 mcp.apify.com,加入時需帶上此擷取工具的 tools 參數。需要 Apify 帳號,並透過 OAuth 登入或在 Authorization 標頭中提供 Apify API 權杖。需要能連線至 Apify 的網路。
安裝前請注意
執行費用計入你自己的 Apify 帳號,依關鍵字計費,超出每月免費額度後會產生費用。Authorization 標頭攜帶 Apify API 權杖,必須保密。資料來自第三方擷取工具而非 Google,作者聲明此擷取工具由其本人開發。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Google Trends Scraper,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.RalfIJ%2Fgoogle-trends/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "google-trends-scraper": {
      "type": "http",
      "url": "https://mcp.apify.com/?tools=ralfij/google-trends-scraper"
    }
  }
}

README

Google Trends API for Python (a pytrends alternative)

Get Google Trends data into Python: interest over time, interest by region, top and rising related searches, and simple trend metrics. You can also compare 10, 50 or 100+ keywords on one scale. The Google Trends website stops at 8 (5 in classic Explore).

pytrends was archived in April 2025 and often fails with 429 Too Many Requests. Google announced an official Trends API in July 2025, but it is an alpha with limited, application-based access. These examples use a hosted scraper instead, the Google Trends Scraper on Apify, which deals with Google's session cookies and rate limits for you.

Tutorial: Google Trends in Python without pytrends, and how to compare more keywords than Google allows. It covers the two endpoints behind the website, the trick for linking comparisons, and what the data looks like.

[Google searches for programming languages over 5 years]

Example output: search interest in the Programming category fell 40-68% for most languages between 2021 and 2026. Made with examples/compare_keywords.py and matplotlib.

Quick start

  1. Create a free Apify account. The free plan includes $5 of credit every month, which covers about 2,500 keywords. No credit card needed.
  2. Copy your API token from Settings > API & Integrations in Apify Console.
  3. Run an example:
bash
pip install -r requirements.txtexport APIFY_TOKEN=your-token        # Windows: set APIFY_TOKEN=your-tokenpython examples/compare_keywords.py
keyword       share %  average  trendjava             29.4     63.7  falling (-48.8%)c++              23.8     51.6  stable (-7.1%)python           15.8     34.3  falling (-43.7%)...

Examples

FileWhat it does
examples/compare_keywords.pyCompares 10 keywords on one shared scale, prints share of search and trend, and saves a CSV
examples/keyword_report.pyTrend, peak, busiest month, top regions and rising searches per keyword
examples/plot_trends.pyPlots interest over time for several keywords with matplotlib
examples/raw_endpoints.pyThe two JSON endpoints behind trends.google.com, with no library at all. Good for a few keywords.

sample-output/programming-languages-5y.csv shows the CSV from compare_keywords.py.

What you get per keyword

  • interestOverTime: the full time series (0-100), with the unfinished last week or day marked partial
  • interestByRegion: countries, states or regions where the keyword is most popular
  • relatedQueriesTop and relatedQueriesRising, including breakouts
  • averageInterest, latestInterest, peakInterest, peakDate
  • trend (rising, falling or stable) and trendChangePercent: the last quarter of the period against the first quarter
  • busiestMonth for periods of about a year or longer
  • shareOfSearch when you compare keywords on one shared scale

How comparing many keywords works

Google's Trends API compares at most 5 keywords per request (the website shows up to 8) and scales each request so its highest point is 100. To compare more, the scraper:

  1. requests the keywords in groups of 5;
  2. compares the most searched keyword of each group (the group "leader") with the other leaders, 5 at a time with one leader of overlap, so any number of groups can be chained;
  3. rescales every group through its leader, then rescales everything so the highest point overall is 100.

Google rounds to whole numbers, so a tiny keyword next to a huge one can still show as 0. Compare keywords of a similar size for the best precision.

Use it from AI assistants (MCP)

To let Claude, Cursor, VS Code or another MCP client look up Google Trends for you, add this MCP server URL: https://mcp.apify.com/?tools=ralfij/google-trends-scraper. Sign in to Apify when the client asks, or send your Apify API token as Authorization: Bearer <token>. Runs are billed to your own Apify account.

Notes

  • I built the Google Trends Scraper used in these examples, so keep that in mind. raw_endpoints.py shows how to do it yourself.
  • Pricing is per keyword with no subscription; see the actor page. More ready-made searches are on its example tasks.
  • Not affiliated with, endorsed by or sponsored by Google. Google Trends is a trademark of Google LLC.

License

MIT

來源:README.md,提交 b5380a2

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

1
  1. v1.0.0最新Oct 10, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分