# Google Trends Scraper - Interest, Regions & Rising Queries (`datalift/google-trends-scraper`) Actor

Google Trends API: interest over time, interest by region (states, metros, cities), top and rising related queries for any keyword. Compare up to 5 terms. Reliable retries, $3 per 1,000 results.

- **URL**: https://apify.com/datalift/google-trends-scraper.md
- **Developed by:** [DataLift](https://apify.com/datalift) (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

Get **Google Trends** data for any keyword, in any country, for any time range, as clean JSON.

**$3 per 1,000 results.** One result = one search term (or one comparison of up to 5 terms). Failed searches are not charged.

### What you get

- **Interest over time**: the full timeline (0–100), with partial-period flags
- **Interest by region**: countries, states/regions, US metro areas (DMA) or cities
- **Related queries**: top and **rising** (including "Breakout" terms), great for keyword research
- **Related topics**: top and rising, when Google provides them
- **Average interest** per term
- A direct **Google Trends link** for every result

### Features

- **Compare mode**: put up to 5 terms on one scale, exactly like Google Trends' compare view
- **Any time range**: past hour up to 2004–present, or a custom date range
- **Web, Image, News, Shopping or YouTube search** trends
- **Category filter** (e.g. 7 = Finance, 45 = Health)
- **Reliable**: Google Trends rate-limits hard. Every request is retried on fresh residential IPs, so runs don't silently return empty data.

### Example input

```json
{
  "searchTerms": ["coke", "pepsi", "dr pepper"],
  "compare": true,
  "geo": "US",
  "timeRange": "today 5-y",
  "regionResolution": "DMA"
}
```

### Example output (single term, trimmed, illustrative values)

```json
{
  "searchTerm": "bitcoin",
  "geo": "US",
  "timeRange": "today 12-m",
  "averages": 41,
  "interestOverTime": [{ "date": "Oct 5 – 11, 2025", "timestamp": 1759622400, "value": 38, "isPartial": false }],
  "interestByRegion": [{ "geoCode": "US-WY", "geoName": "Wyoming", "value": 100 }],
  "relatedQueries": {
    "top": [{ "query": "bitcoin price", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "bitcoin etf", "value": 250, "formattedValue": "+250%" }]
  },
  "googleTrendsUrl": "https://trends.google.com/trends/explore?q=bitcoin&date=today+12-m&geo=US"
}
```

### Use cases

- SEO and keyword research (rising queries)
- Content and product ideation
- Market and seasonality analysis
- Feeding trend signals into dashboards, Sheets, n8n, Make, Zapier or AI agents

### Tips

- Values are relative (0–100) within each result. Use **compare mode** when you need terms on the same scale.
- Short time ranges (hours, days) on low-volume terms may return sparse data. That's how Google Trends works.

# Actor input Schema

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

Keywords to get Google Trends data for.

## `compare` (type: `boolean`):

Compare terms against each other on one scale, like Google Trends' compare view (groups of up to 5). Off = one independent result per term.

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

Country or region code, e.g. US, GB, US-CA, DE. Empty = worldwide.

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

Period to get data for.

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

Overrides Time range. Format: YYYY-MM-DD YYYY-MM-DD, e.g. 2025-01-01 2025-06-30.

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

Google Trends category ID (0 = all categories), e.g. 7 = Finance, 45 = Health.

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

Which Google search to get trends from.

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

Granularity of interest by region.

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

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

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

Parallel searches.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compare": false,
  "geo": "",
  "timeRange": "today 12-m",
  "customTimeRange": "",
  "category": 0,
  "property": "",
  "regionResolution": "",
  "language": "en-US",
  "maxConcurrency": 5
}
```

# Actor output Schema

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

One item per search term (or per comparison group).

## `stats` (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": [
        "bitcoin",
        "ethereum"
    ]
};

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

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

```

## MCP server setup

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