Arcadium Data Scrapers
Home / Guides / Google Trends Scraper

How to use Google Trends Scraper

Step by step: in the Apify Store, over the API, from JavaScript or Python, in n8n, and from AI agents through MCP or LangChain.

$2.70 per 1,000 result rows on the Free plan, down to $0.27 on higher plans (live Apify price on 2026-10-31).

1. In the Apify Store (no code)

  1. Open arcadium/google-trends and sign in to Apify (a free account works).
  2. Fill in the input form. The fields below are the ones the example uses.
  3. Set a maximum cost per run in the run options if you want a hard cap.
  4. Start the run. Rows appear in the Output tab as they arrive.
  5. Export the dataset as JSON, CSV or Excel, or connect an integration.
Input fieldTypeDescription
searchTermsarrayKeywords to look up, one result row per keyword. Example: ["electric car", "solar panels"]. Leave empty if you use Trends links, a Google Sheet or Trending now.
maxRetriesintegerHow often a request is retried, each time on a fresh connection, after Google answers too many requests. Higher is slower but fails less.
proxyCountrystringTwo-letter country of the connection used to ask Google, for example US or DE (default US). 'viewedFrom' is accepted too. The numbers do not depend on it.

Example input:

{
  "searchTerms": [
    "webscraping"
  ],
  "maxRetries": 6,
  "proxyCountry": "US"
}

2. Over the Apify API

The synchronous endpoint runs the actor and returns its rows in one call (for runs up to about five minutes; use the asynchronous run endpoint for longer ones).

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":["webscraping"],"maxRetries":6,"proxyCountry":"US"}'

3. 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": [
    "webscraping"
  ],
  "maxRetries": 6,
  "proxyCountry": "US"
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

4. From Python

# pip install apify-client
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("arcadium/google-trends").call(run_input={
    "searchTerms": ["webscraping"],
    "maxRetries": 6,
    "proxyCountry": "US",
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)

5. In n8n

Paste this node into a workflow (it is a plain HTTP Request node). Create a Header Auth credential with name Authorization and value Bearer <APIFY_TOKEN>; each returned row becomes one item for the next node.

{
  "nodes": [
    {
      "name": "Run arcadium/google-trends",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/arcadium~google-trends/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"searchTerms\":[\"webscraping\"],\"maxRetries\":6,\"proxyCountry\":\"US\"}",
        "options": {
          "timeout": 300000
        }
      }
    }
  ],
  "connections": {}
}

6. From an AI assistant (MCP)

Add Apify’s MCP server to Claude Desktop, Cursor, VS Code or any MCP client, limited to this actor:

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=arcadium/google-trends",
      "headers": {
        "Authorization": "Bearer <APIFY_TOKEN>"
      }
    }
  }
}

More on the MCP page.

7. From LangChain

# pip install langchain-apify   (reads APIFY_API_TOKEN from the environment)
from langchain_apify import ApifyActorsTool

tool = ApifyActorsTool("arcadium/google-trends")
rows = tool.invoke({"run_input": {
    "searchTerms": ["webscraping"],
    "maxRetries": 6,
    "proxyCountry": "US",
}})
# or give `tool` to an agent: create_react_agent(llm, [tool])

Sample output

One row, from the example in the actor’s README. Long text is shortened and lists are cut to two items.

{
  "rowType": "trend",
  "searchTerm": "coffee",
  "geo": "US",
  "timeRange": "today 12-m",
  "averageInterest": 77.7,
  "interestOverTime_timelineData": [
    {
      "time": "1760832000",
      "formattedTime": "Oct 19 – 25, 2025",
      "value": [
        63
      ],
      "hasData": [
        true
      ],
      "formattedValue": [
        "63"
      ]
    }
  ],
  "interestBySubregion": [
    {
      "geoCode": "US-WY",
      "geoName": "Wyoming",
      "value": [
        100
      ]
    }
  ],
  "relatedQueries_top": [
    {
      "query": "coffee near me",
      "value": 100,
      "formattedValue": "100"
    }
  ],
  "relatedQueries_rising": [
    {
      "query": "best coffee near me",
      "value": 160,
      "formattedValue": "+160%"
    }
  ],
  "scale": {
    "method": "single",
    "keywords": [
      "coffee"
    ]
  }
}
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.
inputUrlOrTermWhat you typed: the keyword or the Trends link it came from.
geoLocation measured: country or region code, empty for worldwide.
timeRangePeriod as Google writes it, for example today 12-m.
categoryGoogle Trends category id, 0 for all categories.
propertySearch type measured: empty for web search, or images, news, youtube, froogle.
averageInterestMean of the timeline values on the 0-100 scale.
interestOverTime_timelineDataTimeline points with time (Unix seconds), formattedTime, value (0-100), hasData and isPartial.
interestByInterest by country for a worldwide search.
interestBySubregionInterest by subregion for a country search.
interestByCityInterest by city for a country search.
interestByMetroInterest by metro area for a region search.
relatedQueries_topTop related search queries.
relatedQueries_risingRising related queries; formattedValue is such as +250% or Breakout.
relatedTopics_topTop related topics with Google's topic id and type.
relatedTopics_risingRising related topics with Google's topic id and type.
scaleHow values are scaled: method (single, compare, anchor), keywords, anchor and factorErrorPct.
changeMonitoring mode only: status (baseline or changed), new rising queries and interestDelta since the last run.
scrapedAtISO timestamp of when the row was read.
keywordTrending now rows: the trending search.
searchVolumeTrending now rows: lower bound of Google's search volume bracket.
increasePercentTrending now rows: percent increase in searches.
startedAtTrending now rows: when the search started trending.
activeTrending now rows: true while the search is still trending.
relatedKeywordsTrending now rows: related searches.
windowHoursTrending now rows: hours the list looks back (4, 24, 48 or 168).
codeError rows: machine-readable error code.
messageError rows: short explanation of what could not be read.

Schedule it

In Apify Console, create a Task from your input and add a Schedule (for example daily). Each run writes a new dataset; integrations can push the rows to Google Sheets, Slack, a webhook or your database.