I wanted Claude to answer questions like "is interest in pickleball still growing, and where?" with real Google Trends data instead of a guess. The Apify MCP server can expose a single scraper as a tool, so the agent can call it directly.
Disclosure: I built the scraper used here (Google Trends Scraper on Apify). It is a paid tool with a free monthly allowance.
1. Add the MCP server, limited to one scraper
The Apify MCP server is at https://mcp.apify.com. The tools query parameter limits which Actors the agent can see. Here it is only the Google Trends scraper.
Claude Code:
claude mcp add --transport http google-trends "https://mcp.apify.com/?tools=krammer/google-trends-scraper"
Claude Desktop, Cursor and other clients (JSON config):
{
"mcpServers": {
"google-trends": {
"url": "https://mcp.apify.com/?tools=krammer/google-trends-scraper"
}
}
}
On the first connection your browser opens so you can sign in to Apify and approve access (OAuth). If your client cannot do OAuth, add an Authorization: Bearer <APIFY_TOKEN> header instead. The token is in Apify Console under API & Integrations.
2. What the agent sees
With that URL, the server exposed these tools when I tested it (Apify MCP server 0.21.10):
-
krammer--google-trends-scraper: runs the scraper and returns a run summary -
get-dataset-items: reads the results, with afieldsfilter -
get-actor-run,get-key-value-store-record,abort-actor-run: run helpers
The scraper tool takes the same input as the Actor: searchTerms, geo, timeRange, isMultiple for comparisons, and mode: "trending" with trendingGeos for trending searches.
3. What a call looks like
I called the tool with:
{"searchTerms": ["ai agents"], "geo": "US", "timeRange": "today 3-m"}
It took about 29 seconds. The tool did not return the data itself. It returned a run summary and this hint (shortened):
SUCCEEDED in 27.916s. 1 item ...
Use get-dataset-items with datasetId=... Full output is ~92890 bytes.
Fetching all may exceed context; narrow with fields= or page with offset.
One search term is about 90 KB of JSON, because it includes 200 cities and 210 metro areas. So the agent should ask only for the fields it needs. With fields: "relatedQueries_top" the response was about 3.6 KB:
best ai agents 100
what are ai agents 53
ai agent 49
claude agents 25
free ai agents 24
4. Prompts that work well
Tell the agent which field to read. For example:
- "Use the Google Trends tool for 'pickleball' in the US over the past 12 months. Read only
interestBySubregionand list the top 5 states." - "Compare 'iphone,samsung galaxy,google pixel' with
isMultiple: truein the US. Read onlyinterestOverTime_timelineDataand tell me which one grew the most." - "Get today's trending searches for the US with
mode: trending. List the titles and traffic."
Useful field names:
| Question | Field |
|---|---|
| Is interest going up or down? | interestOverTime_timelineData |
| Where is it popular? |
interestBySubregion, interestByCity, interestByMetro; interestBy for worldwide |
| What else do people search? |
relatedQueries_top, relatedQueries_rising
|
Cost and limits
- You pay per search term that returns data ($0.0048 on the Apify Free plan). Terms with no data are free. Free Apify accounts can use up to $1.00 of this scraper per month.
- Each term takes about 8 seconds of scraping, plus run start-up.
- Related topics are not returned.
- If Google limits requests, the run stops and the remaining terms are not charged. Try again about 10 minutes later.
The same setup works with any Apify Actor. Change the tools parameter to give the agent a different scraper.
Top comments (0)