# Google Trends Scraper — Fast, No Browser Needed (`pixelvoid/google-trends-scraper-api`) Actor

Browserless Google Trends scraper: interest over time, interest by region, related queries & topics, and daily trending searches. No Playwright, no browser — fast and cheap.

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

## Pricing

from $1.50 / 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/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 — Fast, No Browser Needed

Scrape [Google Trends](https://trends.google.com/) data via Google's own internal JSON API — **no browser, no Playwright, no CAPTCHAs**. Get interest over time, interest by region, related queries and related topics for any keyword, geo and time range. A fast alternative to the official Google Trends UI and other browser-based scrapers.

### Why this Actor

- **Fast** — hits Google's JSON API directly instead of rendering a browser. A typical keyword completes in seconds.
- **Reliable** — automatic retries with exponential backoff on rate limits (HTTP 429), a real cookie jar (NID, AEC, CONSENT, SOCS) that survives Google's EU consent redirects, and you're never charged for empty results. Optional Apify Proxy to escape IP soft-blocks.
- **Clean output** — structured records with typed values, ready for Excel, Looker Studio, or an LLM pipeline.

### What you get

Per keyword (configurable via **Data types**):

| Data type | Description |
| --- | --- |
| `INTEREST_OVER_TIME` | Search interest over the selected time range (0–100 scale) |
| `INTEREST_BY_REGION` | Interest broken down by country / region |
| `RELATED_QUERIES` | Top and rising related search queries with interest values |
| `RELATED_TOPICS` | Top and rising related topics |

### Input

| Field | Type | Description |
| --- | --- | --- |
| `searchTerms` | array | Keywords to analyze. Multiple keywords = comparison in one run. |
| `startUrls` | array | Optional — paste Google Trends explore URLs (keyword, geo, date parsed automatically). Comparison URLs with comma-separated terms (`?q=react,vue`) are split into individual keywords. Overrides `searchTerms` when provided. |
| `geo` | string | ISO country code (e.g. `US`, `LT`, `DE`, `GB`). Empty = Worldwide. |
| `timeRange` | select | `now 1-H` … `all` (since 2004). Default: `today 12-m`. |
| `customTimeRange` | string | Exact range as `YYYY-MM-DD YYYY-MM-DD` (takes precedence). |
| `category` | integer | Google Trends category ID (`0` = all). |
| `dataTypes` | multi-select | Which datasets to return per keyword. |
| `maxItems` | integer | Cap on output records (`0` = unlimited). |

#### Example input

```json
{
  "searchTerms": ["chatgpt", "claude"],
  "geo": "US",
  "timeRange": "today 3-m",
  "dataTypes": ["INTEREST_OVER_TIME", "RELATED_QUERIES"]
}
```

### Output

One record per (keyword × data type). Example:

```json
{
  "type": "INTEREST_OVER_TIME",
  "keyword": "chatgpt",
  "geo": "US",
  "timeRange": "today 3-m",
  "comparisonGroup": "US|today 3-m|chunk-0",
  "data": [
    { "date": "May 7, 2026", "value": 95 },
    { "date": "May 14, 2026", "value": 92 }
  ]
}
```

```json
{
  "type": "RELATED_QUERIES",
  "keyword": "chatgpt",
  "geo": "US",
  "timeRange": "today 3-m",
  "comparisonGroup": "US|today 3-m|related:chatgpt",
  "top": [{ "query": "openai chatgpt", "value": 100, "formattedValue": "100", "link": "/trends/explore?q=..." }],
  "rising": [{ "query": "chatgpt wrapper", "value": null, "formattedValue": "Breakout", "link": "/trends/explore?q=..." }]
}
```

**`comparisonGroup`** identifies the explore request a record came from. Google normalizes interest to 0–100 **per request**, so only records with the *same* `comparisonGroup` are mutually comparable.

Export to CSV / JSON / XLSX from the dataset, schedule recurring runs, or call it via API for programmatic access.

### Use cases

- SEO & content strategy — find rising queries before they peak
- Market research — compare brand interest across regions
- Trend monitoring — scheduled runs to track momentum over time
- AI/LLM pipelines — structured trend data as model input

### Cost

Pay-per-result: **$1.50 per 1,000 dataset records**, plus **$0.01 per Actor start**. You are charged only for records pushed to the dataset — never for empty results. Run a small test first — a single keyword with all data types costs cents.

### Notes

- Interest values are Google's normalized 0–100 scale.
- **More than 5 terms? Values across chunks are NOT comparable.** Google caps comparisons at 5 terms per explore, so larger groups are split into multiple requests — each normalized to 0–100 independently. A 95 in `chunk-0` and a 60 in `chunk-1` are on different scales. Only compare records that share the same `comparisonGroup`.
- `RELATED_TOPICS` may return an empty list for some keyword/geo combinations — Google doesn't always have topic data.
- The Actor uses Google's public Trends JSON endpoints. Usage falls under Google's Terms of Service for the Trends service.

### Development

```bash
npm install
apify run --input-file /tmp/input.json   # test locally
apify push                                 # deploy to Apify
```

# Actor input Schema

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

List of keywords to get Google Trends data for.

## `startUrls` (type: `array`):

Optional. Paste Google Trends explore URLs — keyword, geo and date are parsed from each URL. Overrides searchTerms when provided.

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

ISO country code (e.g. US, LT, DE, GB). Empty = Worldwide.

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

Predefined time range.

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

Custom range as 'YYYY-MM-DD YYYY-MM-DD'. Takes precedence over timeRange.

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

Google Trends category ID (0 = all categories).

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

Which data sets to return per keyword.

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

Maximum number of output records (0 = unlimited).

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

Optional. Route requests through Apify Proxy to escape Google IP soft-blocks (datacenter IPs get captcha-walled). Pick a country for best results.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping"
  ],
  "timeRange": "today 12-m",
  "category": 0,
  "dataTypes": [
    "INTEREST_OVER_TIME",
    "INTEREST_BY_REGION",
    "RELATED_QUERIES",
    "RELATED_TOPICS"
  ],
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Default dataset: one record per (keyword × data type), discriminated by the `type` field. INTEREST\_OVER\_TIME records carry `data: [{ date, value }]`; INTEREST\_BY\_REGION records carry `data: [{ region, value }]`; RELATED\_QUERIES records carry `top`/`rising` lists of `{ query, value, formattedValue, link }`; RELATED\_TOPICS records are the same but with `topic` instead of `query`. Every record also has `keyword`, `geo`, `timeRange` and `comparisonGroup`. Interest values are normalized 0–100 per explore request — only records sharing the same `comparisonGroup` are mutually comparable. Empty results are never pushed.

# 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": [
        "web scraping"
    ],
    "geo": "",
    "customTimeRange": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("pixelvoid/google-trends-scraper-api").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": ["web scraping"],
    "geo": "",
    "customTimeRange": "",
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pixelvoid/google-trends-scraper-api"
        }
    }
}

```

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/arwM9Lyeyu2HFuEML/builds/d7AoYXk8ESH6jP2aa/openapi.json
