Arcadium Data Scrapers
Home / Tutorials / Google Trends in Claude (MCP)

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

Step 1: Run it in the Apify Store (no code)

  1. Open arcadium/google-trends on the Apify Store and sign in (a free Apify account works).
  2. Enter the keywords in Search terms, one per line.
  3. Turn on Compare keywords on one scale so all keywords share one 0-100 scale.
  4. Set Location to a country code such as US, or leave it empty for worldwide.
  5. Optional: set a maximum cost per run in the run options as a hard cap.
  6. 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:

FieldWhat it holds
rowTypeKind 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).
searchTermThe keyword this row is about.
geoLocation measured: country or region code, empty for worldwide.
timeRangePeriod as Google writes it, for example today 12-m.
averageInterestMean of the timeline values on the 0-100 scale.
interestOverTime_timelineDataTimeline points with time (Unix seconds), formattedTime, value (0-100), hasData and isPartial.
relatedQueries_topTop related search queries.
relatedQueries_risingRising related queries; formattedValue is such as +250% or Breakout.
scaleHow 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.

WhatRowsPrice per row (Free plan)Subtotal
Result row: 2 keywords, one row each2$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

Links