# Google Trends Scraper — Interest, Regions, Related Queries (`mojocakes/google-trends-scraper`) Actor

Extract Google Trends data reliably: interest over time, interest by region, related queries and rising topics for any keyword, geo and time range. One clean JSON item per keyword — predictable pricing, built-in retry and proxy rotation.

- **URL**: https://apify.com/mojocakes/google-trends-scraper.md
- **Developed by:** [James Cook](https://apify.com/mojocakes) (community)
- **Categories:** SEO tools, Automation, News
- **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 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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 — Interest, Regions, Related Queries

Extract **Google Trends data reliably** for any keyword — interest over time, interest by region, and related queries/topics (top and rising) — as one clean JSON item per keyword. Built-in session rotation and automatic escalation to residential proxies on rate-limiting mean predictable, low-failure runs.

### What it does

- Interest over time (daily/weekly index, 0–100 scale) with computed average and peak
- Interest by region (city/subregion breakdown, filtered to regions with real data)
- Related queries and related topics, split into top and rising
- Any geography (worldwide, country, or region code like `GB-ENG`) and time range (past hour to 2004–present)
- Optional narrowing by Trends category or search surface (Web, Image, News, YouTube, Shopping)
- Each part (timeseries / region / related) can be switched off independently to keep runs fast and cheap

### Output example

```json
{
  "keyword": "heat pump",
  "geo": "GB",
  "timeRange": "today 12-m",
  "averageInterest": 66.9,
  "peakDate": "2026-01-14",
  "peakValue": 100,
  "interestOverTime": [
    { "date": "2026-01-01", "formatted": "Jan 1", "value": 42 }
  ],
  "interestByRegion": [
    { "region": "England", "code": "GB-ENG", "value": 80 }
  ],
  "relatedQueries": {
    "top": [{ "term": "heat pump grant", "value": 100, "formattedValue": "100" }],
    "rising": [{ "term": "heat pump cost", "value": 250, "formattedValue": "Breakout" }]
  },
  "risingQueriesCount": 12,
  "topQueriesCount": 25
}
```

### Typical uses

- **Market research** — track demand for products, topics or brands over time and by region
- **SEO and content planning** — find rising related queries before competitors do
- **Trend monitoring** — compare multiple keywords' trajectories across geographies
- **AI pipelines** — feed structured trend data into forecasting, reporting, or agent workflows

### Notes

- One dataset item per keyword — batch as many keywords as you like in a single run
- Automatic proxy escalation: starts on standard proxies, switches to residential automatically if Google starts rate-limiting, so most runs need no manual proxy configuration
- Only publicly available Google Trends data is collected

# Actor input Schema

## `keywords` (type: `array`):

Search terms to get Google Trends data for. Each keyword produces one result item.

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

Two-letter country code (e.g. `US`, `GB`, `DE`), a region code like `GB-ENG`, or empty for worldwide.

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

Google Trends time range.

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

Google Trends category ID to narrow results (0 = all categories). See Google Trends URL `cat=` parameter for IDs.

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

Which Google property to measure.

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

Include the interest-over-time series (0–100 index per time bucket).

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

Include the interest-by-region breakdown.

## `includeRelated` (type: `boolean`):

Include related queries and related topics (top + rising).

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

Proxy settings. Automatic proxy with rotation handles Google's rate limits; the actor escalates to residential automatically if needed.

## Actor input object example

```json
{
  "keywords": [
    "heat pump"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelated": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Google Trends data for each requested keyword.

# 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 = {
    "keywords": [
        "heat pump"
    ]
};

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

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

```

## MCP server setup

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