# Google Trends Scraper & API — Related Queries & Regions (`jesting_grass/google-trends-api`) Actor

Google Trends API: interest over time for up to 5 keywords, related queries (top, rising, Breakout), related topics and interest by region. Any country, since 2004, Web/YouTube/News/Shopping. No proxies or 429s to handle, failed lookups free. Pytrends alternative.

- **URL**: https://apify.com/jesting\_grass/google-trends-api.md
- **Developed by:** [A J](https://apify.com/jesting_grass) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 trends queries

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 & API — Related Queries & Regions

**Google Trends API** for developers, marketers and AI agents: get **interest over time**, **related queries (top + rising / Breakout)**, **related topics** and **interest by region** for any keyword, any country and any time range since 2004 — as clean JSON, every time.

Unlike scrapers that load the Google Trends website from your run and get blocked (HTTP 429, CAPTCHAs, empty runs), this Actor gets its data from commercial Google Trends data providers, so **you don't deal with blocks, proxies or 429s**. Failed lookups are **never charged**.

Works great as a **pytrends alternative**, for **Google Trends data** in Python / JavaScript / n8n / Make / Zapier, and as a tool for AI agents via the Apify MCP server.

### What data you get

| Data | Description |
|---|---|
| 📈 **Interest over time** | Daily / weekly / monthly values (0–100) for up to **5 keywords compared** in one query, plus average, peak, peak date and latest value |
| 🔍 **Related queries** | Top and **rising** related searches, including **"Breakout"** terms — the best source of new keyword ideas |
| 🧩 **Related topics** | Top and rising related topics (entities like brands, products, people) |
| 🗺️ **Interest by region** | Interest per state / region of the selected country, or per country worldwide |

Supports **Web search, YouTube search, News, Images and Google Shopping** trends — so you can also use it as a **Google Trends YouTube** tool.

### How to use the Google Trends API

1. Enter your **keywords** (e.g. `chatgpt`, `claude`, `gemini`).
2. Pick a **country** (or leave empty for worldwide) and a **time range**.
3. Optionally switch on **related queries**, **related topics** and **interest by region**.
4. Run it — or call it from code:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("jesting_grass/google-trends-api").call(run_input={
    "keywords": ["chatgpt", "claude", "gemini"],
    "location": "United States",
    "timeRange": "past_12_months",
    "includeRelatedQueries": True,
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["keyword"], row["averageInterest"], row["peakDate"])
```

More ready-to-run examples (Python, pandas DataFrame, Node.js, cURL, pytrends migration table): **[github.com/emiohr/google-trends-api](https://github.com/emiohr/google-trends-api)**

You only need your Apify API token — **no Google Trends API key**, no proxies, no pytrends breakage.

### Input

| Field | Description | Example |
|---|---|---|
| `keywords` | Search terms. Compared in groups of up to 5. | `["black friday", "cyber monday"]` |
| `location` | Country name, or empty for worldwide | `United States`, `Sweden` |
| `timeRange` | `past_hour` … `past_5_years` | `past_12_months` |
| `dateFrom` / `dateTo` | Custom range (YYYY-MM-DD), overrides `timeRange` | `2020-01-01` |
| `searchType` | `web`, `youtube`, `news`, `images`, `froogle` (Shopping) | `youtube` |
| `categoryCode` | Google Trends category id, 0 = all | `0` |
| `language` | Language code | `en` |
| `includeRelatedQueries` | Add top + rising related searches | `true` |
| `includeRelatedTopics` | Add top + rising related topics | `false` |
| `includeInterestByRegion` | Add interest by region | `true` |

### Output example

One row per keyword:

```json
{
  "keyword": "black friday",
  "group": ["singles day"],
  "location": "Sweden",
  "searchType": "web",
  "averageInterest": 7,
  "peakInterest": 100,
  "peakDate": "2025-11-23",
  "latestInterest": 3,
  "pointsCount": 53,
  "timeline": [{ "date": "2025-09-28", "value": 2, "partial": false }],
  "relatedQueries": {
    "top": [{ "query": "black friday 2025", "value": "100", "score": 100 }],
    "rising": [{ "query": "när är black friday 2026", "value": "Breakout", "score": 5000 }]
  },
  "relatedTopics": {
    "top": [{ "query": "Black Friday", "type": "Shopping", "value": "100", "score": 100 }],
    "rising": []
  },
  "interestByRegion": [
    { "region": "Stockholm County", "geoCode": "SE-AB", "value": 100 },
    { "region": "Västra Götaland County", "geoCode": "SE-O", "value": 90 }
  ],
  "googleTrendsUrl": "https://trends.google.com/trends/explore?..."
}
```

Export as JSON, CSV, Excel or HTML, or read it through the Apify API.

### Pricing

Pay per event — you only pay for data you actually get:

| Event | What it is |
|---|---|
| **Trends query** | One interest-over-time comparison of **up to 5 keywords**. Comparing 5 costs the same as 1 — batch your keywords. |
| **Related queries** | Top + rising related searches for one keyword (optional add-on) |
| **Related topics** | Top + rising related topics for one keyword (optional add-on) |
| **Interest by region** | Regional breakdown for one keyword (optional add-on) |

Exact prices are shown in the **Pricing** tab. Failed lookups are free, and the Actor stops cleanly at your maximum-charge limit.

### More SEO tools from the same developer

- [Backlink Checker](https://apify.com/jesting_grass/backlink-checker) — every backlink, referring domains and competitor link gap
- [Bulk Domain Authority & Backlink Checker](https://apify.com/jesting_grass/bulk-domain-authority-checker) — domain rank, referring domains and backlinks
- [Keyword Research Tool](https://apify.com/jesting_grass/keyword-research-tool) — search volume, difficulty, intent, AI Overviews and keyword ideas
- [Tech Stack Detector](https://apify.com/jesting_grass/tech-stack-detector) — CMS, ecommerce, analytics and payments behind any website

### FAQ

**Is there an official Google Trends API?**
Google announced one in 2025, but only as a limited alpha for selected testers. This Actor gives you Google Trends data through a simple API today, with no application or API key from Google.

**Is this a pytrends alternative?**
Yes. pytrends was **archived in April 2025** (no more fixes) and frequently breaks with `429 Too Many Requests` because it requests the Google Trends website directly from your IP. This Actor returns the same kind of data, from Python, JavaScript or any HTTP client.

**Why are values between 0 and 100?**
Google Trends values are relative: 100 is the peak popularity within the compared keywords, location and time range. Keywords in different groups are not directly comparable — add a shared "anchor" keyword to each group if you need one scale.

**Can I get YouTube, News or Shopping trends?**
Yes — set `searchType` to `youtube`, `news`, `images` or `froogle`.

**Can AI agents use it?**
Yes. Every Apify Actor is available as a tool through the Apify MCP server, and the output is compact, predictable JSON.

### Use cases

- **Keyword research & SEO** — find rising and Breakout queries before competitors
- **Content planning** — seasonality and timing for posts, videos and campaigns
- **Brand vs competitor tracking** — compare up to 5 brands in one query
- **E-commerce & product research** — Google Shopping and YouTube trends
- **Market research & investing** — regional demand and interest over time
- **AI agents & automation** — trend data in n8n, Make, Zapier and LLM pipelines

# Actor input Schema

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

Search terms to look up. Keywords are compared in groups of up to 5 (Google Trends values are relative within a group). Each group is one billed trends query.

## `location` (type: `string`):

Location name as Google uses it, e.g. 'United States', 'Sweden', 'United Kingdom'. Leave empty for worldwide.

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

Preset time range. Ignored if both 'Date from' and 'Date to' are set.

## `dateFrom` (type: `string`):

Custom start date, format YYYY-MM-DD (earliest 2004-01-01 for web search).

## `dateTo` (type: `string`):

Custom end date, format YYYY-MM-DD.

## `searchType` (type: `string`):

Which Google property to measure.

## `categoryCode` (type: `integer`):

Optional Google Trends category id (0 = all categories).

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

Language code, e.g. 'en', 'sv', 'de'.

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

Add the top and rising related searches for each keyword (keyword research, 'Breakout' terms). Billed per keyword as a separate add-on.

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

Add the top and rising related topics (entities) for each keyword. Billed per keyword as a separate add-on.

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

Add interest by sub-region (states / regions of the selected country, or countries when worldwide) for each keyword. Billed per keyword as a separate add-on.

## Actor input object example

```json
{
  "keywords": [
    "chatgpt",
    "claude",
    "gemini"
  ],
  "location": "United States",
  "timeRange": "past_12_months",
  "searchType": "web",
  "categoryCode": 0,
  "language": "en",
  "includeRelatedQueries": false,
  "includeRelatedTopics": false,
  "includeInterestByRegion": false
}
```

# Actor output Schema

## `results` (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 = {
    "keywords": [
        "chatgpt",
        "claude",
        "gemini"
    ]
};

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

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

```

## MCP server setup

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