# ⚡ Fast Google Trends Scraper — 5-Term Compare, No-Charge Fails (`swiftscrape/google-trends-fast-scraper`) Actor

Fast Google Trends scraper & API: extract interest over time, related queries and rising searches for up to 5 compared keywords in seconds. Built for SEO, market research and AI agents. Pay only for terms that return data — failed, blocked or empty terms are never charged.

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

## Pricing

$5.00 / 1,000 term with data extracteds

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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## ⚡ Fast Google Trends Scraper — 5-Term Compare, No-Charge Fails

Extract Google Trends data in seconds, not minutes: interest over time and
related queries for up to 5 compared terms (related topics for single-term
lookups — see the note below).

### Why this scraper

| | This actor | Typical alternatives |
|---|---|---|
| Speed (2 terms) | **< 10 s** | several minutes |
| Failed term | **$0.00 — never charged** | compute billed anyway |
| 5-term comparison | **native, one normalized session** | broken or N separate runs |
| AI agents (MCP) | **flat, documented input schema** | multi-param bugs |

Pricing: **$0.005 per term that returns data.** Blocked, empty or timed-out
terms cost you nothing — the incentive to stay reliable is on us.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `terms` | array of strings | — | 1 to 5 terms, compared in one Google Trends session (same normalization as the Trends UI) |
| `timeRange` | enum | `today 12-m` | `now 1-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y` |
| `geo` | string | `""` (worldwide) | ISO country code, e.g. `FR`, `US` — leave empty for worldwide |
| `includeRelated` | boolean | `true` | also fetch related queries and related topics per term |

Minimal input:

```json
{ "terms": ["chatgpt", "gemini"] }
````

### Output example

One item per term is pushed to the dataset. This is a genuine output item
from a local run with `{"terms":["chatgpt","gemini"],"geo":"FR"}`
(`interestOverTime` trimmed to a few points here for readability — a real
`today 12-m` run returns ~52-53 weekly points; `relatedQueries` trimmed to
a handful of entries out of the full list):

```json
{
  "term": "chatgpt",
  "geo": "FR",
  "timeRange": "today 12-m",
  "interestOverTime": [
    { "date": "2025-07-13", "value": 58 },
    { "date": "2025-07-20", "value": 63 },
    { "date": "2025-07-27", "value": 54 },
    { "date": "2025-08-03", "value": 54 },
    { "date": "2026-06-21", "value": 70 },
    { "date": "2026-06-28", "value": 69 },
    { "date": "2026-07-05", "value": 66 },
    { "date": "2026-07-12", "value": 57 }
  ],
  "relatedQueries": {
    "top": [
      { "query": "chatgpt gratuit", "value": 100, "formattedValue": "100" },
      { "query": "chatgpt gpt", "value": 48, "formattedValue": "48" },
      { "query": "chatgpt openai", "value": 35, "formattedValue": "35" },
      { "query": "ia chatgpt", "value": 28, "formattedValue": "28" },
      { "query": "chatgpt image", "value": 22, "formattedValue": "22" },
      { "query": "chatgpt logo transparent", "value": 1, "formattedValue": "1" }
    ],
    "rising": [
      { "query": "how to use chatgpt effectively", "value": 2850, "formattedValue": "+2,850%" },
      { "query": "chatgpt atlas", "value": 700, "formattedValue": "+700%" },
      { "query": "chatgpt logo transparent", "value": 190, "formattedValue": "+190%" }
    ]
  },
  "relatedTopics": { "top": [], "rising": [] },
  "normalizedWith": ["gemini"],
  "error": null
}
```

Note on `relatedTopics`: Google only returns a "related topics" widget when
a single term is explored. As soon as 2+ terms are compared in the same
session (this actor's normal mode), Google's own API stops returning that
widget at all — so `relatedTopics` comes back as an empty group
(`{"top":[],"rising":[]}`) in every multi-term comparison. `relatedQueries`
is unaffected and is always populated per term (when `includeRelated` is
`true` and the term has data). This is a real, observed characteristic of
the Google Trends API, not a bug in this actor.

If a term is blocked, returns no data, or times out, its item looks like
this instead — and is **never charged**:

```json
{
  "term": "some-term",
  "geo": "worldwide",
  "timeRange": "today 12-m",
  "interestOverTime": [],
  "relatedQueries": null,
  "relatedTopics": null,
  "normalizedWith": ["other-term"],
  "error": "no-data"
}
```

### Use with AI agents (MCP)

This actor works out of the box with the Apify MCP server. Ask your agent:
"Compare Google Trends interest for chatgpt and gemini over the past 12
months in France." The flat input schema (`terms`, `timeRange`, `geo`,
`includeRelated`) maps directly to natural language — no nested flags.

### Use with n8n / Make

No visual builder needed — call the actor's run-sync endpoint directly from
an HTTP module.

**n8n (HTTP Request node):**

1. Add an **HTTP Request** node.
2. Method: `POST`
3. URL: `https://api.apify.com/v2/acts/YOUR_USERNAME~google-trends-fast-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN`
4. Body content type: `JSON`
5. Body:
   ```json
   {
     "terms": ["chatgpt", "gemini"],
     "timeRange": "today 12-m",
     "geo": "FR",
     "includeRelated": true
   }
   ```
6. Run the node — the output is the array of term items, ready to feed into
   the next node (Set, Filter, Google Sheets, etc.).

**Make (HTTP module):**

1. Add an **HTTP > Make a request** module.
2. URL: `https://api.apify.com/v2/acts/YOUR_USERNAME~google-trends-fast-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN`
3. Method: `POST`
4. Body type: `Raw` / `JSON (application/json)`
5. Request content: same JSON body as above.
6. Map the returned array items in a following **Iterator** module if you
   need one bundle per term.

Swap `YOUR_USERNAME`, the actor name, and `YOUR_APIFY_TOKEN` for your own
values (find your token under Apify Console → Settings → Integrations).

### FAQ

**Is scraping Google Trends legal?** This actor only accesses publicly
available, aggregated, anonymized data — the same data visible to anyone
on trends.google.com. Review Google's ToS and your local regulations for
your specific use case.

**How fresh is the data?** Fetched live at run time, no cache.

**What does a 5-term comparison cost?** 5 × $0.005 = $0.025 when all five
return data; less if some fail (you only pay for delivered terms).

**Why is `relatedTopics` empty when I compare 2+ terms?** See the note in
the [Output example](#output-example) section above — it's how Google's
own API behaves in comparison mode, not something this actor can add back.

**What happens if a term is invalid or blocked?** It's returned with
`error` set to `"blocked"`, `"no-data"`, or `"timeout"`, empty results, and
is **not charged** — see the second example above.

# Actor input Schema

## `terms` (type: `array`):

1 to 5 terms. Multiple terms are compared in ONE Google Trends session, so their values are normalized against each other (like the Google Trends UI).

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

Period to analyze.

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

Two-letter country code like FR or US. Leave empty for worldwide.

## `includeRelated` (type: `boolean`):

Also fetch related queries and related topics (top + rising) for each term.

## Actor input object example

```json
{
  "terms": [
    "chatgpt",
    "gemini"
  ],
  "timeRange": "today 12-m",
  "geo": "",
  "includeRelated": 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 = {
    "terms": [
        "chatgpt",
        "gemini"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "⚡ Fast Google Trends Scraper — 5-Term Compare, No-Charge Fails",
        "description": "Fast Google Trends scraper & API: extract interest over time, related queries and rising searches for up to 5 compared keywords in seconds. Built for SEO, market research and AI agents. Pay only for terms that return data — failed, blocked or empty terms are never charged.",
        "version": "0.1",
        "x-build-id": "1Dpnbc1Q5ck3cp0dO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/swiftscrape~google-trends-fast-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-swiftscrape-google-trends-fast-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/swiftscrape~google-trends-fast-scraper/runs": {
            "post": {
                "operationId": "runs-sync-swiftscrape-google-trends-fast-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/swiftscrape~google-trends-fast-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-swiftscrape-google-trends-fast-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": [
                    "terms"
                ],
                "properties": {
                    "terms": {
                        "title": "Search terms",
                        "minItems": 1,
                        "maxItems": 5,
                        "type": "array",
                        "description": "1 to 5 terms. Multiple terms are compared in ONE Google Trends session, so their values are normalized against each other (like the Google Trends UI).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "timeRange": {
                        "title": "Time range",
                        "enum": [
                            "now 1-H",
                            "now 1-d",
                            "now 7-d",
                            "today 1-m",
                            "today 3-m",
                            "today 12-m",
                            "today 5-y"
                        ],
                        "type": "string",
                        "description": "Period to analyze.",
                        "default": "today 12-m"
                    },
                    "geo": {
                        "title": "Country (ISO code)",
                        "maxLength": 2,
                        "type": "string",
                        "description": "Two-letter country code like FR or US. Leave empty for worldwide.",
                        "default": ""
                    },
                    "includeRelated": {
                        "title": "Include related queries & topics",
                        "type": "boolean",
                        "description": "Also fetch related queries and related topics (top + rising) for each term.",
                        "default": 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
