# Google Trends Scraper & API — Compare Unlimited Keywords (`datasmithhq/google-trends-scraper`) Actor

Export Google Trends data to JSON, CSV or Excel. Interest over time, by region and related queries for any number of keywords, all on one comparable scale. Pay per result.

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

## Pricing

from $3.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 — Unlimited Keywords, One Scale

Get Google Trends data for **any number of keywords** — 5, 50 or 500 — all on one
consistent 0–100 scale. Interest over time, interest by region, and top & rising
related queries. Export to JSON, CSV, Excel or straight into Google Sheets.

### Why this Google Trends scraper?

- **Compare more than 5 keywords.** Google Trends only compares 5 at a time and rescales every
  comparison. This Actor uses an anchor keyword to stitch batches together, so every keyword
  sits on the same scale — values match Google's own side-by-side comparison.
- **Built for reliability.** Automatic retries with exponential backoff and fresh residential
  IPs when Google rate-limits.
- **Decimal precision.** Values to 2 decimals after normalization, not rounded integers.
- **Spreadsheet-ready.** Choose one row per keyword, or one row per keyword per date.
- **You only pay for real data.** Empty results (e.g. too little search volume) are not charged.

### What data can I get?

| Data | Description |
|---|---|
| Interest over time | Timeline of search interest, plus average, peak value and peak date |
| Interest by region | Countries, states, metro areas (US) or cities |
| Related queries | Top and rising queries, including "Breakout" terms |

Filters: country/region, time range (past hour to 2004–present, or custom dates),
category, and search type (web, images, news, Google Shopping, YouTube).

### How to use

1. Enter your **search terms** — as many as you like.
2. Optionally set a **country** (e.g. `US`, `GB`, `IN`) and **time range**.
3. Tick the data you want and click **Start**.

**Comparing more than 5 terms?** Set the **anchor keyword** to a term of medium-to-high
popularity among your list. If the anchor is far less popular than another keyword, that
keyword's row includes a `normalizationWarning`.

### Output example

```json
{
  "type": "interestOverTime",
  "keyword": "python",
  "geo": "US",
  "timeRange": "today 3-m",
  "average": 22.42,
  "peakValue": 39.26,
  "peakDate": "2026-09-20",
  "comparedKeywords": 7,
  "timeline": [
    { "date": "2026-07-23", "value": 21.5, "isPartial": false }
  ]
}
```

### Pricing

**$0.003 per result ($3 per 1,000 results)**, plus a start fee of under $0.0001 per run.
One result = one keyword's timeline, region breakdown or related-queries list.
Example: interest over time for 20 keywords = 20 results = **$0.06**.
No subscription. Proxy costs are included, and empty results are never charged.

### Use via API

Call the Actor from any language with the Apify API or client libraries. Example input:

```json
{
  "searchTerms": ["python", "java", "javascript", "rust", "golang", "kotlin", "swift"],
  "anchorKeyword": "java",
  "geo": "US",
  "timeRange": "today 3-m",
  "includeInterestByRegion": true,
  "includeRelatedQueries": true
}
```

### Use cases

- **SEO & content planning** — find rising queries and seasonal peaks
- **Market research** — compare brands, products or competitors at scale
- **E-commerce** — spot demand trends before stocking up
- **AI agents & dashboards** — schedule runs and feed trend data via API

### FAQ

**Why are values relative, not search volumes?** Google Trends only publishes relative
interest (0–100), never absolute volumes.

**Can I use it via API or on a schedule?** Yes — use the Apify API, schedules, or integrations
(Make, Zapier, n8n, Google Sheets).

**Is it legal?** It collects publicly available, aggregated statistics — no personal data.

**Something broke?** Open an issue on the Issues tab and it will be fixed quickly.

# Actor input Schema

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

Keywords to analyse. Any number — more than 5 are automatically compared on one scale.

## `anchorKeyword` (type: `string`):

Keyword included in every batch to put all terms on one scale. Pick one of medium-to-high popularity. Defaults to the first search term.

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

ISO code like US, GB, IN or US-CA. Leave empty for worldwide.

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

Period to analyse. Use Custom time range for exact dates.

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

Overrides Time range. Format: YYYY-MM-DD YYYY-MM-DD, e.g. 2024-01-01 2024-12-31.

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

Google Trends category ID (0 = all categories).

## `searchProperty` (type: `string`):

Which Google search to measure: web, images, news, Shopping or YouTube.

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

Timeline of search interest with average, peak value and peak date.

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

Where each keyword is most popular (countries, states, metro areas or cities).

## `regionResolution` (type: `string`):

Used when a country is set. Metro areas (DMA) are US only.

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

Top and rising searches related to each keyword, including Breakout terms.

## `outputFormat` (type: `string`):

One row per keyword (timeline as a list) or one row per keyword per date (best for spreadsheets).

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

Interface language for names of regions and topics, e.g. en-US, de, fr.

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

How many times to retry a request Google rate-limits before giving up.

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

Residential proxies strongly recommended — Google rate-limits datacenter IPs.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "gemini",
    "claude"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "searchProperty": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": false,
  "regionResolution": "REGION",
  "includeRelatedQueries": false,
  "outputFormat": "perKeyword",
  "language": "en-US",
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Interest over time, interest by region and related queries — one item per keyword and data type.

# 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": [
        "chatgpt",
        "gemini",
        "claude"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datasmithhq/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": [
        "chatgpt",
        "gemini",
        "claude",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datasmithhq/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": [
    "chatgpt",
    "gemini",
    "claude"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datasmithhq/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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