Google Trends

io.github.mamrrezv0.1.1更新于 Oct 2, 2026

Google Trends: Trending Now, interest over time, regions, related searches. No API key.

概览

AI 生成的概览

让助手查询 Google Trends 的热门搜索、随时间变化的关注度、地区分布、相关查询和季节性分析。

功能
提供 32 个基于 Google Trends 数据的工具:带搜索量和分类的热门榜、最多五个词的关注度趋势、按国家/地区/城市/都会区划分的关注度、相关查询和主题,以及动量、季节性、搜索份额、突增和每日历史等分析工具。还可将热门榜快照保存到本地 SQLite 文件,并提供关注列表和只读 SQL 查询。结果以表格和标注过的指数值返回,而不是图表。
适用场景
适合让助手研究搜索需求、比较品牌或关键词、规划季节性内容,或查看某国的热门话题,而无需打开 Trends 网站。适用于需要趋势方向或地区关注度的营销、内容和市场调研问题。
运行要求
以 PyPI 包 gtrends-mcp-full 通过 stdio 在本地运行,用 uvx 启动,需要 Python 3.10 或更高版本以及 uv(或 pip)。不需要 API 密钥、账号或登录。可选设置包括 GTRENDS_GEO、GTRENDS_HL、GTRENDS_TIMEZONE、GTRENDS_PROXY 和 GTRENDS_COOKIE;除非设置 GTRENDS_OFFLINE,否则需要访问 Google Trends 端点的网络。
安装前请注意
它查询的是未公开的 Google Trends 端点,请求可能被限流,端点变化时也可能失效。GTRENDS_COOKIE 或 GTRENDS_COOKIES_FILE 提供已登录的 Google 会话 cookie,属于凭据,应视为敏感信息。HTTP 模式没有身份验证,未设置 GTRENDS_ALLOWED_HOSTS 时不会在公网地址上启动。保存的快照、关注列表和缓存存放在本地 SQLite 文件中。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Google Trends,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Google Trends MCP Server — works with Claude, ChatGPT Codex, Cursor, VS Code and Windsurf]

Google Trends MCP Server — gtrends-mcp-full

The complete MCP server for Google Trends. Ask Claude, Cursor, Windsurf, VS Code, Codex or any other MCP client what people are searching, where, when, and what is taking off right now — and get analysis back, not a chart to squint at.

32 tools · Trending Now with real search volumes · interest over time, by region and related searches · seasonality, momentum and share of search · no API key, no browser, no sign-in.

[PyPI] [CI] [Python 3.10+] [MCP SDK 2.x] [License: MIT]

Project page · Quick start · Tools · Prompts · Configuration · How it stays unblocked · FAQ · Docs


[Claude answering whether heat pump searches are growing in the UK, using the trend_momentum and seasonality tools of gtrends-mcp-full]

What you get

✅ CompleteEverything the Google Trends website shows: the full Trending Now list (hundreds of trends per country, with search volume, growth, start time, category and the queries inside each one), the news behind a trend, interest over time down to the minute, interest by country, region, city and metro area, related queries and topics, every category and location, Web, YouTube, News, Images and Shopping search.
🔑 Nothing to set upNo API key, no Google Cloud project, no sign-in, no headless browser. Install it and ask.
🧠 Answers, not chartsIs it growing or fading? When does it peak, and when must the content be live? Who is winning share of search? What suddenly jumped, and when? Worked out for you and returned as short tables your AI can reason about.
📈 Past the limits of the websiteCompare 25 terms on one scale instead of five. Daily data over years instead of nine months. Trending Now history kept for as long as you like instead of one week.
🛡️ Built to keep workingPaced requests, a persistent session, back-off instead of hammering, and a cache that still answers — and says so — when Google will not. Related-searches and chart requests are budgeted separately, so a limit on one never takes down the rest.
🎯 Honest numbersEvery value is labelled for what it is: Google's 0–100 index, never a search count. Partial periods are marked. A failure is an error with its reason and what to do next, never an empty result.
💸 Free and lightMIT licensed. Two dependencies. Runs on your machine; nothing is sent anywhere but Google. Tested on Linux, macOS and Windows with Python 3.10–3.13.

Works with: Claude Desktop · Claude Code · Cursor · Windsurf · VS Code (Copilot agent mode) · OpenAI Codex CLI · any MCP client over stdio or HTTP.

Tools

32 tools in 5 groups. You don't call them yourself — ask in plain language and your AI picks the right one.

🗄️ works on the local data file, no request to Google

🔥 Trending now

ToolWhat it gives youAsk it like this
trending_nowThe full Trending Now list for a country or region: search volume, growth, start time, still active or over, category, and the other queries people type for the same story. Filter by category, status, volume or text"What's trending in Germany in the last 4 hours?" · "Active sports trends in the US above 100K searches"
trend_detailsOne trend in full: every query inside it, the news articles behind it, and its hour-by-hour curve for the past week"Why is 'pentobarbital' trending?"
trending_feedThe top daily trends with headlines and links — the fastest answer to "what's in the news there today""Give me today's top searches in Iran with the headlines"
trending_across_countriesTrends that are live in several countries at once, grouped even when titles differ"What is trending in both the US and the UK right now?"
match_trendsWhich current trends touch your subjects, brands or products — for newsjacking"Is anything about electric cars, Tesla or charging trending today?"

🔎 Explore a keyword

ToolWhat it gives youAsk it like this
keyword_overviewThe whole Trends page in one call: curve, direction, top places, rising and top related queries"Give me the Google Trends picture for 'heat pump' in the UK"
interest_over_timeThe main chart for up to 5 terms on one scale — any range from one hour to 2004-today, any location, category and search type, with operators (a + b, a -b, "a b")"Compare tesla and byd over 5 years in Germany" · "YouTube interest in 'lofi' this week"
interest_by_regionWhere a term matters most: countries, regions, cities or metro areas. With several terms: who leads where"Which US states search 'tesla' the most?" · "Where does byd beat tesla?"
related_queriesWhat else people search around a term — the top queries and the rising ones, with breakouts flagged"What are the rising searches around 'solar panels'?"
related_topicsThe people, brands and things searched alongside a term, with topic ids"Which topics are related to 'tesla'?"
compare_periodsOne term in two time ranges on one scale: this year against last, this quarter against the one before"Is 'sunscreen' ahead of last summer?"
compare_locationsOne term in up to 5 countries or regions side by side"Compare interest in cricket in India, the UK and Australia"

🧠 Analysis

ToolWhat it gives youAsk it like this
trend_momentumA verdict per term — breakout, rising, stable, declining or new — with year-over-year change, last quarter vs the one before, long-run slope and distance from its peak"Which of these eight product ideas is actually growing?"
seasonalityThe yearly rhythm: a month-by-month index, peak and low months, how reliably it repeats, year-by-year growth, the next six months, and the date content should be live"When do people search for air conditioners, and when should I publish?"
content_calendarA publishing calendar for up to 8 topics, sorted by what is due first; evergreen topics listed separately"Build me a content calendar for these topics"
share_of_searchYour brand's share of searches against up to 4 competitors — overall, at the start, at the end, and the change in points"What's Toyota's share of search against Honda, Ford and Tesla?"
compare_many6 to 25 terms ranked on a single scale, past the five-term limit of the website"Rank these 20 car brands by search interest in the US"
find_spikesThe moments a term jumped: when each spike began, peaked and ended, and how many times the usual level it reached"When did searches for 'earthquake' spike in the last five years?"
daily_historyDay-by-day interest over years (the website stops at about nine months), plus the weekday pattern"Daily interest in 'pizza delivery' for 2024 and 2025 — which weekday is biggest?"
keyword_ideasRising and top related queries for up to 5 seeds, merged and de-duplicated, breakouts first"Give me keyword ideas around 'electric bike' and 'e-scooter'"

🗄️ History that Google does not keep

ToolWhat it gives youAsk it like this
snapshot_trendingSaves the current Trending Now list to a local file. Google drops a trend after about a week; this keeps it"Save today's trends for the US, UK and Germany"
trending_history 🗄️Searches everything saved: when something trended, how big it got, how long it lasted"Did anything about 'iphone' trend in the US last month?"
watchlist_add 🗄️Puts terms on a watchlist, per location, with a note"Watch 'heat pump' and 'solar panels' in the UK"
watchlist_reportThe watchlist measured now: direction, what changed since the last report, and whether a term is trending today"How is my watchlist doing?"
watchlist_remove 🗄️Takes terms off the watchlist"Stop watching 'fax machine'"
history_sql 🗄️Read-only SQL over the saved trends, snapshots, watchlist and readings"Which categories trended most in Germany this month?"

🧭 Lookups and utilities

ToolWhat it gives youAsk it like this
find_locationThe code for any country, region, state or metro area, or the list of places inside one"What's the Google Trends code for Tehran province?"
find_categoryCategory ids, to pin an ambiguous word to one meaning"Limit 'jaguar' to cars"
find_topicGoogle's topics for a name — one id that covers every language and spelling of a thing"Use the company Tesla, not the word"
get_capabilities 🗄️Settings, session state, cache and history coverage, the tool list"Is the Trends server set up correctly?"
check_endpointsAsks each Google Trends endpoint one question and reports which still answer"Why did the last Trends call fail?"
clear_cache 🗄️Drops saved answers, optionally resets the session"Refresh the trending data"

The full reference with every parameter is in docs/tools.md — generated from the code, so it is never out of date.

Prompts

Four ready-made workflows that appear in your client's prompt menu. Each chains several tools and says what the finished answer must contain.

PromptWhat it produces
trend_reportA full read on one keyword: direction, seasonality, the events behind its spikes, rising themes, and what to do about it
newsjacking_briefToday's trends that fit your subjects, the story behind each, the queries to target, an angle and a risk note
seasonal_content_planA twelve-month publishing plan for a list of topics
market_comparisonShare of search for a brand against its competitors, who wins where, and what is rising around each

Two reference pages are also exposed as MCP resources: gtrends://guide (how to read the numbers, time ranges, operators, topics) and gtrends://trending-categories.

Quick start

You need Python 3.10 or newer and uv (or pip).

1. Add it to your client

Nothing to download first: uvx fetches the package from PyPI and runs it.

Claude Code

sh
claude mcp add gtrends -- uvx gtrends-mcp-full

Claude Desktop, Cursor, Windsurf, VS Code — add this to the client's MCP configuration:

json
{  "mcpServers": {    "gtrends": {      "command": "uvx",      "args": ["gtrends-mcp-full"],      "env": {        "GTRENDS_GEO": "US",        "GTRENDS_TIMEZONE": "America/New_York"      }    }  }}

Both env entries are optional. There is nothing else to configure: no key, no sign-in.

2. Check it

sh
uvx gtrends-mcp-full doctor

doctor asks every Google Trends endpoint one question; all eight should say OK. On the very first run a chart endpoint may report that the session is still being validated — that passes after a minute and a half and does not come back.

3. Ask

What's trending in the US right now, and which of it is about technology? Is "heat pump" growing in the UK? When does it peak? Rank these 15 car brands by search interest in Germany. What is Toyota's share of search against Honda and Ford this year?

From the command line

With the package installed (uv tool install gtrends-mcp-full or pip install gtrends-mcp-full):

sh
gtrends-mcp-full doctor                 # configuration and endpoint checkgtrends-mcp-full trending US            # print what is trending nowgtrends-mcp-full snapshot US,GB,DE      # save Trending Now to the local history (for cron)gtrends-mcp-full --transport streamable-http --port 8000   # serve over HTTP instead of stdio

Keep a trending history by scheduling the snapshot, for example every six hours:

cron
0 */6 * * * gtrends-mcp-full snapshot US,GB,DE

Reading the numbers

Everything Google Trends returns is an index from 0 to 100, not a search count: the share of all searches a term had, rescaled so the highest point in that one request is 100. Three things follow, and the tools are built around them:

  • Only terms in the same request are comparable. compare_many, share_of_search, compare_periods and compare_locations build one scale for you.
  • Across places it is a share of local searches. A small country can outrank a large one.
  • The last point of a range is usually incomplete. It is marked, and left out of averages.

The exception is Trending Now, which carries real — bucketed — search volumes ("200K+").

A search term is matched literally. To count two wordings as one, join them in a single term with + (e-mail + email); for the name of a thing, find_topic gives a topic id that Google resolves across languages and spellings.

Configuration

Every setting is optional.

VariableDefaultWhat it does
GTRENDS_GEOworldwideDefault location code (US, IR, US-CA) when a tool is called without one
GTRENDS_HLen-USLanguage of the names Google returns (locations, categories, topics)
GTRENDS_TIMEZONEthis machine'sIANA timezone for times in results and for hourly data, e.g. Asia/Tehran
GTRENDS_PROXYnoneHTTP(S) proxy URL for requests to Google
GTRENDS_MIN_INTERVAL1.5Seconds between requests to Google
GTRENDS_CACHE_TTL3600Seconds a chart answer is reused
GTRENDS_TRENDING_TTL300Seconds a Trending Now answer is reused
GTRENDS_TIME_BUDGET50Seconds one tool call may spend waiting on Google before it reports back
GTRENDS_COOKIE / GTRENDS_COOKIES_FILEnoneA signed-in Google session (raw Cookie header, or a Netscape cookies.txt). Only needed for related_topics; see Security
GTRENDS_OFFLINEoffAnswer from the cache only, never contact Google
GTRENDS_CONFIG_DIR~/.config/gtrends-mcp-fullWhere the data file and session cookie live
GTRENDS_DB_PATH<config dir>/trends.sqliteThe data file: cache, trending history, watchlist
GTRENDS_ALLOWED_HOSTSnoneHost names allowed in HTTP mode behind a reverse proxy. HTTP mode has no authentication and will not start on a public address without this — see Security

How it stays unblocked

Google Trends has no public API for general use, so this server speaks to the same endpoints as the Trends website. Those endpoints are rate-limited and unforgiving of scripts that behave like scripts. What the server does about it:

  • One long-lived session. Google refuses the chart endpoints without its session cookie, and turns away a cookie it has only just issued for the first minute and a half. The server fetches one cookie when it starts, lets it mature in the background, stores it, and reuses it on every later run. The endpoints that work without a cookie — Trending Now, the feed, lookups — never wait for it.
  • Pacing. Requests are spaced: 1.5 s by default, 2 s for charts, and 6 s between two related-searches requests, the touchiest endpoint. After a refusal the gap widens for five minutes.
  • Back-off, then silence. A real rate limit is retried a few times with growing delays. If it persists, the server stops asking that group of endpoints for a few minutes instead of making the block worse — the other groups keep working.
  • A cache with a fallback. Every answer is stored. Ask twice, one request. When Google refuses, an older answer is served and labelled with its age.
  • Fewer requests by design. One chart request can carry five terms; a second chart for the same question reuses the first one's tokens.
  • A time budget. A tool call reports back within the budget with what it has, naming what is missing, rather than hanging your client.

check_endpoints (or gtrends-mcp-full doctor) tells you at any moment which endpoints answer, and whether a failure is a rate limit, a changed endpoint or the network.

FAQ

Is this the official Google Trends API? No. Google announced an official API in 2025, but it is a closed alpha for approved testers. This server uses the endpoints behind the Trends website, which need no key. They are undocumented and can change; when one does, check_endpoints says which, and the fix is a package update.

Do I need a Google account? No. One tool, related_topics, returns an empty list to anonymous sessions — Google withholds it — and says so. Supplying a signed-in cookie unlocks it; everything else works without.

Can it give me search volumes? Trending Now carries real volumes, in buckets (2K+, 200K+). Everything else is the 0–100 index, which measures relative interest. No tool pretends otherwise.

I asked for the same thing twice and one number moved by a point. Google Trends is computed from a sample of searches, so repeated requests can differ slightly. The cache returns the same answer within its lifetime.

A tool says Google is rate-limiting. Wait a few minutes; cached answers keep working. If it happens often, ask for several keywords in one call instead of one call each, raise GTRENDS_MIN_INTERVAL, or set GTRENDS_PROXY.

A tool says the session is still being validated. That is the first ninety seconds after the very first start. Trending tools work in the meantime, and it does not happen again: the session is stored.

Why does a small country outrank a big one? Because the index is a share of that place's own searches, not a count.

Where is my data? In one SQLite file on your machine (~/.config/gtrends-mcp-full/trends.sqlite): cached answers, the Trending Now snapshots you saved, and your watchlist. Nothing is sent anywhere except the requests to Google Trends.

Development

sh
uv venv && uv pip install -e ".[dev]"uv run pytest              # no network needed: the tools run against a fake Google Trendsuv run ruff check src testspython scripts/gen_tools_doc.py   # after changing a tool's signature or docstringpython scripts/record_fixtures.py # re-record the real answers the contract tests replay (about 15 requests to Google)

See CONTRIBUTING.md and CHANGELOG.md.

Related

  • gsc-mcp-full — the companion Google Search Console MCP server: 37 tools, every API endpoint, hourly data and history beyond 16 months.

License

MIT. Not affiliated with or endorsed by Google. Google Trends is a trademark of Google LLC. Use of Google Trends data is subject to Google's terms of service.

来源:README.md,提交 f0732a2

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.1最新Oct 2, 2026