# Google Trends Scraper (`clearrun/google-trends`) Actor

Interest over time, related and rising queries, and interest by region from Google Trends for any keywords, country, category and timeframe. Compare up to 5 keywords per request. Structured JSON, retries on rate limits, no browser.

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

## Pricing

$20.00 / 1,000 keyword 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?

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 over time, related and rising queries, and interest by region from Google Trends, as clean JSON.
Any keywords, any country, any timeframe, with automatic retries on Google's rate limits.

### What you get

```json
{
  "keyword": "web scraping",
  "geo": "GB",
  "timeframe": "today 12-m",
  "averageInterest": 63.4,
  "latestInterest": 71,
  "peakDate": "Mar 15, 2026",
  "peakInterest": 100,
  "pointsCount": 52,
  "interestOverTime": [{ "date": "Sep 15, 2025", "time": 1757894400, "value": 58, "isPartial": false }, ...],
  "relatedQueriesTop": [{ "query": "python web scraping", "value": 100 }, ...],
  "relatedQueriesRising": [{ "query": "ai web scraping", "value": 250, "formattedValue": "+250%" }, ...],
  "error": null
}
```

### Input

| Field | Default | Notes |
|---|---|---|
| `keywords` | — | One per line |
| `compare` | `false` | Put up to 5 keywords on the same 0–100 scale |
| `timeframe` | `today 12-m` | Past day to 2004–present, or a `customTimeframe` like `2025-01-01 2025-06-30` |
| `geo` | worldwide | ISO country (`US`, `GB`) or region (`US-CA`) |
| `category` | 0 | Google Trends category ID |
| `property` | web | `images`, `news`, `froogle` (Shopping) or `youtube` |
| `includeRelatedQueries` | `true` | Top and rising queries |
| `includeInterestByRegion` | `false` | Regional breakdown |
| `proxyConfiguration` | Apify residential | Trends blocks data-centre IPs; keep residential on |

### Pricing

Pay per keyword result delivered. Keywords Google has no data for are free and returned with an `error`.

#### Speed & cost

100 keywords cost about $2.00. This actor makes plain HTTP requests (no browser), so Apify platform usage is small —
typically $0.01–0.05 for 100 keywords, well under the $2.00 charged, leaving healthy margin even with retries on
Google's rate limits.

### Use from an AI agent

Available through the Apify MCP server: "Is interest in 'heat pumps' rising in the UK this year?"

### Support

Open an issue on the Issues tab with the keyword, geo, timeframe and run ID. Issues are answered within one working day.

# Actor input Schema

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

Search terms, one per line. Each keyword is fetched on its own; use Compare mode to put up to 5 on the same 0–100 scale.

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

When on, up to 5 keywords are requested together so their values are relative to each other.

## `timeframe` (type: `string`):

Google Trends timeframe string.

## `customTimeframe` (type: `string`):

Optional, overrides Timeframe, e.g. "2025-01-01 2025-06-30".

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

ISO country code such as US, GB, DE, or a region like US-CA. Leave empty for worldwide.

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

Google Trends category number (0 = all categories).

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

Web, image, news, shopping or YouTube search.

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

Fetch top and rising related queries.

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

Fetch the regional breakdown (countries worldwide, or sub-regions of the chosen country).

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

Google Trends rate-limits aggressively; residential proxies are used by default.

## Actor input object example

```json
{
  "keywords": [
    "apify",
    "web scraping"
  ],
  "compare": false,
  "timeframe": "today 12-m",
  "geo": "",
  "category": 0,
  "property": "",
  "includeRelatedQueries": true,
  "includeInterestByRegion": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One record per keyword: interest over time, related queries, interest by region

# 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": [
        "apify",
        "web scraping"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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