Get Google Trends data in Claude via the Apify MCP server
Claude cannot open trends.google.com on its own. Asked about search interest, it answers from memory, which is months old at best.
With Apify’s hosted MCP server, Claude gets one tool, arcadium/google-trends, that returns interest over time, interest by region and related queries as JSON. Claude then answers from the numbers and you see every tool call it makes.
Cost of this example on the Apify Free plan: 2 × $0.0027 = $0.0054 ($0.00054 on the Apify Gold plan and higher), plus $0.00005 per GB of memory when the run starts.
What you need
- An Apify account (the Free plan works) and its API token: Apify Console, Settings, API & Integrations.
- Claude Code, Claude Desktop, Cursor, VS Code or any other MCP client.
Step 1: Run it in the Apify Store (no code)
- Open arcadium/google-trends on the Apify Store and sign in (a free Apify account works).
- Enter the keywords in Search terms, one per line.
- Turn on Compare keywords on one scale so all keywords share one 0-100 scale.
- Set Location to a country code such as
US, or leave it empty for worldwide. - Optional: set a maximum cost per run in the run options as a hard cap.
- Click Start. Rows appear in the Output tab; export them as JSON, CSV or Excel.
The same input as JSON (paste it in the JSON tab of the input form):
{
"searchTerms": [
"notion",
"obsidian"
],
"compareKeywords": true,
"geo": "US",
"includeRelatedQueries": true,
"includeRelatedTopics": false,
"includeGeo": false
}
Step 2: Call it over the Apify API
One HTTP call runs the actor and returns its rows. It suits runs up to about five minutes; for longer runs start the run asynchronously and read the dataset when it finishes.
curl -X POST "https://api.apify.com/v2/acts/arcadium~google-trends/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms":["notion","obsidian"],"compareKeywords":true,"geo":"US","includeRelatedQueries":true,"includeRelatedTopics":false,"includeGeo":false}'
Step 3: Run it from Python
With apify-client 3.x, call() returns a Run object: read the dataset id as run.default_dataset_id (older examples use run["defaultDatasetId"], which no longer works).
# pip install "apify-client>=3"
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("arcadium/google-trends").call(
run_input={"searchTerms": ["notion", "obsidian"], "compareKeywords": True, "geo": "US"}
)
# apify-client 3.x returns a Run object: use run.default_dataset_id, not run["defaultDatasetId"]
for row in client.dataset(run.default_dataset_id).iterate_items():
if row.get("rowType") != "trend":
print("skipped:", row.get("code"), row.get("message"))
continue
points = row.get("interestOverTime_timelineData") or []
print(row["searchTerm"], "average", row.get("averageInterest"), "last", points[-1]["value"] if points else None)
Step 4: Run it from JavaScript
// npm install apify-client
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('arcadium/google-trends').call({
"searchTerms": [
"notion",
"obsidian"
],
"compareKeywords": true,
"geo": "US",
"includeRelatedQueries": true,
"includeRelatedTopics": false,
"includeGeo": false
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
Step 5: Ask an AI assistant (MCP)
Apify’s hosted MCP server turns the actor into one tool. Add it to Claude, Cursor, VS Code or any MCP client:
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=arcadium/google-trends",
"headers": {
"Authorization": "Bearer <APIFY_TOKEN>"
}
}
}
}Then ask, for example:
Use arcadium/google-trends to compare US search interest in "notion" and "obsidian" over the past 12 months on one scale. Tell me which is higher on average, how the gap moved, and list the rising related queries of each.
More clients and the local setup on the MCP page.
Claude Code in one line
Adds Apify’s remote MCP server with only this actor as a tool. $APIFY_TOKEN is read from your shell.
claude mcp add --transport http apify "https://mcp.apify.com/?tools=arcadium/google-trends" \
--header "Authorization: Bearer $APIFY_TOKEN"
Claude Desktop (local server)
Put this in claude_desktop_config.json (Settings, Developer, Edit config) and restart Claude Desktop. It runs Apify’s MCP server locally with Node.js and exposes the same single tool.
{
"mcpServers": {
"apify": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server",
"--actors",
"arcadium/google-trends"
],
"env": {
"APIFY_TOKEN": "<APIFY_TOKEN>"
}
}
}
}
Prompts that work well
Name the keywords, the country and the period. Ask for Compare keywords on one scale when you want to rank terms against each other; without it every keyword gets its own 0-100 scale and the values of two keywords cannot be compared. For "what is trending today", ask for Trending now with a country code (trendingGeos, title Trending now: countries), one row per trending search.
Output fields
Every row has a rowType; filter on it first. Failed inputs come back as free rows with a code and message. The fields this tutorial uses, from the actor’s dataset schema:
| Field | What it holds |
|---|---|
rowType | Kind of row. Filter on this first. 'trend': one keyword (charged). 'trending': one Trending now search (charged). 'error': an input could not be read; see code and message (free). |
searchTerm | The keyword this row is about. |
geo | Location measured: country or region code, empty for worldwide. |
timeRange | Period as Google writes it, for example today 12-m. |
averageInterest | Mean of the timeline values on the 0-100 scale. |
interestOverTime_timelineData | Timeline points with time (Unix seconds), formattedTime, value (0-100), hasData and isPartial. |
relatedQueries_top | Top related search queries. |
relatedQueries_rising | Rising related queries; formattedValue is such as +250% or Breakout. |
scale | How values are scaled: method (single, compare, anchor), keywords, anchor and factorErrorPct. |
All fields: Google Trends Scraper guide.
Cost per run
Pay per event: you pay for the rows delivered, at the actor’s live Apify price on 2026-10-31. Error, coverage and summary rows are free.
| What | Rows | Price per row (Free plan) | Subtotal |
|---|---|---|---|
| Result row: 2 keywords, one row each | 2 | $0.0027 | $0.0054 |
Cost of this example on the Apify Free plan: 2 × $0.0027 = $0.0054 ($0.00054 on the Apify Gold plan and higher), plus $0.00005 per GB of memory when the run starts. Higher Apify plans pay less per row. The Store page always has the current price.
Limitations
- Every tool call is one actor run billed to your Apify account. An assistant may call the tool more than once for one question; the run list in Apify Console shows each call.
- Values are relative interest (0-100), not search counts. Do not let the assistant present them as volumes.
- Public Google Trends data only. Nothing behind a login.
- Google shows relative interest (0-100), not search counts. Trending now gives a volume bracket (for example 100,000+), not an exact number.
- Google sometimes answers "too many requests". The actor retries on the same or a fresh connection, repeats the lookup for new tokens, and after a short pause tries the whole keyword again, so a keyword may take a few seconds (rarely a minute) longer; if all retries fail it returns a free
blockedrow. - If three keywords in a row still end
blocked, Google is limiting the whole shared connection pool. The actor then pauses for about a minute once and starts the next keywords at most every 5 seconds, so it does not prolong the limit for this run or for other users. After three successful keywords in a row it returns to normal speed. Expect a long list to take a few minutes longer on such a day rather than fail. - Related topics are empty for many rare keywords; that is Google's answer, not a failure.
- Values for more than 5 compared keywords are approximate (see above).
Links
- Google Trends Scraper: fields, price table and sample output
- How to use Google Trends Scraper: every input field, n8n, LangChain
- arcadium/google-trends on the Apify Store
- All tutorials