# Google Trends Scraper: Interest, Regions & Related Queries (`spellzcode/google-trends`) Actor

Get Google Trends data for any keyword: interest over time, interest by country or region, and top and rising related queries and topics. Compare up to 5 keywords, any country, web, YouTube, news, images or shopping search. Pay per keyword report.

- **URL**: https://apify.com/spellzcode/google-trends.md
- **Developed by:** [Mårten Fitzback](https://apify.com/spellzcode) (community)
- **Categories:** SEO tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 keyword reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: Interest, Regions & Related Queries

Get Google Trends data for any list of keywords, in a format you can use straight away:

- **Interest over time**: every point of the trend line (0 to 100), plus average, peak, peak date and latest value
- **Interest by region**: countries for worldwide searches, or states and regions within a country
- **Related queries**: top and rising searches people make around each keyword

Any country or region, any period from the past hour to 2004, and web, image, news, YouTube or Google Shopping search. Compare up to 5 keywords on one scale, exactly as the Google Trends website does.

**You pay per keyword report.** Keywords Google has no data for cost nothing.

### Output

One item per keyword:

```json
{
  "keyword": "chatgpt",
  "comparedWith": ["claude"],
  "geo": "US",
  "timeRange": "today 3-m",
  "average": 61.4,
  "peak": 100,
  "peakDate": "2026-09-02T00:00:00.000Z",
  "latest": 53,
  "interestOverTime": [{ "date": "2026-07-17T00:00:00.000Z", "value": 58, "partial": false }],
  "interestByRegion": [{ "region": "California", "regionCode": "US-CA", "value": 100 }],
  "relatedQueries": { "top": [{ "query": "chatgpt login", "value": 76 }], "rising": [{ "query": "chatgpt 6", "formattedValue": "+4,500%" }] },
  "relatedTopics": null
}
```

The table view shows the summary; download JSON for the full series.

### Input

```json
{
  "keywords": ["chatgpt", "claude", "gemini"],
  "compareKeywords": true,
  "geo": "US",
  "timeRange": "past-90-days",
  "searchType": "web"
}
```

### Typical uses

- **Content and SEO planning:** find rising related searches before competitors write about them.
- **Product and market research:** compare brands or product names by country and season.
- **Investing and trading research:** track search interest in companies, tickers and crypto assets.
- **E-commerce:** use Google Shopping interest to time stock and promotions.
- **Dashboards and AI agents:** schedule it and feed the numbers into reports.

### Pricing

$2.00 per 1,000 keyword reports ($0.002 each), including the time series, regions and related queries.

50 keywords cost $0.10. Apify's paid plans get 10% to 30% off; the Pricing tab shows yours. Each run also has Apify's standard start charge of $0.00005.

### Good to know

- Google Trends numbers are relative (100 = the highest point in the chosen period and place), not search counts.
- Google limits how fast its Trends data can be read. The tool paces itself and retries, so large lists take a little longer; keywords that still fail are listed in the run's `FAILED_KEYWORDS` record and are not charged.
- Very rare keywords may have too little data for Google to show.
- Related topics: Google currently returns this list empty for nearly all automated requests, so the option is off by default. You can switch it on; if Google sends nothing, the field stays empty and the price is the same.

### Questions

#### Can I run it on a schedule?

Yes. Save your input as a task and add an Apify schedule, for example weekly.

#### How do I get the results into Excel or Google Sheets?

Download the results as Excel, CSV or JSON from the Output tab, or connect Apify to Make, Zapier, n8n or Google Sheets.

#### Something looks wrong

Open a report under the Issues tab with the input you used.

# Actor input Schema

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

One search term per line.

## `compareKeywords` (type: `boolean`):

On: keywords are compared in groups of up to 5, as in the Google Trends website, so the numbers are relative to each other. Off: each keyword gets its own 0-100 scale.

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

Two-letter country code such as US, GB, DE, SE, or a region code such as US-CA. Leave empty for worldwide.

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

Pick a preset, or type a custom range as YYYY-MM-DD YYYY-MM-DD.

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

Which Google search the interest is measured in.

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

Optional Google Trends category number, for example 5 for Computers & Electronics. 0 means all categories.

## `includeRegions` (type: `boolean`):

Countries for worldwide searches, or regions within the chosen country.

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

Top and rising searches related to each keyword.

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

Top and rising topics related to each keyword, when Google provides them. Google currently returns this list empty for most requests, so it is off by default.

## Actor input object example

```json
{
  "keywords": [
    "chatgpt",
    "claude"
  ],
  "compareKeywords": false,
  "geo": "",
  "timeRange": "past-12-months",
  "searchType": "web",
  "category": 0,
  "includeRegions": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": false
}
```

# Actor output Schema

## `reports` (type: `string`):

One item per keyword: summary numbers, interest over time, by region, and related queries.

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

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

```

## MCP server setup

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