# Google Trends Scraper – Interest, Regions & Related Queries (`dougmanoel/google-trends-scraper`) Actor

Google Trends interest over time, interest by region and related queries for up to 5 terms. Auto-retry, session renewal and free status rows. Optional proxy.

- **URL**: https://apify.com/dougmanoel/google-trends-scraper.md
- **Developed by:** [Douglas Gouvea Manoel](https://apify.com/dougmanoel) (community)
- **Categories:** SEO tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Trends Scraper – Interest, Regions & Related Queries

![Google Trends Scraper](https://errandcode.com/google-trends-scraper-cover.png)

[![Errand Code – Google Trends Scraper](https://img.youtube.com/vi/X42_8AN6yk4/maxresdefault.jpg)](https://youtu.be/X42_8AN6yk4)

Watch the demo: https://youtu.be/X42_8AN6yk4

Part of Errand Code: https://errandcode.com/google-trends-scraper

Google Trends data as clean dataset rows: **interest over time**, **interest by region** and **related queries**, for up to 5 compared terms (or up to 50 terms one by one). No login, no browser, no captcha service.

**Built to retry.** Google answers HTTP 429 to anything that does not behave like a browser. This Actor opens a session the way a browser does, retries 429/401/403/5xx and network errors with exponential backoff, renews the session (new cookie and, with a proxy, a new IP) between attempts, and paces its requests. If something still cannot be fetched, you get a free `status` row saying what and why, and the rest of the run continues. In our tests on 9 Nov 2026, 30 of 30 searches returned results (US, Brazil, UK and worldwide; from the past 7 days to 5 years). That is a test result, not a guarantee.

### Input

| Field | Default | Notes |
|---|---|---|
| `searchTerms` | `["chatgpt","gemini"]` | Up to 5 with `together`, up to 50 with `separate`. |
| `compareMode` | `together` | `together` = one Google Trends comparison (values share one 0–100 scale). `separate` = each term on its own scale. |
| `geo` | `""` (worldwide) | `US`, `BR`, `GB`, subregion `BR-SP`, `US-CA`. |
| `timeRange` | `today 12-m` | `now 1-H`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all`, or `YYYY-MM-DD YYYY-MM-DD`. |
| `category` | `0` | Google Trends category id. |
| `property` | `web` | `web`, `images`, `news`, `youtube`, `froogle` (shopping). |
| `outputs` | all three | Any of `interestOverTime`, `interestByRegion`, `relatedQueries`. |
| `hl` | `en-US` | Language of region names. |
| `proxyConfiguration` | none | Optional Apify Proxy. Recommended on the platform; not needed from a home connection. |

### Output

One row per result, always with `type`, plus `geo`, `timeRange`, `category`, `property`, `scrapedAt` (UTC) and `source` (the equivalent Google Trends URL). Missing fields are `null`.

- `interestOverTime`: `term`, `date`, `value` (0–100), `hasData`, `isPartial` (the current, incomplete period).
- `interestByRegion`: `term`, `regionCode`, `regionName`, `value`, `hasData`, `compared`. When `compared` is `true` (several terms), values are each term's share of the comparison in that region (they add up to 100); with a single term, `value` is 0–100.
- `relatedQueries`: `term`, `rankType` (`top` or `rising`), `query`, `value`, `formattedValue` (`"+250%"`, `"Breakout"`), `isBreakout`.
- `status`: free row when something is missing: `status` (`no_data` or `source_unavailable`), `reason`, `terms`.

### Not included

Related topics are not offered in v1: Google returned no data for them in every live check (09/11/2026). Related queries work normally.

### Pricing

**Early access: no Actor fee yet.** You pay only standard Apify platform usage (in our tests on 9 Nov 2026, 4,704 rows across 6 runs cost US$ 0.023 in platform usage). Pay-per-result pricing may be introduced later; Apify notifies users 14 days in advance. Status rows are free.

### Run locally

```bash
python3.13 -m venv .venv && .venv/bin/pip install -r requirements.txt -r requirements-dev.txt
apify run --input-file input.json      # or: echo '{"searchTerms":["chatgpt"]}' | apify run --purge
.venv/bin/python -m pytest -q          # tests
.venv/bin/ruff check .                 # lint
.venv/bin/python scripts/medir.py 30   # success rate / latency over 30 real queries
```

### Notes

Data comes from Google Trends' own web API; it is sampled by Google, normalised to 0–100 and not an absolute search count. Respect Google's terms and use reasonable volumes.

### More from Errand Code

This Actor is built and maintained by [Errand Code](https://errandcode.com/google-trends-scraper). See the [other tools](https://errandcode.com/): an [Americanas Product Scraper](https://errandcode.com/americanas-product-scraper), a [Buscapé Price Scraper](https://errandcode.com/buscape-price-scraper), a [CNPJ Due Diligence](https://errandcode.com/cnpj-due-diligence) Actor, an AI visibility check ([GEO audit](https://errandcode.com/geo)), a Google Sheets add-on and MCP servers for AI agents. Not affiliated with Google.

# Actor input Schema

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

Terms to look up. With 'Compare together' (default) up to 5 terms are compared on the same 0-100 scale, like Google Trends does. With 'Each term separately' up to 50 terms, each scaled on its own.

## `compareMode` (type: `string`):

Compare all terms in one Google Trends comparison, or look up each term on its own.

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

Country or region code: empty for worldwide, US, BR, GB, or a subregion like BR-SP or US-CA.

## `timeRange` (type: `string`):

Past hour (now 1-H), 7 days (now 7-d), 1/3/12 months (today 1-m, today 3-m, today 12-m), 5 years (today 5-y), all (since 2004), or a custom interval 'YYYY-MM-DD YYYY-MM-DD'.

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

Google Trends category id. 0 = all categories.

## `property` (type: `string`):

Where the searches happened.

## `outputs` (type: `array`):

Which datasets to return. Each row delivered is one billable result; status rows are free.

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

Interface language for region names, e.g. en-US or pt-BR.

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

Optional. Recommended on the Apify platform, where datacenter IPs are blocked more often. Not needed from a home connection.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "gemini"
  ],
  "compareMode": "together",
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "outputs": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "hl": "en-US"
}
```

# Actor output Schema

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

No description

# 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",
        "gemini"
    ],
    "timeRange": "today 12-m",
    "outputs": [
        "interestOverTime",
        "interestByRegion",
        "relatedQueries"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dougmanoel/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 = {
    "searchTerms": [
        "chatgpt",
        "gemini",
    ],
    "timeRange": "today 12-m",
    "outputs": [
        "interestOverTime",
        "interestByRegion",
        "relatedQueries",
    ],
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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",
    "gemini"
  ],
  "timeRange": "today 12-m",
  "outputs": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ]
}' |
apify call dougmanoel/google-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dougmanoel/google-trends-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/md3eHF0bnwlpJq3tj/builds/NdDEBymQn9gMseWHe/openapi.json
