# Google Trends API: Interest, Regions, Related Queries (`catalyst-labs/google-trends-api`) Actor

Google Trends as clean JSON for agents: interest over time, by region, related and rising queries, plus a ready trend summary (peak, average, % change, rising/falling). $0.0025 per keyword; rate-limited or failed keywords never charged. Honest RATE_LIMITED errors.

- **URL**: https://apify.com/catalyst-labs/google-trends-api.md
- **Developed by:** [Catalyst Labs](https://apify.com/catalyst-labs) (community)
- **Categories:** AI, SEO tools, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 keywords

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?

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 API: interest over time, by region, related queries and topics

### Why agents pick this

- **$0.0025 per keyword**, with all sections included. Comparing 3 keywords costs $0.0085. Rate-limited or failed keywords are never charged.
- **The summary is already computed:** latest, peak, peak date, average, % change and a rising, falling or flat call. Your agent doesn't have to do math over 52 data points.
- **Honest errors.** Google rate-limits Trends hard. When retries across IPs run out, you get `RATE_LIMITED` on that keyword, not an empty array that looks like zero interest.
- **Every row links its `sourceUrl`** on Google Trends, so the agent can cite it.

**What it does:** for up to 25 keywords, returns Google Trends data as flat JSON, one row per keyword: `interestOverTime` points, a ready-made `summary` (latest, peak, peak date, average, % change, rising/falling/flat), `interestByRegion`, and `relatedQueries` / `relatedTopics` (top and rising). Every row has `status`, `sourceUrl` (the matching Google Trends page) and, on failure, `errorCode` + `errorMessage`.

**Use it when** an agent needs to: check whether interest in a topic is rising, compare brands or products, find where a term is popular, or discover rising related searches for content and SEO ideas.

**Don't use it for:** absolute search volumes (Trends gives relative 0-100 values only), keyword CPC/volume data, or real-time "trending now" lists.

### Cost per call

| Event | Price | When |
|---|---|---|
| `keyword` | $0.0025 | per keyword returned with data (all requested sections included) |
| `actor-start` | $0.001 | once per batch run (not charged in Standby/HTTP mode) |

Comparing 3 keywords = **$0.0085**. Rate-limited or failed keywords are **never charged**.

### Rate limits (honest)

Google Trends rate-limits automated traffic hard (HTTP 429). This Actor retries with backoff and rotates IPs (direct, then Apify datacenter, then residential proxy) up to 10 times per request. Most calls finish in 5-20 s. If Google still refuses, you get `status: "error"`, `errorCode: "RATE_LIMITED"` and nothing is charged; retry after a few minutes. `requestAttempts` and `ipTiersUsed` in `OUTPUT` show what happened.

### Input (only `keywords` is required)

```json
{ "keywords": ["chatgpt", "claude", "gemini ai"], "geo": "US", "timeRange": "90d" }
```

| Field | Default | Notes |
|---|---|---|
| `keywords` | – | Up to 25. |
| `geo` | worldwide | `US`, `GB`, `US-IA`, ... |
| `timeRange` | `12m` | `1h`, `4h`, `1d`, `7d`, `30d`, `90d`, `12m`, `5y`, `all`, or `"YYYY-MM-DD YYYY-MM-DD"`. |
| `sections` | all three | `timeline`, `regions`, `related`. |
| `outputMode` | `full` | `summary` drops the timeline points (saves tokens). |
| `compare` | true | Shared 0-100 scale per group of 5 keywords. |
| `property` | `web` | `youtube`, `news`, `images`, `shopping`. |
| `category` | 0 | Trends category ID. |
| `maxRegions` / `maxRelated` | 15 / 10 | List lengths. |

### Output

```json
{
  "status": "ok", "keyword": "claude", "geo": "US", "timeRange": "90d", "property": "web",
  "comparedWith": ["chatgpt", "gemini ai"],
  "summary": { "points": 93, "latest": 14, "peak": 25, "peakDate": "2026-10-14", "average": 17.6, "changePct": 17.6, "trend": "rising" },
  "interestOverTime": [{ "date": "2026-07-26", "value": 15 }],
  "interestByRegion": [{ "region": "District of Columbia", "code": "US-DC", "value": 32 }],
  "relatedQueries": { "top": [{ "query": "claude code", "value": 51, "formattedValue": "51" }], "rising": [{ "query": "claude opus", "value": 3000, "formattedValue": "+3,000%" }] },
  "relatedTopics": { "top": [{ "title": "Claude", "type": "Chatbot", "mid": "/g/...", "value": 100, "formattedValue": "100" }], "rising": [] },
  "isPartial": true, "sourceUrl": "https://trends.google.com/trends/explore?q=chatgpt%2Cclaude%2Cgemini+ai&geo=US&date=today+3-m&hl=en-US",
  "fetchedAt": "2026-10-25T05:00:00.000Z", "errorCode": null, "errorMessage": null
}
```

`changePct` compares the average of the last quarter of the window with the first quarter. Rising related values are % growth; `"Breakout"` means more than +5000%.

### Fast calls: Standby (HTTP) mode

```bash
curl "https://catalyst-labs--google-trends-api.apify.actor/?keywords=chatgpt,claude&geo=US&outputMode=summary&token=$APIFY_TOKEN"
```

### Use from MCP

`https://mcp.apify.com/?tools=catalyst-labs/google-trends-api` → tool `catalyst-labs--google-trends-api`.

Data comes from Google Trends' public pages; no login, no personal data. Not affiliated with Google.

Made by Catalyst Labs. Also see: Agent Web Reader, Document to Markdown, YouTube Transcript API.

# Actor input Schema

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

Search terms (max 25). With compare on, each group of up to 5 is fetched together so values are on one shared 0-100 scale.

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

Country or region code, e.g. `US`, `GB`, `US-IA`. Empty = worldwide.

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

Window: 1h, 4h, 1d, 7d, 30d, 90d, 12m (default), 5y, all (2004-). Custom: "YYYY-MM-DD YYYY-MM-DD" via API.

## `sections` (type: `array`):

What to fetch: `timeline` (interest over time + summary), `regions` (interest by region), `related` (related queries and topics, top and rising). Fewer sections = faster.

## `outputMode` (type: `string`):

`full` includes every timeline point; `summary` drops the points and keeps latest/peak/average/changePct/trend to save tokens. Same price.

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

On: keywords share one 0-100 scale (Google's comparison mode, groups of 5). Off: each keyword is scaled on its own.

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

Which Google search to measure. Default web.

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

Google Trends category ID (0 = all categories).

## `maxRegions` (type: `integer`):

Top regions to return per keyword. Default 15.

## `maxRelated` (type: `integer`):

Items per related list (top and rising, queries and topics). Default 10.

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

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

## Actor input object example

```json
{
  "keywords": [
    "chatgpt",
    "claude"
  ],
  "timeRange": "12m",
  "sections": [
    "timeline",
    "regions",
    "related"
  ],
  "outputMode": "full",
  "compare": true,
  "property": "web",
  "category": 0,
  "maxRegions": 15,
  "maxRelated": 10,
  "language": "en-US"
}
```

# Actor output Schema

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

One row per keyword: summary, interestOverTime, interestByRegion, relatedQueries, relatedTopics, status, errorCode.

## `summary` (type: `string`):

okCount, errorCount, requestAttempts, ipTiersUsed, chargedEvents and all rows.

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

// Run the Actor and wait for it to finish
const run = await client.actor("catalyst-labs/google-trends-api").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": [
        "chatgpt",
        "claude",
    ] }

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

```

## MCP server setup

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

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/Je2LAuYgQZoPaJBN7/builds/Yqg6ZdSUsU1UtrvBa/openapi.json
