# Google Trends Scraper (`ai-data-tools/google-trends`) Actor

Get Google Trends data for any keyword: interest over time, interest by country/region/city, related queries and related topics. Compare up to 5 terms. Fast, reliable, pay per search term.

- **URL**: https://apify.com/ai-data-tools/google-trends.md
- **Developed by:** [AI Data Tools](https://apify.com/ai-data-tools) (community)
- **Categories:** SEO tools, Marketing
- **Security:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 7.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 search terms

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

Get Google Trends data for any keyword, without the rate-limit headaches: **interest over time**, **interest by country, region or city**, and **related queries** (top and rising). Compare up to 5 terms at once, pick any location, time range, category or search type (web, YouTube, news, images, shopping), and export to JSON, CSV or Excel, or pull it through the API.

Runs on residential IPs and retries automatically after network errors. If Google refuses a search (for example because of a rate limit), it's marked `BLOCKED` and you aren't charged. We don't try to get around Google's limits. You only pay for search terms that come back with data.

### What you can use it for

- **Keyword and content research:** find rising queries before your competitors write about them.
- **SEO and marketing:** compare brand or product interest across countries and over time.
- **E-commerce and product research:** spot seasonal demand and trending products.
- **Data science and finance:** feed search interest into dashboards, models and reports.

### Input

| Field | What it does |
|---|---|
| Search terms | Keywords to look up. Each one is fetched on its own. |
| Compare terms | Put up to 5 terms in one chart, like on trends.google.com. Values become relative to each other. |
| Google Trends URLs | Paste trends.google.com/trends/explore links instead of (or as well as) terms. |
| Location | Country or region code (`US`, `DE`, `US-CA`). Empty = worldwide. |
| Time range | Past hour up to 2004–present, or exact dates. |
| Category ID / Search type | Same as the filters on the Google Trends site. |
| What to include | Turn off sections you don't need for faster runs. |

Example:

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

### Output

One result per search term (or per comparison). Shortened example:

```json
{
    "status": "OK",
    "searchTerms": ["bitcoin", "ethereum"],
    "geo": "Worldwide",
    "timeRange": "today 12-m",
    "property": "web",
    "url": "https://trends.google.com/trends/explore?q=bitcoin%2Cethereum&date=today+12-m",
    "averages": { "bitcoin": 41, "ethereum": 7 },
    "interestOverTime": [
        { "date": "2025-10-19T00:00:00.000Z", "formattedTime": "Oct 19 – 25, 2025", "values": { "bitcoin": 46, "ethereum": 10 }, "isPartial": false }
    ],
    "interestByRegion": [
        { "geoCode": "CH", "geoName": "Switzerland", "values": { "bitcoin": 88, "ethereum": 12 } }
    ],
    "relatedQueries": {
        "bitcoin": {
            "top": [{ "query": "bitcoin price", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=bitcoin+price&date=today+12-m" }],
            "rising": [{ "query": "...", "value": 450, "formattedValue": "+450%", "link": "..." }]
        }
    },
    "scrapedAt": "2026-10-25T19:10:00.000Z"
}
```

Searches that don't come back are listed too, free of charge: `{ "status": "BLOCKED", "searchTerms": ["..."], "error": "Blocked by Google (HTTP 429)" }`. `FAILED` means a network error.

The dataset has an **Interest over time** view that flattens the timeline into one row per date, which is handy for CSV and Excel.

### Pricing

**$0.003 per search term** ($3 per 1,000), with no extra charge for related queries or regions. A comparison of 3 terms counts as 3. Searches that fail are not charged, and the run stops on its own when it reaches the spending limit you set.

### FAQ

**What do the numbers mean?** Same as on Google Trends: 0–100, where 100 is the peak interest for the chosen terms, place and time. They're relative, not absolute search volumes.

**Why are related topics missing?** Google doesn't return related topics when comparing terms, and currently returns them empty for most searches. They're included whenever Google provides them.

**Do I need a proxy?** Yes. Google refuses most requests from datacenter IPs, so residential proxies are the default. You can switch to your own proxies in the input.

**What if searches come back BLOCKED?** Google limits how many searches it answers in a short time. Run fewer terms at once or try again later; blocked searches are never charged.

**Is it legal?** It collects aggregated, public search statistics; no personal data. As with any data source, check that your use complies with the terms and laws that apply to you.

Missing a feature, or found a search that doesn't work? Open an issue on the Issues tab and include the input you used.

# Actor input Schema

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

Keywords to look up on Google Trends. Each term is fetched separately unless you turn on "Compare terms".

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

Compare up to 5 terms in one chart, like typing them side by side on trends.google.com. Values are then relative to each other. More than 5 terms are split into groups of 5.

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

Optional. Paste trends.google.com/trends/explore links; the terms, location, time range, category and property are taken from the link.

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

Country or region code, e.g. US, DE, GB, US-CA, DE-BY. Leave empty for worldwide.

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

Period to fetch. Pick "Custom" to set exact dates below.

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

Used when Time range is "Custom". Format: YYYY-MM-DD YYYY-MM-DD, e.g. 2024-01-01 2024-06-30.

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

Google Trends category ID, e.g. 0 = all, 71 = Food & Drink, 5 = Computers & Electronics. It's the "cat" value in a trends.google.com URL.

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

Which Google search to measure.

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

Timeline of search interest (0-100).

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

Search interest per country, region or city.

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

Level of detail for interest by region. Auto = countries for worldwide, regions/states for a country.

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

Top and rising related searches.

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

Top and rising related topics.

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

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

## `maxConcurrency` (type: `integer`):

How many searches run in parallel.

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

Retries when a request fails because of a network problem. Searches that Google refuses are not retried; they're marked BLOCKED and not charged.

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

Residential proxies are recommended; Google refuses most requests from datacenter IPs.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "claude ai"
  ],
  "compareTerms": false,
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "auto",
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "language": "en-US",
  "maxConcurrency": 5,
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

## `interestOverTime` (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": [
        "chatgpt",
        "claude ai"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ai-data-tools/google-trends").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",
        "claude ai",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ai-data-tools/google-trends").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",
    "claude ai"
  ]
}' |
apify call ai-data-tools/google-trends --silent --output-dataset

```

## MCP server setup

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

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/VkEqTWNEdjg27W8un/builds/8zrnyoD0m0iPsJGWZ/openapi.json
