# Google Trends Scraper (`web7/google-trends-scraper`) Actor

Get Google Trends data without 429 errors: interest over time, interest by region, related queries and topics, plus today's trending searches with volume. No login, no API key, no personal data. Charged per dataset delivered, never for a query Google refused.

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

## Pricing

Pay per event

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 — no 429 errors

**Get Google Trends data without the scrape breaking halfway through.** Returns interest over time, interest by region, related queries, plus today's trending searches — all as structured JSON, ready for a spreadsheet, a database, or a data pipeline.

[Google Trends](https://trends.google.com/trends/) has no official API and rate-limits aggressively by IP address. That is why most scrapers fail: they call the internal API directly and get `429 Too Many Requests` on the very first request. This Actor fixes the cause, not the symptom.

### Why Google Trends returns 429 — and how this Actor solves it

The error is not about volume. It is about session. Google requires a cookie that is only issued when you load the Explore page. Without it, **every** request is refused — including the first one of the day.

You can reproduce it in two calls. Hitting the API directly from a clean IP:

```
GET /trends/api/explore   ->  HTTP 429   (on the very first request)
```

Loading the Explore page first — which also answers 429, but sets the cookie:

```
GET /trends/explore       ->  HTTP 429   + Set-Cookie
GET /trends/api/explore   ->  HTTP 200   ✓
GET /widgetdata/multiline ->  HTTP 200   ✓
```

That is exactly what this Actor does before any query. Combined with rotating residential proxies and exponential backoff with a fresh session, the rate limit becomes latency instead of failure.

Measured on a real platform run — two compared keywords across three datasets plus today's trending searches: **6 requests, 0 blocks, 0 retries**, returning 93 time-series points, 27 regions and 10 rising terms. Every run logs these counters, so you can audit the claim instead of trusting it.

On top of that:

- **No personal data.** Google Trends publishes aggregated search interest. There are no profiles, names, emails or personal identifiers — which keeps GDPR and LGPD compliance simple.
- **You only pay for what comes out.** Charging is per dataset delivered. A query that fails produces no billable event.
- **Five keywords per query**, exactly like Google Trends itself, with values that are comparable to each other.

### What you can use it for

- **Keyword research and SEO** — find whether a term is growing or dying before you commit to content, and catch rising queries while the competition is still low.
- **Demand forecasting** — read seasonality over 5 years to plan inventory, staffing or ad budget.
- **Market entry** — compare the same product across countries and regions to decide where to launch first.
- **Content and news** — pull today's trending searches with approximate volume and publish while the topic is hot.
- **Brand tracking** — measure your name against competitors on one normalized scale.

### How to use the Google Trends Scraper

1. Click **Try for free**.
2. Enter up to 5 keywords, then pick the country and the time range.
3. Select which datasets you want: time series, regions, related queries.
4. Click **Start** and download the result as JSON, CSV, Excel or HTML.

To automate it, schedule runs or call the Actor from the [Apify API](https://docs.apify.com/api/v2) and receive the JSON directly in your system.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `keywords` | array | Up to 5 terms, compared against each other. Leave empty only if `includeTrendingNow` is on. |
| `geo` | string | ISO code such as `BR`, `US`, `GB`, or a region like `US-CA`. Empty means worldwide. |
| `timeframe` | string | From `now 1-H` up to `all` (since 2004). |
| `dataTypes` | array | Which datasets to fetch. Each one is a billable event. |
| `includeTrendingNow` | boolean | Adds the searches trending right now, with approximate volume. |
| `category` | integer | Google Trends category ID. `0` means all categories. |
| `language` | string | Language of the returned labels. Defaults to `en-US`. |

Example:

```json
{
    "keywords": ["bitcoin", "ethereum"],
    "geo": "US",
    "timeframe": "today 3-m",
    "dataTypes": ["interestOverTime", "interestByRegion", "relatedQueries"],
    "includeTrendingNow": true
}
```

### Output

```json
{
    "keywords": ["bitcoin", "ethereum"],
    "geo": "US",
    "timeframe": "today 3-m",
    "interestOverTime": [{ "date": "Aug 24", "timestamp": 1787616000000, "values": [56, 4], "isPartial": false }],
    "interestByRegion": [{ "region": "California", "code": "US-CA", "values": [96, 4] }],
    "relatedQueries": {
        "top": [{ "query": "bitcoin price", "value": 100, "formattedValue": "100" }],
        "rising": [{ "query": "how to buy bitcoin safely", "value": 1100, "formattedValue": "+1,100%" }]
    }
}
```

You can download the dataset in JSON, HTML, CSV or Excel.

| Field | What it is |
| --- | --- |
| `interestOverTime[].values` | Relative interest (0–100) per keyword, in the order you supplied them. |
| `interestOverTime[].isPartial` | `true` when the period is still open and the value can still change. |
| `interestByRegion[].values` | Relative interest per region, normalized within the selected scope. |
| `relatedQueries.top` | Most searched related queries for the period. |
| `relatedQueries.rising` | Fastest-growing related queries. `Breakout` means growth above 5,000%. |
| `trending[].title` | Search term trending right now. |
| `trending[].approxTraffic` | Approximate search volume band, e.g. `2000+`. |
| `trending[].relatedNews` | Headlines Google associates with the trending term. |

### How much does it cost to scrape Google Trends?

**$0.0015 per dataset — $1.50 per 1,000.** A default query asks for three datasets, so it costs **$0.0045**, or $4.50 per 1,000 queries.

Charging is **per dataset delivered**, not per run time. That matters more than it sounds: when Google is slow and the Actor has to wait and retry, the Actor pays for the wait, not you.

| What you request | Events | Cost |
| --- | --- | --- |
| Time series only | 1 | $0.0015 |
| Time series + regions + related queries (default) | 3 | $0.0045 |
| Trending searches | 1 | $0.0015 |

Queries that Google refuses, even after the retries, produce **no billable event**. The number of compared keywords does not change the price either: comparing 5 keywords costs the same as querying 1, because it is the same request.

### Tips

- Use short ranges (`now 7-d`, `today 1-m`) to detect movement, and long ranges (`today 5-y`) for seasonality.
- Comparing terms only makes sense inside one query: values are normalized against each other, not across separate runs.
- If you need many keywords, prefer several small runs over one giant one — results arrive sooner and the cost is identical.
- Keep the residential proxy enabled. It is what sustains the success rate.

### FAQ

**Is scraping Google Trends legal?** This Actor reads only publicly displayed, aggregated Google Trends data, with no personal identifiers of any kind. You are still responsible for respecting Google's terms of service and the laws that apply to your use case.

**Why do the numbers only go up to 100?** That is how Google Trends works. Values are relative to the peak of the selected range, not absolute search counts.

**Can I compare more than 5 keywords?** Not in a single query — that is Google's own limit. Run several queries and stitch the results using one shared anchor term: its value in both runs gives you the conversion factor between the two scales.

**Why does the last row of the series keep changing?** Periods still in progress come back with `isPartial: true`. Google recalculates that point until the interval closes, so if you store history, drop or overwrite partial rows.

**Why is there no "related topics" dataset?** Google Trends shows related *topics* in its own web interface, but the API path returns an empty list for every query tested — 9 out of 9, across different terms, countries and categories, while related *queries* returned data in all of them. Rather than sell a field that always comes back empty, it was removed. If Google restores it, it comes back.

**Does the Actor need a Google account?** No. There is no login, no API key, and no personal data is collected — Google Trends publishes aggregated search interest only.

**I found a problem.** Open a ticket on the **Issues** tab of this Actor. I answer there.

# Actor input Schema

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

Até 5 termos para comparar. Deixe vazio se quiser apenas as tendências do dia.

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

Código ISO, como BR, US ou BR-SP. Vazio = mundo todo.

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

Janela de tempo consultada.

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

Cada tipo selecionado é cobrado como um evento.

## `includeTrendingNow` (type: `boolean`):

Adiciona as buscas em alta agora no país escolhido, com volume aproximado.

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

ID de categoria do Google Trends. 0 = todas.

## `language` (type: `string`):

Código de idioma usado nos rótulos retornados pelo Google, como en-US ou pt-BR.

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

Proxy residencial é o que mantém a taxa de falha perto de zero.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "includeTrendingNow": false,
  "category": 0,
  "language": "en-US",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Interest over time, interest by region, related queries and topics, and trending searches.

# 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("web7/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("web7/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 '{
  "keywords": [
    "bitcoin"
  ]
}' |
apify call web7/google-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,web7/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/hy08gVxgq70cMA530/builds/46NSVlX11AchUMafD/openapi.json
