# Google Trends Scraper - Interest, Related Queries, Trending (`renzomacar/google-trends-scraper`) Actor

- **URL**: https://apify.com/renzomacar/google-trends-scraper.md
- **Developed by:** [Renzo Madueno](https://apify.com/renzomacar) (community)
- **Categories:** SEO tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Google Trends Scraper - Interest, Related Queries, Trending

Pull real **Google Trends** data into clean, structured JSON, CSV, or Excel - without a browser, without flaky screenshots, and without writing your own token-handling code. This scraper talks directly to the same data endpoints that power trends.google.com, so it is fast, cheap, and reliable.

Track how a keyword's popularity moves over time, see exactly which states or countries search for it most, discover the **related queries and topics** people search alongside it (including breakout "rising" terms), and grab the live **Trending now** list for any country. One run, one dataset, everything you need for SEO, content planning, and market research.

### Features

Every bullet below is a real query this actor answers:

- **"How has interest in `bitcoin` changed over the last 12 months?"** - Interest over time returns a clean timeline (0-100 relative popularity) for each date, with partial-period flags so you know which data points are still settling.
- **"Compare `chatgpt` vs `claude` vs `gemini` in one chart"** - Multi-keyword comparison done right. Pass up to 5 keywords and get one aligned row per date with a value for each keyword - the thing most Google Trends scrapers get wrong.
- **"Which US states search for `electric cars` the most?"** - Interest by region breaks demand down by country, state, or metro, ranked and normalized so you can spot geographic hotspots.
- **"What do people search right after `protein powder`?"** - Related queries returns both **top** (consistently popular) and **rising** (fast-growing / breakout) searches, each with a relative value and a direct Trends link.
- **"What topics are associated with `marathon`?"** - Related topics surfaces the entities and themes Google clusters around your keyword, split into top and rising.
- **"What is trending in the US / UK / India right now?"** - Trending now returns today's surging searches with approximate traffic volume and the news articles driving each spike.
- **No browser, no Puppeteer** - pure HTTP against Google's internal JSON API. It handles the `)]}'` anti-hijacking prefix, NID cookie warm-up, token negotiation, retries, and proxy rotation for you.
- **Geo + timeframe + category control** - scope any query by country/region, by time window (past hour to 2004-present), and by Google Trends category.

### Use cases

**SEO & keyword research.** Find rising search terms before your competitors do. Pull related queries for a seed keyword, filter for "rising / breakout," and you have a content calendar grounded in real demand - not guesswork. Combine interest-over-time with seasonality to time your publishing.

**Content & social planning.** Hook into Trending now for a country and turn surging searches (plus the news articles behind them) into timely posts, newsletters, or videos while the topic is hot.

**Market & product research.** Compare brand vs competitor interest, validate demand for a new product across regions, or measure whether a campaign actually moved the needle by watching the interest curve before and after launch.

**Investing & trend monitoring.** Track attention on tickers, technologies, or themes over 5-year windows and break interest down by geography.

### Input

```json
{
  "keywords": ["bitcoin", "ethereum"],
  "dataTypes": ["interest_over_time", "interest_by_region", "related_queries", "related_topics"],
  "geo": "US",
  "timeframe": "today 12-m",
  "category": 0,
  "trendingGeo": "US",
  "hl": "en-US",
  "requestDelayMs": 1500
}
````

| Field | Type | Description |
|---|---|---|
| `keywords` | array | Up to 5 keywords to analyze / compare. Required for interest & related modes. |
| `dataTypes` | array | Any of `interest_over_time`, `interest_by_region`, `related_queries`, `related_topics`, `trending_now`. |
| `geo` | string | Country/region code (`US`, `GB`, `PE`, `US-CA`). Empty = Worldwide. |
| `timeframe` | string | `now 1-H`, `now 7-d`, `today 3-m`, `today 12-m`, `today 5-y`, `all`, or a custom `YYYY-MM-DD YYYY-MM-DD` range. |
| `category` | integer | Google Trends category ID (0 = all). |
| `trendingGeo` | string | Country code used for `trending_now`. |
| `requestDelayMs` | integer | Pause between calls; raise it if you hit rate limits. |

### Output

Each dataset item carries a `dataType` so mixed runs stay easy to parse.

Interest over time:

```json
{ "dataType": "interest_over_time", "geo": "US", "date": "Jun 8, 2025",
  "values": [{ "keyword": "bitcoin", "value": 29 }], "isPartial": false }
```

Related queries:

```json
{ "dataType": "related_queries", "keyword": "bitcoin", "rankType": "rising",
  "query": "how to buy bitcoin safely", "value": 12550, "formattedValue": "Breakout",
  "link": "https://trends.google.com/trends/explore?q=how+to+buy+bitcoin+safely" }
```

Trending now:

```json
{ "dataType": "trending_now", "geo": "US", "rank": 1, "query": "delta airlines",
  "approxTraffic": "200+", "relatedNews": [{ "title": "...", "url": "...", "source": "..." }] }
```

### Pricing

This actor uses **pay per event**: a small fee per run start plus a tiny fee per result item. You only pay for what you pull - a single keyword's yearly timeline costs a fraction of a cent. No monthly subscription, no Google Trends API key required.

### FAQ

**Does Google Trends have an official API?** No public one. This actor uses the same internal JSON endpoints the website itself calls, handling tokens and cookies automatically.

**Can I compare multiple keywords?** Yes - up to 5 at once, with values aligned per date/region so comparisons are apples-to-apples.

**What do the values mean?** Google Trends numbers are *relative* (0-100), where 100 is peak interest within your query's scope, not absolute search counts. For related/rising, large numbers (or "Breakout") indicate fast growth.

**Why is some related-topic data empty?** Google legitimately returns no rising/top topics for some keyword + geo + timeframe combinations. The actor reports this as "no data" rather than failing.

**I'm getting rate-limited.** Increase `requestDelayMs` and the run will route through residential proxies automatically. The actor retries and rotates IPs on blocks.

**What timeframes are supported?** Everything from `now 1-H` (last hour) to `all` (2004-present), plus custom date ranges.

# Actor input Schema

## `keywords` (type: `array`):

Up to 5 keywords to analyze and compare. Required for interest/related data types.

## `dataTypes` (type: `array`):

Which Google Trends datasets to collect.

## `geo` (type: `string`):

Two-letter country code (e.g. US, GB, PE) or region code (e.g. US-CA). Leave empty for Worldwide.

## `timeframe` (type: `string`):

Time range. Examples: 'now 1-H', 'now 7-d', 'today 1-m', 'today 3-m', 'today 12-m', 'today 5-y', 'all', or a custom range like '2023-01-01 2023-12-31'.

## `category` (type: `integer`):

Google Trends category ID to narrow the topic (0 = All categories). E.g. 7 = Finance, 5 = Computers & Electronics.

## `trendingGeo` (type: `string`):

Country code for the 'Trending now' data type (e.g. US, GB, PE, IN).

## `hl` (type: `string`):

UI language for labels (e.g. en-US, es-419).

## `requestDelayMs` (type: `integer`):

Pause between Google Trends API calls. Higher values reduce rate-limit blocks.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin"
  ],
  "dataTypes": [
    "interest_over_time",
    "related_queries"
  ],
  "geo": "US",
  "timeframe": "today 12-m",
  "category": 0,
  "trendingGeo": "US",
  "hl": "en-US",
  "requestDelayMs": 1500
}
```

# Actor output Schema

## `results` (type: `string`):

All result items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "bitcoin"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("renzomacar/google-trends-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": ["bitcoin"] }

# Run the Actor and wait for it to finish
run = client.actor("renzomacar/google-trends-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "bitcoin"
  ]
}' |
apify call renzomacar/google-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=renzomacar/google-trends-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Trends Scraper - Interest, Related Queries, Trending",
        "version": "0.1",
        "x-build-id": "VOdoY3tbyYc8NQmN4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/renzomacar~google-trends-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-renzomacar-google-trends-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/renzomacar~google-trends-scraper/runs": {
            "post": {
                "operationId": "runs-sync-renzomacar-google-trends-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/renzomacar~google-trends-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-renzomacar-google-trends-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "dataTypes"
                ],
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "maxItems": 5,
                        "type": "array",
                        "description": "Up to 5 keywords to analyze and compare. Required for interest/related data types.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dataTypes": {
                        "title": "Data types",
                        "type": "array",
                        "description": "Which Google Trends datasets to collect.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "interest_over_time",
                                "interest_by_region",
                                "related_queries",
                                "related_topics",
                                "trending_now"
                            ],
                            "enumTitles": [
                                "Interest over time",
                                "Interest by region",
                                "Related queries",
                                "Related topics",
                                "Trending now"
                            ]
                        },
                        "default": [
                            "interest_over_time",
                            "related_queries"
                        ]
                    },
                    "geo": {
                        "title": "Geo (country/region code)",
                        "type": "string",
                        "description": "Two-letter country code (e.g. US, GB, PE) or region code (e.g. US-CA). Leave empty for Worldwide.",
                        "default": "US"
                    },
                    "timeframe": {
                        "title": "Timeframe",
                        "enum": [
                            "now 1-H",
                            "now 4-H",
                            "now 1-d",
                            "now 7-d",
                            "today 1-m",
                            "today 3-m",
                            "today 12-m",
                            "today 5-y",
                            "all"
                        ],
                        "type": "string",
                        "description": "Time range. Examples: 'now 1-H', 'now 7-d', 'today 1-m', 'today 3-m', 'today 12-m', 'today 5-y', 'all', or a custom range like '2023-01-01 2023-12-31'.",
                        "default": "today 12-m"
                    },
                    "category": {
                        "title": "Category ID",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Google Trends category ID to narrow the topic (0 = All categories). E.g. 7 = Finance, 5 = Computers & Electronics.",
                        "default": 0
                    },
                    "trendingGeo": {
                        "title": "Trending Now country",
                        "type": "string",
                        "description": "Country code for the 'Trending now' data type (e.g. US, GB, PE, IN).",
                        "default": "US"
                    },
                    "hl": {
                        "title": "Language",
                        "type": "string",
                        "description": "UI language for labels (e.g. en-US, es-419).",
                        "default": "en-US"
                    },
                    "requestDelayMs": {
                        "title": "Delay between requests (ms)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Pause between Google Trends API calls. Higher values reduce rate-limit blocks.",
                        "default": 1500
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
