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

Interest over time, interest by region, related queries and topics for any search term, country, time range, category and Google property, straight from Google Trends' data API. No browser, no login; every term gets a row that says why when Google has nothing.

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

## Pricing

$3.00 / 1,000 term with data

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

Interest over time, interest by region, related queries and related topics for any search term, from Google Trends' own data API. Pick the country or region, the time range (presets or your own dates), a category and the Google property (web, images, news, YouTube, Shopping), and compare up to five terms in one chart like on the Trends page. **Every term you ask for comes back as a row**, and when Google has nothing the row says why (`no_data`, `invalid`, `blocked`) instead of an empty dataset. You pay only for rows that carry data.

No browser, no login, no cookies to paste: it calls the JSON endpoints behind the Trends page, paces itself the way Google tolerates, and rotates IPs before Google's rate limit or captcha wall shows up.

### What you get

For each term, one row with:

- **`interestOverTime`**: the chart's points (`time` in ISO 8601 UTC, `value` 0–100, `hasData`, `isPartial` for the still-open last period), plus `averageInterest`.
- **`interestByRegion`**: every country, region, metro area or city with its score, code and, for cities, coordinates. The level is Google's default or the one you choose.
- **`relatedQueries`** and **`relatedTopics`**: `top` (0–100) and `rising` (growth in percent, `isBreakout` when Google says "Breakout"), each with its Trends link; topics carry Google's Knowledge Graph id.
- **What was asked**: `term`, `comparedWith` (the other terms of the same chart, when comparing), `geo`, `timeRange`, `category`, `property`, `language`, and the `url` of the same query on Google Trends.
- **`status` and `reason`**: `ok`, `no_data` (Google has no data for that term there and then), `invalid` (Google rejected the geo, time range or category; the reason quotes Google), or `blocked` (every IP route was refused; unpaid).

### Input

| field | what it does |
|---|---|
| `searchTerms` | One term per line. Each is queried on its own unless `compareTerms` is on. |
| `urls` | Explore links copied from Google Trends; each carries its own terms, geo, dates, category and property. |
| `compareTerms` | Put the terms in one chart, five per chart: values become relative to the most searched of the group. |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m` (default), `today 5-y`, `all`. |
| `dateFrom`, `dateTo` | A custom range (`YYYY-MM-DD`) that replaces `timeRange`. |
| `geo` | Country (`US`) or region (`US-CA`) code; empty for worldwide. |
| `category` | Google Trends category id (`0` all). |
| `property` | `""` web, `images`, `news`, `youtube`, `froogle` (Shopping). |
| `sections` | Which of the four sections to fetch; fewer sections, fewer requests. |
| `regionLevel` | `auto`, `country`, `region`, `city`, `dma` (US metro areas). |
| `language` | Language of region names and topic titles (`en`, `es`, `pt-BR`). |
| `residentialFallback` | Retry through residential proxies when Google refuses the datacenter IPs. Default on. |

```json
{
    "searchTerms": ["bitcoin", "ethereum", "solana"],
    "compareTerms": true,
    "geo": "US",
    "timeRange": "today 12-m",
    "sections": ["interestOverTime", "relatedQueries"]
}
```

### Output example

```json
{
    "term": "bitcoin",
    "comparedWith": [],
    "geo": "US",
    "timeRange": "today 12-m",
    "category": 0,
    "property": "",
    "language": "en",
    "status": "ok",
    "reason": null,
    "interestOverTime": [
        { "time": "2025-09-14T00:00:00.000Z", "value": 25, "hasData": true, "isPartial": false },
        { "time": "2025-09-21T00:00:00.000Z", "value": 27, "hasData": true, "isPartial": false }
    ],
    "averageInterest": 41.3,
    "interestByRegion": [
        { "geoCode": "US-WY", "geoName": "Wyoming", "value": 100, "hasData": true, "latitude": null, "longitude": null },
        { "geoCode": "US-NV", "geoName": "Nevada", "value": 46, "hasData": true, "latitude": null, "longitude": null }
    ],
    "regionLevel": "region",
    "relatedQueries": {
        "top": [{ "query": "bitcoin price", "value": 100, "formattedValue": "100", "isBreakout": false, "url": "https://trends.google.com/trends/explore?q=bitcoin+price&date=today+12-m&geo=US" }],
        "rising": [{ "query": "bitcoin etf", "value": 1250, "formattedValue": "+1,250%", "isBreakout": false, "url": "https://trends.google.com/trends/explore?q=bitcoin+etf&date=today+12-m&geo=US" }]
    },
    "relatedTopics": {
        "top": [{ "title": "Bitcoin", "type": "Cryptocurrency", "mid": "/m/05p0rrx", "value": 100, "formattedValue": "100", "isBreakout": false, "url": "https://trends.google.com/trends/explore?q=/m/05p0rrx&date=today+12-m&geo=US" }],
        "rising": []
    },
    "url": "https://trends.google.com/trends/explore?q=bitcoin&date=today+12-m&hl=en&geo=US"
}
```

### Why this one

Most Google Trends Actors drive a headless browser through the Trends page, which is why runs take minutes, time out, or end with "no results" when Google shows a captcha. This one:

- **Reads the data endpoints directly**, with the cookie Google hands out to anyone. A term with all four sections is five small requests, about a second each.
- **Stays under Google's limits by design**: one request per second per IP, several IPs in parallel, and a fresh IP well before the point where Google starts answering 429. A plain 429 is retried after a pause; a captcha wall retires that IP and moves on. Direct → datacenter proxy → residential proxy, and a route Google keeps refusing is abandoned for the run instead of retried forever.
- **Says why a row is empty.** `no_data` is Google's answer, `invalid` quotes Google's rejection of the parameters, `blocked` means the run was refused, and none of those is charged.
- **Takes the query as you have it**: terms, or explore links with everything already in them, custom date ranges, categories, properties, region levels down to cities, and up to five terms compared per chart.

### Pricing

Pay per **term row with data** (`status: ok`). Rows with any other status are free. A term with all four sections costs about five requests of a few KB; running cost is a fraction of the price even through residential proxies.

### Limits and notes

- Values are Google's relative 0–100 scores, never absolute search volumes: Google Trends does not publish those.
- Google returns related topics only for single-term queries; in a comparison `relatedTopics` is `null`.
- Google rejects some combinations with HTTP 400 (an unknown region, a custom range before 2004 or after today, a region level the country does not have such as DMA outside the US). Those rows carry `status: invalid` and Google's message.
- Hourly ranges (`now …`) are available for the past 7 days at most; daily and weekly points depend on the range, as on the site.
- Google may refuse every IP for a while during heavy use; those rows come back as `blocked`, unpaid, and a later run gets them.
- This Actor reads public, aggregated data that Google Trends shows to any visitor. No personal data is involved.

# Actor input Schema

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

One term per line. Each term is queried on its own unless <b>Compare terms</b> is on. A Knowledge Graph topic id (<code>/m/05p0rrx</code>) works too.

## `urls` (type: `array`):

Explore links copied from Google Trends (<code>trends.google.com/trends/explore?q=…\&geo=…\&date=…</code>). Each link carries its own terms, geo, time range, category and property; comma-separated terms in <code>q</code> are compared.

## `compareTerms` (type: `boolean`):

Put the search terms in one chart (five per chart), so every value is relative to the most searched of the group, as on the Google Trends page. Off: each term is scored on its own 0–100 scale.

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

Google's presets. <code>now</code> ranges are hourly, <code>today</code> ranges daily or weekly. Dates below override it.

## `dateFrom` (type: `string`):

<code>YYYY-MM-DD</code>. With <b>to</b>, replaces the time range.

## `dateTo` (type: `string`):

<code>YYYY-MM-DD</code>, not before <b>from</b>.

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

A country code (<code>US</code>, <code>BR</code>) or a region code (<code>US-CA</code>, <code>GB-ENG</code>). Empty: worldwide.

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

Google Trends category id (<code>0</code> all, <code>7</code> Finance, <code>12</code> Business, <code>5</code> Computers, <code>45</code> Health…). The id is the <code>cat</code> parameter of an explore link.

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

Which searches to count.

## `sections` (type: `array`):

Fewer sections means fewer requests per term.

## `regionLevel` (type: `string`):

How fine the interest-by-region breakdown is. Auto: what Google shows by default (countries for worldwide, regions for a country). DMA is US metro areas.

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

Language for region names and topic titles (<code>en</code>, <code>es</code>, <code>pt-BR</code>).

## `residentialFallback` (type: `boolean`):

When Google refuses the run's own IP and the datacenter proxies, retry through residential proxies (included in the price: you pay per row, not per proxy byte). Off: those terms come back with status <code>blocked</code>, unpaid.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compareTerms": false,
  "timeRange": "today 12-m",
  "geo": "US",
  "category": 0,
  "property": "",
  "sections": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "regionLevel": "auto",
  "language": "en",
  "residentialFallback": true
}
```

# Actor output Schema

## `terms` (type: `string`):

No description

## `summary` (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": [
        "bitcoin",
        "ethereum"
    ],
    "geo": "US"
};

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

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

```

## MCP server setup

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