About trenddata
trenddata is a local bridge that returns Google Trends data as JSON for analysts and applications exploring search interest. It forwards requests to HasData’s hosted MCP server and offers both CLI and stdio MCP access.
Key features
- 01Fetch interest over time and by region
- 02Retrieve related topics and queries
- 03Filter by geography, date, and category
- 04Choose Google property and time zone
- 05CLI and stdio MCP modes
Use cases
- 01Compare search interest across locations
- 02Track a term over a chosen date range
- 03Explore related searches for a topic
MCP support
Exposes a Google Trends data-fetch tool to MCP clients through a local server, forwarding calls to HasData’s hosted MCP server. The same tool is also available through the CLI.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 2d ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Specify the search term for which you want to retrieve trends data. |
| tz | number | No | Defines a time zone offset in minutes. The default value is 420 (Pacific Daylight Time (PDT): UTC-7). The valid range for this parameter is from -1439 to 1439. To calculate the `tz` value for a specific time zone, you can use the time difference between UTC +0 and the desired time zone. Examples: - `420`: Pacific Daylight Time (PDT) - `60`: Central European Time (CET) - `-540`: Japan Standard Time |
| cat | string | No | Category of the search term. The default value is 0 ("All categories"). Provide one exact documented value (1133 allowed), e.g. `0`, `3`. |
| geo | string | No | Specifies the location for the search. Defaults to Worldwide if not set or empty. Provide one exact documented value (3517 allowed), e.g. `AF`, `AF-BDS`. |
| date | string | No | Defines a date range for the search. Available options: - `now 1-H`: Past hour - `now 4-H`: Past 4 hours - `now 1-d`: Past day - `now 7-d`: Past 7 days - `today 1-m`: Past 30 days - `today 3-m`: Past 90 days - `today 12-m`: Past 12 months - `today 5-y`: Past 5 years - `all`: 2004 - present You can also specify a custom date range using one of the following formats: - `yyyy-mm-dd yyyy-mm-dd` - (e.g. 2021-10-15 2022-05-25) for dates from 2004 to present. - `yyyy-mm-ddThh yyyy-mm-ddThh` - (e.g. 2022-05-19T10 2022-05-24T22) for dates with hours within a week range. The hours will be calculated based on the tz (time zone) parameter. |
| gprop | enum | No | Sorts results by a specific property. The default property is Web Search (applied when the gprop parameter is not set or empty). Available options: - `images`: Image Search - `news`: News Search - `froogle`: Google Shopping - `youtube`: YouTube Searchimages | news | froogle | youtube |
| region | enum | No | Used to get more specific results when using "Interest by region" data type. Other data types do not accept this parameter. The default value depends on the geo location that is set. Available options: - `country`: Country - `region`: Subregion - `dma`: Metro - `city`: City Note: Not all region options will return results for every geo location.country | region | dma | city |
| dataType | enum | No | Defines the type of search to perform. Available options: - `timeseries`: Interest over time (default). Accepts both single and multiple queries per search. - `geoMap`: Interest by region. Accepts both single and multiple queries per search. - `relatedTopics`: Related topics. Accepts only single query per search. - `relatedQueries`: Related queries. Accepts only single query per search.timeseries | geoMap | relatedTopics | relatedQueries |
Details
From the project READMEtrenddata
trenddata is a small local bridge to the hosted HasData Google Trends MCP server, which returns Google Trends data as JSON. Give it one or more search terms, and it fetches interest over time, interest by region, and the related topics and related queries for those terms. Lookups can be narrowed by geography, region granularity (country, subregion, metro, or city), date range, category, time zone offset, and Google property (web search by default, or images, news, shopping, or YouTube).
The bridge stores no trends data of its own. It serves the upstream server's tool list locally, exactly as captured from the live endpoint, and forwards each tool call upstream, returning the result untouched. The captured surface is a single read-only fetch: there is no write, messaging, or payment tool in it.
Tools
hasdata_google_trends_search_getTrendsData— fetch Google Trends data for a query. Required:q(the search term). Optional:geo(location code; worldwide when unset or empty),region(country/region/dma/city, used with the interest-by-region data type),dataType(timeseries/geoMap/relatedTopics/relatedQueries),tz(time zone offset in minutes, default 420),cat(category code, default0for all categories),gprop(images/news/froogle/youtube; web search when unset), anddate(a named range such astoday 12-morall, or a customyyyy-mm-dd yyyy-mm-ddrange). Returns interest-over-time series, geo-level breakdowns, and rising and top related topics and queries with relative scores.
Configuration
HASDATA_GOOGLE_TRENDS_MCP_URL(optional) — override the upstream endpoint. Defaults tohttps://mcp.hasdata.com/mcp?apis=google_trends. (The override hook is this rebuild's own labelled reconstruction.)HASDATA_API_KEY(optional) — when set, every upstream request carries anx-api-key: <key>header, for the caller's own HasData API key. When it is not set, no key header is sent. (The header name and the env name are pinned by the original's registry record; forwarding the key from this env var is a labelled reconstruction — the original surface was captured keyless.)
Forwarding mechanics
On the first tool call the client opens a streamable
HTTP session with the upstream: a JSON-RPC
initialize request (protocolVersion 2025-03-26,
clientInfo name trenddata), then a
notifications/initialized notification, then the
tools/call request carrying the caller's arguments
unchanged. When the upstream answers initialize
with an Mcp-Session-Id header, that value rides on
every later request of the session, which is reused
for the life of the process. Replies may arrive as
plain JSON or as server-sent events; both are read.
Successful upstream results pass through verbatim,
including any isError flag the upstream sets.
Failures — a JSON-RPC error, a non-2xx status, an
unreadable response, or a request that cannot be
completed — come back as an isError result whose
text starts with trenddata error: (this rendering
is this rebuild's own labelled reconstruction).
CLI
The tool is also a subcommand taking one JSON argument string:
npx @reneturcios/trenddata hasdata_google_trends_search_getTrendsData '{"q":"electric vehicles","geo":"US","dataType":"timeseries","date":"today 12-m"}'
npx @reneturcios/trenddata --version
Exit codes: 0 on success, 1 on an isError
result, 2 on a usage error.
MCP server
npx -y @reneturcios/trenddata mcp
MCP client config:
{
"mcpServers": {
"trenddata": {
"command": "npx",
"args": ["-y", "@reneturcios/trenddata", "mcp"]
}
}
}
Docker
docker run -i ghcr.io/cloudcorprecords/trenddata
docker run --rm ghcr.io/cloudcorprecords/trenddata --version
The container's default command is mcp, so the first
form is a stdio MCP server; any other arguments reach
the CLI normally.
Development
npm install
npm run build
npm test
npm run dev
The test suite runs entirely against a stubbed JSON-RPC upstream — no live network calls.
License
MIT — see LICENSE.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.