# Google Trends Scraper (Reliable, No Browser) (`steadyapi/google-trends-scraper`) Actor

Fast, retry-hardened Google Trends scraper. Interest over time, related queries, related topics, interest by region. No browser = lower cost and fewer failures.

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

## Pricing

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

## 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 — Reliable, No Browser

Get Google Trends data that actually comes back. No headless browser, no silent empty runs.

Pull **interest over time**, **related queries**, **related topics** and **interest by region** for any keyword, country and time range.

***

### Why this Actor exists

Google Trends has no official API, so most scrapers either drive a headless browser (slow and expensive) or call the internal endpoints without handling how Google gates them. Both break often.

Here is the thing that most implementations miss:

> **The Google Trends internal API returns `429 Too Many Requests` on the very first call if you do not carry an `NID` cookie.** It is not a rate limit. It is a gate.

Measured on 2026-09-15:

| Request | Result |
| --- | --- |
| `/trends/api/explore` with no cookie | `429` |
| Same call after one visit to `trends.google.com` to pick up `NID` | `200` |

This Actor treats **"proxy IP + the cookie issued to that IP"** as a single session. When a session gets gated, it throws away the whole session and builds a new one. Refreshing only the cookie does not help, because the IP is already flagged.

### What you get

- **No browser.** Direct JSON endpoints only. Runs finish in seconds and cost a fraction of a browser-based Actor.
- **Retry that understands the failure.** Exponential backoff with jitter on `429` and `5xx`. Empty `200` bodies are treated as a silent throttle and retried, not returned as success.
- **Partial success by default.** One bad keyword does not kill the run. Failed keywords come back as rows with an `error` and an `errorType` so you know exactly what is missing and why.
- **A run summary you can assert on.** `RUN_SUMMARY` in the key-value store gives you `requested`, `succeeded`, `failed`, `successRate` and `proxySessionsUsed`.
- **You are not charged for failed keywords.**

### Input

| Field | Type | Default | Notes |
| --- | --- | --- | --- |
| `keywords` | array | required | One or more search terms |
| `compareKeywords` | boolean | `false` | On: one comparison chart, max 5 keywords, values relative to each other. Off: each keyword on its own 0-100 scale |
| `timeframe` | string | `today 12-m` | `now 1-H` … `today 5-y`, `all` |
| `geo` | string | `""` (worldwide) | `US`, `GB`, `DE`, `JP`, or sub-regions like `US-CA` |
| `includeInterestOverTime` | boolean | `true` | The main trend line |
| `includeRelatedQueries` | boolean | `false` | Top and rising queries |
| `includeRelatedTopics` | boolean | `false` | Top and rising topics |
| `includeInterestByRegion` | boolean | `false` | Country or sub-region breakdown |
| `category` | integer | `0` | Google Trends category ID |
| `property` | string | `""` | `""` web, `images`, `news`, `youtube`, `froogle` |
| `hl` / `tz` | string / int | `en-US` / `0` | Response language and timezone offset in minutes (0 = UTC) |
| `requestDelayMs` | integer | `1200` | Raise for very large keyword lists |
| `proxyConfiguration` | object | Datacenter | Switch to Residential for thousands of keywords |

#### Example

```json
{
  "keywords": ["bitcoin", "ethereum", "solana"],
  "geo": "US",
  "timeframe": "today 3-m",
  "includeInterestOverTime": true,
  "includeRelatedQueries": true
}
```

### Output

One dataset row per keyword (or per comparison group).

```json
{
  "keywords": ["bitcoin"],
  "geo": "US",
  "timeframe": "today 3-m",
  "category": 0,
  "property": "web",
  "scrapedAt": "2026-09-15T13:02:11.482Z",
  "interestOverTime": [
    { "date": "Jun 15, 2026", "timestamp": 1781481600000, "values": [89], "isPartial": false },
    { "date": "Sep 15, 2026", "timestamp": 1789430400000, "values": [44], "isPartial": true }
  ],
  "relatedQueries": {
    "top":    [{ "query": "bitcoin price", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "british man recovers lost bitcoin", "formattedValue": "Breakout" }]
  }
}
```

`isPartial: true` marks the current, still-incomplete bucket. Drop those points before charting if you need clean series.

A failed keyword looks like this instead:

```json
{
  "keywords": ["some-term"],
  "error": "429 Too Many Requests — temporarily gated by Google",
  "errorType": "BLOCKED_OR_UNAVAILABLE",
  "scrapedAt": "2026-09-15T13:02:14.113Z"
}
```

`errorType` is either `INVALID_REQUEST` (your input will never work, fix it) or `BLOCKED_OR_UNAVAILABLE` (retry later or use Residential proxy).

### Notes on the data

Google Trends values are **relative, not absolute search volume**. `100` is the peak of the selected range, everything else is scaled to that. Two separate runs are not directly comparable unless you use `compareKeywords`.

### Tips

- Scraping thousands of keywords: set `proxyConfiguration` to Residential and `requestDelayMs` to `3000`.
- Comparing brands: turn on `compareKeywords` so the numbers share one scale.
- Building a dashboard: use `timestamp` (epoch ms), not `date`, which is a localized display string.

### Legal

Only public Google Trends data is requested. No login, no personal data, no private endpoints.

# Actor input Schema

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

Search terms to look up. Each keyword is fetched separately unless you turn on Compare mode.

## `compareKeywords` (type: `boolean`):

On: all keywords go into ONE Google Trends comparison (max 5, values are relative to each other). Off: each keyword is fetched on its own 0-100 scale.

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

Google Trends time range.

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

Two-letter country code such as US, GB, DE, JP. Leave empty for worldwide. Sub-regions like US-CA also work.

## `includeInterestOverTime` (type: `boolean`):

The main trend line (0-100 over the selected period).

## `includeRelatedQueries` (type: `boolean`):

Top and rising related search queries.

## `includeRelatedTopics` (type: `boolean`):

Top and rising related topics.

## `includeInterestByRegion` (type: `boolean`):

Breakdown by country or sub-region.

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

Google Trends category ID. 0 means all categories. Example: 7 = Finance, 71 = Food & Drink.

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

Which Google surface to measure.

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

Response language, e.g. en-US, es, de.

## `tz` (type: `integer`):

Negative of the UTC offset in minutes. 0 = UTC, -60 = UTC+1, 300 = UTC-5.

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

Raise this if you hit rate limits on very large keyword lists.

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

Optional. Works without a proxy too, but a proxy makes large runs far more reliable. Use Residential if you scrape thousands of keywords.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin",
    "ethereum"
  ],
  "compareKeywords": false,
  "timeframe": "today 12-m",
  "geo": "",
  "includeInterestOverTime": true,
  "includeRelatedQueries": false,
  "includeRelatedTopics": false,
  "includeInterestByRegion": false,
  "category": 0,
  "property": "",
  "hl": "en-US",
  "tz": 0,
  "requestDelayMs": 1200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `trends` (type: `string`):

Interest over time, related queries, related topics and interest by region for each keyword.

## `runSummary` (type: `string`):

requested / succeeded / failed / successRate and how many proxy sessions were used.

# 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",
        "ethereum"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyapi/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",
        "ethereum",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("steadyapi/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",
    "ethereum"
  ]
}' |
apify call steadyapi/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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