# Google Trends Scraper (`silentshadow55/google-trends-actor`) Actor

Google Trends data as a fast API — no browser, no pytrends. Interest over time, interest by region, related & rising queries for any term, worldwide or by country/state, across Web, YouTube, News, Images & Shopping. Compare up to 5 terms on one scale. Built for scheduled monitoring.

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

## Pricing

from $5.00 / 1,000 trend 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 Over Time, Regions & Related Queries

Get **Google Trends data as a fast, reliable API**: interest over time, interest by region, related queries, and rising topics for any search term — worldwide or for any country, state, or metro area, across **Web, YouTube, News, Images, and Shopping** search.

**No browser. No pytrends. No 429 roulette.** This Actor speaks directly to the same JSON endpoints the Trends website uses, with automatic session rotation and backoff when Google rate-limits — so runs are fast (seconds per term, not minutes) and cheap.

### Why this exists

- **Google Trends has no official public API** (the long-promised one is still in limited alpha).
- **pytrends, the Python library everyone used for a decade, was abandoned in April 2025** and no longer works reliably.
- Browser-based Trends scrapers are slow, expensive, and flaky — a headless Chrome per keyword to fetch what is ultimately a JSON response.

This Actor is the missing piece: pytrends' functionality, maintained, as a pay-per-result API.

### What you get per search term

- 📈 **Interest over time** — the full 0–100 series at Google's finest granularity for your timeframe (hourly/daily/weekly), with partial-period flags, plus computed `average_interest` and `peak`
- 🗺️ **Interest by region** — countries, states/regions, cities, or US metro areas (DMA)
- 🔍 **Related queries** — top and **rising** (including "Breakout" markers — the early-signal goldmine)
- 🏷️ **Related topics** — top and rising topic entities
- ⚖️ **True compare mode** — up to 5 terms normalized on one shared 0–100 scale, exactly like the Trends UI comparison (independent scaling when off)
- 🌐 **All five search properties** — Web, YouTube, News, Images, Shopping

### Example output

```json
{
  "term": "chatgpt",
  "geo": "US",
  "timeframe": "today 12-m",
  "property": "web",
  "average_interest": 78.9,
  "peak": { "date": "Oct 19, 2025", "value": 100 },
  "interest_over_time": [
    { "date": "Jul 7, 2025", "timestamp": 1751846400, "value": 71, "is_partial": false }
  ],
  "interest_by_region": [
    { "geo_code": "US-UT", "geo_name": "Utah", "value": 100 }
  ],
  "related_queries": {
    "top": [ { "query": "chatgpt login", "value": 100 } ],
    "rising": [ { "query": "chatgpt agents", "formatted_value": "Breakout" } ]
  }
}
````

### Input

```json
{
  "searchTerms": ["standing desk", "walking pad"],
  "geo": "US",
  "timeframe": "today 12-m",
  "compareAllTerms": true,
  "dataTypes": ["interestOverTime", "relatedQueries"]
}
```

Timeframes: `now 1-H` → `today 5-y`, `all`, or custom ranges like `2025-01-01 2025-06-30`. Geo: country (`US`), region (`US-TX`), or empty for worldwide.

### Who uses this

- **SEO & content teams** — seasonality, topic momentum, and rising queries before they're competitive
- **E-commerce & product research** — validate demand and spot breakout products by region
- **Investors & analysts** — search interest as an alternative data signal
- **Journalists & researchers** — quantify attention around events and narratives
- **AI agents** — "is interest in X growing?" answered with real data via Apify's MCP integration

### FAQ

**Is there an official Google Trends API?** No — Google's announced API remains limited-access alpha. The Trends website is the only public source, and this Actor reads the same JSON its charts read.

**Is this a pytrends replacement?** Yes, deliberately. pytrends was archived in April 2025. This Actor covers its core surface (interest over time, interest by region, related queries/topics, categories, properties, compare mode) without you maintaining cookies, retries, or proxies.

**What do the 0–100 values mean?** Google normalizes each request: 100 = peak popularity within *your* timeframe/geo/term-set. Values are relative, not absolute search volumes. Use `compareAllTerms` to make multiple terms share one scale.

**How does it handle Google's rate limits?** Polite pacing, exponential backoff, automatic cookie-session rotation, and per-session proxy identities via Apify Proxy. Failed sub-requests are reported per-term in an `errors` field rather than failing your whole run.

**Can I export CSV/Excel?** Yes — every run's dataset downloads as JSON, CSV, XLSX, or XML, and is reachable via API, webhooks, and integrations (Google Sheets, Make, Zapier, LangChain).

**Is this legal?** It reads the same publicly available, aggregated, anonymized statistics Google publishes to every visitor at trends.google.com.

### Roadmap

- Daily trending searches / real-time trends endpoint
- Long-format output option (one row per data point, Sheets-ready)
- Autocomplete/topic-entity resolution (search "mercury" → pick planet vs element)

Found a term or geo that misbehaves? Open an issue — fixes ship fast.

# Actor input Schema

## `searchTerms` (type: `array`):

Terms to get Google Trends data for. Each term produces one result item. Use quotes inside a term for exact-match behavior, or a topic like 'chatgpt'.

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

Time range: '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', or a custom range like '2025-01-01 2025-06-30'.

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

Two-letter country code ('US', 'GB', 'DE'), a region code ('US-TX'), or empty for worldwide.

## `searchProperty` (type: `string`):

Which Google property to measure interest on.

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

Google Trends category to narrow results (0 = all categories). Find IDs in the Trends UI URL after picking a category, e.g. 71 = Food & Drink.

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

Which Trends datasets to fetch for each term. Fewer types = faster, cheaper runs.

## `compareAllTerms` (type: `boolean`):

When on (2-5 terms), all terms are normalized together on one 0-100 scale so values are directly comparable — exactly like adding comparison terms in the Trends UI. When off, each term is scaled independently.

## `regionResolution` (type: `string`):

Granularity for 'interest by region'. Leave unset for automatic (countries for worldwide, states/regions for a country). Forcing a level that doesn't fit the geo can return no data.

## `proxyConfiguration` (type: `object`):

Proxies to use. Google rate-limits IPs aggressively, so keep Apify Proxy enabled; switch to residential groups if you run very large term lists.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt"
  ],
  "timeframe": "today 12-m",
  "geo": "",
  "searchProperty": "web",
  "category": 0,
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "compareAllTerms": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchTerms": [
        "chatgpt"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("silentshadow55/google-trends-actor").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 = { "searchTerms": ["chatgpt"] }

# Run the Actor and wait for it to finish
run = client.actor("silentshadow55/google-trends-actor").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 '{
  "searchTerms": [
    "chatgpt"
  ]
}' |
apify call silentshadow55/google-trends-actor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Trends Scraper",
        "description": "Google Trends data as a fast API — no browser, no pytrends. Interest over time, interest by region, related & rising queries for any term, worldwide or by country/state, across Web, YouTube, News, Images & Shopping. Compare up to 5 terms on one scale. Built for scheduled monitoring.",
        "version": "0.0",
        "x-build-id": "gWRO1ftxv8P6gtbnu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/silentshadow55~google-trends-actor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-silentshadow55-google-trends-actor",
                "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/silentshadow55~google-trends-actor/runs": {
            "post": {
                "operationId": "runs-sync-silentshadow55-google-trends-actor",
                "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/silentshadow55~google-trends-actor/run-sync": {
            "post": {
                "operationId": "run-sync-silentshadow55-google-trends-actor",
                "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": [
                    "searchTerms"
                ],
                "properties": {
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Terms to get Google Trends data for. Each term produces one result item. Use quotes inside a term for exact-match behavior, or a topic like 'chatgpt'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "timeframe": {
                        "title": "Timeframe",
                        "type": "string",
                        "description": "Time range: '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', or a custom range like '2025-01-01 2025-06-30'.",
                        "default": "today 12-m"
                    },
                    "geo": {
                        "title": "Location (geo code)",
                        "type": "string",
                        "description": "Two-letter country code ('US', 'GB', 'DE'), a region code ('US-TX'), or empty for worldwide.",
                        "default": ""
                    },
                    "searchProperty": {
                        "title": "Search property",
                        "enum": [
                            "web",
                            "images",
                            "news",
                            "youtube",
                            "shopping"
                        ],
                        "type": "string",
                        "description": "Which Google property to measure interest on.",
                        "default": "web"
                    },
                    "category": {
                        "title": "Category ID",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Google Trends category to narrow results (0 = all categories). Find IDs in the Trends UI URL after picking a category, e.g. 71 = Food & Drink.",
                        "default": 0
                    },
                    "dataTypes": {
                        "title": "Data to fetch",
                        "type": "array",
                        "description": "Which Trends datasets to fetch for each term. Fewer types = faster, cheaper runs.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "interestOverTime",
                                "interestByRegion",
                                "relatedQueries",
                                "relatedTopics"
                            ],
                            "enumTitles": [
                                "Interest over time",
                                "Interest by region",
                                "Related queries",
                                "Related topics"
                            ]
                        },
                        "default": [
                            "interestOverTime",
                            "interestByRegion",
                            "relatedQueries",
                            "relatedTopics"
                        ]
                    },
                    "compareAllTerms": {
                        "title": "Compare terms on one scale",
                        "type": "boolean",
                        "description": "When on (2-5 terms), all terms are normalized together on one 0-100 scale so values are directly comparable — exactly like adding comparison terms in the Trends UI. When off, each term is scaled independently.",
                        "default": false
                    },
                    "regionResolution": {
                        "title": "Region breakdown level",
                        "enum": [
                            "COUNTRY",
                            "REGION",
                            "CITY",
                            "DMA"
                        ],
                        "type": "string",
                        "description": "Granularity for 'interest by region'. Leave unset for automatic (countries for worldwide, states/regions for a country). Forcing a level that doesn't fit the geo can return no data."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxies to use. Google rate-limits IPs aggressively, so keep Apify Proxy enabled; switch to residential groups if you run very large term lists.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
