# Google Trends Scraper — Reliable, Pay Only for Results (`keel-data/google-trends-scraper`) Actor

Get Google Trends interest over time, interest by region or city, related queries and related topics for any keyword, country and time range. Compare up to 5 terms. Automatic retries and proxy rotation; failed terms are never charged.

- **URL**: https://apify.com/keel-data/google-trends-scraper.md
- **Developed by:** [Keel Data](https://apify.com/keel-data) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 keyword reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Get **Google Trends data as clean JSON**: interest over time, interest by region or city, and related queries, for any keyword, country and time range. Compare up to 5 terms at once.

Built to be reliable. The scraper retries with fresh IPs when Google rate-limits, switches to residential proxies by itself, and **never charges you for a term that failed**.

### What you get

For each search term, one row with:

| Field | What it is |
|---|---|
| `interestOverTime` | Time series of search interest, 0–100 (daily, weekly or monthly depending on the range) |
| `averageInterest`, `peak`, `latest`, `changePercent` | Ready-made summary: average, highest point, latest full period, and change between the first and last quarter of the window |
| `interestByRegion` | Where the term is searched most: countries, states/provinces, cities or US metro areas (DMA) |
| `regionShareInComparison` | When comparing terms: each term's share of searches in every region |
| `relatedQueries.top` / `.rising` | What people also search for, including "Breakout" rising queries |
| `relatedTopics.top` / `.rising` | Related topics, when Google provides them for the request |
| `trendsUrl` | Link to the same view on trends.google.com |

### How to use it

1. Type your **search terms** (one per line).
2. Pick a **location** (`US`, `CA`, `FR`, `GB`… or a region like `US-CA`, `CA-QC`), or leave it empty for worldwide.
3. Pick a **time range**, from the past hour to 2004–present, or custom dates.
4. Turn on **Compare terms** if you want the terms scaled against each other, like typing several terms on Google Trends.
5. Run. Download the results as JSON, CSV or Excel, or connect them to Google Sheets, Make, Zapier or n8n.

#### Example input

```json
{
  "searchTerms": ["heat pump", "air conditioner"],
  "geo": "US",
  "timeRange": "past-12-months",
  "compareTerms": true
}
```

#### Example output (shortened)

```json
{
  "status": "ok",
  "searchTerm": "heat pump",
  "comparedWith": ["air conditioner"],
  "geo": "US",
  "timeRange": "past-12-months",
  "averageInterest": 45.9,
  "changePercent": 13.2,
  "peak": { "date": "2026-01-18T00:00:00.000Z", "value": 100 },
  "interestOverTime": [{ "date": "2025-11-02T00:00:00.000Z", "value": 32, "isPartial": false }],
  "interestByRegion": [{ "geoCode": "US-ME", "geoName": "Maine", "value": 100 }],
  "relatedQueries": { "top": [{ "query": "heat pump cost", "value": 76 }], "rising": [{ "query": "heat pump rebate", "formattedValue": "Breakout" }] },
  "trendsUrl": "https://trends.google.com/trends/explore?q=heat+pump%2Cair+conditioner&date=today+12-m&geo=US"
}
```

### Pricing

You pay **per keyword report delivered**: one row per search term with every section you asked for. Proxies are included.

- Terms that fail after all retries are **free**. They appear in the dataset with `status: "error"` so you can see what happened.
- Terms with too little search volume return `status: "no_data"` and are **free**.
- Set a maximum cost per run in the run options. The scraper stops cleanly when it gets there and keeps everything already collected.

### Use cases

- **SEO and content planning:** find rising queries and the best months to publish.
- **Market research:** compare brands, products or competitors by region.
- **E-commerce:** time stock and promotions with seasonal demand (use the Google Shopping property).
- **YouTube creators:** check what people search on YouTube (YouTube property).
- **Data science and AI agents:** feed clean time series into models, dashboards or an AI assistant through the Apify MCP server.

### Tips

- Values are relative (0–100), not search counts. 100 is the peak for that term, place and time.
- Short ranges (past hour or day) give minute or hour data; 5 years and more give monthly data.
- Very niche terms in small regions may return `no_data`. Try a wider geo or a longer range.
- When comparing, Google does not return related topics. Run terms one by one if you need them.

### Reliability

Each run reports what happened in the `RUN_STATS` record (requests, retries, blocks). We run test scrapes every day and fix breakages fast. If something looks wrong, open an issue on the **Issues** tab and we answer within one business day.

### Is scraping Google Trends allowed?

This actor collects only public, aggregated Google Trends data. It does not collect personal data. You are responsible for how you use the results. Google Trends is a trademark of Google LLC; this actor is not affiliated with or endorsed by Google.

# Actor input Schema

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

Keywords to look up. One report per term. Up to 100 characters each.

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

Leave empty for worldwide. Use a country code (US, CA, FR, GB...) or a region code (US-CA, CA-QC, FR-IDF...).

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

Window of the data. Choose 'custom' to set exact dates below.

## `startDate` (type: `string`):

YYYY-MM-DD. Only used when time range is 'Custom dates'.

## `endDate` (type: `string`):

YYYY-MM-DD. Only used when time range is 'Custom dates'.

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

On: terms are compared in groups of up to 5, so values are relative to each other (like typing several terms in Google Trends). Off: each term is scaled 0–100 on its own.

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

Level of 'interest by region'. Defaults to REGION (states/provinces) when a country is set, COUNTRY when worldwide. DMA = US metro areas.

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

Which Google search to measure.

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

Google Trends category number. 0 = all categories. Example: 71 = Food & Drink, 958 = Jobs.

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

Time series of search interest (0–100).

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

Where the term is most searched.

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

Top and rising related searches.

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

Top and rising related topics (single-term requests only; Google omits them when comparing).

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

Language for topic names and labels, e.g. en-US, fr-CA, de.

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

How many times to retry with a fresh IP when Google rate-limits. Retries are free.

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

Leave as is. By default the scraper rotates Apify datacenter proxies and switches to residential proxies automatically if Google starts blocking. Proxy costs are included in the price.

## Actor input object example

```json
{
  "searchTerms": [
    "heat pump",
    "air conditioner"
  ],
  "geo": "",
  "timeRange": "past-12-months",
  "compareTerms": false,
  "searchProperty": "web",
  "category": 0,
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "language": "en-US",
  "maxRetries": 6
}
```

# Actor output Schema

## `overview` (type: `string`):

One report per search term: interest over time, by region, related queries and topics.

## `runStats` (type: `string`):

Requests, retries and counts of delivered and failed items for this run.

# 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": [
        "heat pump",
        "air conditioner"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("keel-data/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": [
        "heat pump",
        "air conditioner",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("keel-data/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": [
    "heat pump",
    "air conditioner"
  ]
}' |
apify call keel-data/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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