# Google Trends Scraper & API — Interest by Region (`acebuilds/google-trends-scraper`) Actor

Google Trends data that actually comes back: interest over time, interest by region, and top/rising related queries and topics. Browserless and proxy-rotating, so it survives the rate limits that break DOM-based scrapers. You pay only for rows delivered.

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

## Pricing

$3.00 / 1,000 trend rows

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 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 — Interest, Regions & Related Queries

Google Trends data that actually comes back.

Pull **interest over time**, **interest by region**, and **top + rising related queries**
for any keyword, any country, any time range — as clean tabular rows ready for a
spreadsheet, a dashboard, or an LLM pipeline.

***

### Why this one

Most Google Trends scrapers drive a headless browser and read the page. Google changes
the page, the selectors break, and the run either returns nothing or spins until it
times out — while you get billed for it anyway.

This actor takes a different path:

| | This actor | Typical browser-based scraper |
|---|---|---|
| **How it gets data** | Google's own JSON endpoints | Headless browser + DOM selectors |
| **Breaks when Google restyles the page** | No | Yes |
| **Memory** | 1 GB | 4 GB |
| **Rate limits (HTTP 429)** | Cookie warm-up + exponential backoff + **fresh proxy session per retry** | Usually just fails |
| **What you pay for** | **Only rows actually delivered** | Often a start fee regardless of output |

**If a run returns nothing, it costs you nothing.** There is no actor-start charge.
Every row you are billed for is a row in your dataset.

***

### What you get

#### Interest over time

```json
{
  "recordType": "interest_over_time",
  "searchTerm": "bitcoin",
  "date": "May 7, 2026",
  "timestamp": "2026-05-07T00:00:00.000Z",
  "value": 52,
  "isPartial": false,
  "geo": "US",
  "timeRange": "today 3-m"
}
```

#### Interest by region

```json
{
  "recordType": "interest_by_region",
  "searchTerm": "bitcoin",
  "region": "Wyoming",
  "geoCode": "US-WY",
  "value": 100
}
```

#### Related queries (top + rising)

```json
{
  "recordType": "related_query",
  "searchTerm": "bitcoin",
  "rankType": "RISING",
  "query": "spacex stock price",
  "value": 3250,
  "formattedValue": "+3,250%",
  "link": "https://trends.google.com/trends/explore?q=..."
}
```

`rankType` is `TOP` (most searched alongside your term) or `RISING` (fastest growing —
`Breakout` means growth over 5000%).

***

### Input

| Field | Type | Notes |
|---|---|---|
| `searchTerms` | array | **Required.** One or more keywords. |
| `dataTypes` | array | `TIMESERIES`, `GEO_MAP`, `RELATED_QUERIES`. Fewer types = fewer rows = lower cost. |
| `timeRange` | string | `now 1-H` … `today 5-y`, `all`. Default `today 12-m`. |
| `customTimeRange` | string | `YYYY-MM-DD YYYY-MM-DD`. Overrides `timeRange`. |
| `geo` | string | `US`, `GB`, `DE`, or a sub-region like `US-CA`. Empty = worldwide. |
| `compareTerms` | boolean | ON = one request, values relative across terms (Google's comparison mode). OFF = each term on its own 0–100 scale. |
| `category` | integer | Google Trends category id. `0` = all. |
| `maxItems` | integer | Hard cap on delivered rows — your spend ceiling. `0` = no limit. |
| `proxyConfiguration` | object | Residential strongly recommended. |

#### Example

```json
{
  "searchTerms": ["bitcoin", "ethereum", "solana"],
  "dataTypes": ["TIMESERIES", "GEO_MAP", "RELATED_QUERIES"],
  "timeRange": "today 3-m",
  "geo": "US"
}
```

→ 519 rows.

***

### Understanding the numbers

Google Trends values are **relative, not absolute search counts**. Within a single
request, `100` is the peak point and everything else is scaled against it. That means:

- Values for a term scraped alone are **not** comparable to the same term scraped in a
  comparison group. Use `compareTerms: true` when you need terms on one shared scale.
- `isPartial: true` marks a period that has not finished collecting yet — the last data
  point is usually partial and will rise. Exclude it from trend calculations.

***

### Honest limitations

- **Related *topics* are not available.** Google's endpoint returns an empty list for
  every term we tested, so this actor does not offer that option rather than quietly
  charging you for nothing. Related *queries* work fine and are usually what people want.
- **Google rate-limits aggressively.** The actor retries with backoff and rotates to a
  fresh proxy session on each 429. Large jobs still run faster and cleaner with
  residential proxies enabled. If everything is blocked, the run fails and bills nothing.
- **Hourly ranges** (`now 1-H`, `now 4-H`) return far fewer points than daily ranges —
  that is Google's granularity, not a truncation.
- Google is rolling out an official Trends API (currently a closed alpha). If and when
  it opens, this actor will move to it.

***

### Use it for

- **SEO & content** — find rising queries before they peak.
- **Market research** — compare brand or product interest across regions.
- **Finance & crypto** — retail attention as a sentiment input.
- **Journalism & academia** — reproducible search-interest series with real timestamps.
- **LLM pipelines** — flat rows, no HTML, no post-processing.

***

### Scheduling

Point the Apify Scheduler at this actor to build your own history: run daily with
`timeRange: "now 7-d"` and append to a dataset. Because you are only charged per
delivered row, a scheduled watch on a handful of terms stays cheap.

# Actor input Schema

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

One or more keywords to look up on Google Trends. Each term is scraped independently unless you turn on 'Compare terms'.

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

Which Google Trends datasets to return. Fewer types = fewer rows = lower cost.

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

Predefined period. Ignored if you set a custom time range below.

## `customTimeRange` (type: `string`):

Overrides the time range above. Format: `YYYY-MM-DD YYYY-MM-DD` (e.g. `2025-01-01 2026-01-01`).

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

Two-letter country code (`US`, `GB`, `DE`) or a sub-region (`US-CA`). Leave empty for worldwide.

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

ON: all terms go in one request and values are relative to each other (Google's comparison mode). OFF: each term gets its own independent 0-100 scale.

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

Google Trends category id to narrow the search. 0 = all categories.

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

Interface language for returned labels, e.g. `en-US`, `de-DE`.

## `maxItems` (type: `integer`):

Hard cap on delivered rows — a spend ceiling you control. 0 = no limit.

## `maxRetries` (type: `integer`):

Google rate-limits aggressively. Each retry rotates to a fresh proxy session.

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

Residential proxies are strongly recommended — Google Trends returns HTTP 429 to most datacenter IPs.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin"
  ],
  "dataTypes": [
    "TIMESERIES",
    "RELATED_QUERIES"
  ],
  "timeRange": "today 12-m",
  "geo": "",
  "compareTerms": false,
  "category": 0,
  "language": "en-US",
  "maxItems": 0,
  "maxRetries": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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": [
        "artificial intelligence",
        "machine learning"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("acebuilds/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": [
        "artificial intelligence",
        "machine learning",
    ] }

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

```

## MCP server setup

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