# Google Trends API: Over Time, by Region, Related & Trending (`sauliusautomatesit/google-trends-api`) Actor

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

## Pricing

from $1.28 / 1,000 keyword with data

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 API: Over Time, by Region, Related & Trending

Get Google Trends data for hundreds or thousands of keywords in one run, as clean JSON, CSV or Excel. No Google account, no pytrends, no 429 errors to babysit.

For each keyword you get:

- **Interest over time**: the 0-100 curve Google Trends shows, with dates, for any period from the past hour to 2004.
- **Interest by region**: countries, states, cities or US metro areas, ranked.
- **Related queries**: top and rising searches, including "Breakout" terms.

Two more modes:

- **Compare keywords on one scale**: Google only compares 5 terms at a time and rescales every chart to its own peak, so numbers from separate charts can't be compared. This mode chains any number of keywords through a shared anchor term and returns every keyword on one 0-100 scale.
- **Trending now**: today's trending searches per country, with approximate search counts and the news stories behind them.

### Why use it

- **Bulk by default.** Paste up to 5,000 keywords. In our test, 1,000 keywords finished in 38 minutes with none failed. Runs keep going through rate limits by rotating warmed-up proxy sessions, with a residential fallback included in the price.
- **Every filter Google Trends has.** Country or region, preset or custom time range, category, and web, image, news, Google Shopping or YouTube search.
- **Pay only for complete data.** Keywords Google has no data for are delivered with `hasData: false` and are never charged. If one of the data types you asked for can't be fetched, the report is delivered with an `errors` field and is not charged. Failed keywords are not delivered and not charged.
- **Works as an API.** Call it from Python, JavaScript, Make, Zapier, n8n or any HTTP client, or let an AI agent call it through the Apify MCP server.

### What it's used for

- SEO and content planning: find rising queries before they get competitive.
- Product research and e-commerce: compare demand for hundreds of products across states or seasons.
- Market and investment research: track brand or category interest over 5 years.
- Newsrooms and social teams: pull trending searches every hour per country.
- Replacing pytrends in existing scripts: same data, no blocks.

### Input

| Field | What it does | Default |
|---|---|---|
| `mode` | `keywordReport`, `compare` or `trendingNow` | `keywordReport` |
| `keywords` | Keywords or phrases, one per line, up to 5,000 | |
| `geo` | `US`, `GB`, `US-CA`... or empty for worldwide | `US` |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all` | `today 12-m` |
| `customTimeRange` | `"YYYY-MM-DD YYYY-MM-DD"`, overrides `timeRange` | |
| `property` | `web`, `images`, `news`, `shopping`, `youtube` | `web` |
| `category` | Google Trends category number (0 = all) | `0` |
| `dataTypes` | Any of `interestOverTime`, `interestByRegion`, `relatedQueries` | all three |
| `resolution` | `auto`, `COUNTRY`, `REGION`, `CITY`, `DMA` | `auto` |
| `maxRelated` | Related queries kept per list (top and rising) | `25` |
| `anchorKeyword` | Compare mode: the term repeated in every batch | first keyword |
| `trendingGeos` | Trending now mode: country codes | `geo` |

Example:

```json
{
  "keywords": ["electric bike", "air fryer", "pickleball"],
  "geo": "US",
  "timeRange": "today 5-y"
}
```

### Output

One item per keyword:

```json
{
  "type": "keywordReport",
  "keyword": "electric bike",
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "averageInterest": 61.4,
  "interestOverTime": [
    { "date": "2025-10-05T00:00:00.000Z", "timestamp": 1759622400, "value": 54, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "US-CA", "geoName": "California", "value": 100 }
  ],
  "relatedQueries": {
    "top": [{ "query": "best electric bike", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "electric bike tax credit", "value": 3250, "formattedValue": "+3,250%" }]
  },
  "hasData": true,
  "checkedAt": "2026-10-02T13:00:00.000Z"
}
```

Compare mode returns `type: "comparison"` items with `interestOverTime` on the shared scale and the `anchorKeyword` used. Trending now returns `type: "trendingSearch"` items with `title`, `approxTraffic`, `publishedAt`, `picture` and `news`.

The run summary (keywords delivered, without data, failed) is saved as `OUTPUT` in the run's key-value store.

### Pricing

Pay per result, no subscription:

| Event | Price |
|---|---|
| Keyword report or comparison with data | $0.0015 per keyword ($1.50 per 1,000) |
| Trending search item | $0.0005 per item |
| Actor start | $0.00005 per run |

All data types for a keyword are one charge. Keywords without data and incomplete reports are free. Set **Maximum cost per run** in the run options and the run stops cleanly when it is reached.

### Good to know

- Values are Google's relative 0-100 index, not absolute search counts. For monthly search volume use a keyword volume tool alongside this one.
- In keyword report mode each keyword is scaled on its own. To compare keywords against each other, use compare mode.
- In compare mode pick an anchor with steady, middling interest. Keywords that can't be scaled because the anchor had no data in their batch are listed in the run summary.
- Very rare keywords often have no data in Google Trends; they come back free with `hasData: false`.
- Google Trends data is public. This Actor reads only what Google shows any visitor to trends.google.com.

### Support

Found a problem or need a field added? Open an issue on the Actor's Issues tab and it will be answered.

# Actor input Schema

## `mode` (type: `string`):

Keyword report: interest over time, by region and related queries for each keyword on its own. Compare: interest over time for all your keywords on one shared 0-100 scale (any number of keywords). Trending now: today's trending searches per country.

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

One keyword or phrase per line, up to 5,000 per run. Not used in Trending now mode.

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

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

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

Period to cover. Short ranges give hourly or minute points; 5 years and all-time give weekly or monthly points.

## `customTimeRange` (type: `string`):

Overrides Time range. Format: "YYYY-MM-DD YYYY-MM-DD", e.g. "2025-01-01 2025-12-31".

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

Which Google search to measure.

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

Google Trends category number, 0 for all categories. Examples: 7 Finance, 18 Shopping, 45 Health, 71 Food & Drink.

## `dataTypes` (type: `array`):

Keyword report mode only. Fewer data types make runs faster; the price per keyword is the same.

## `resolution` (type: `string`):

Level of interest by region. Automatic means countries for worldwide and regions (states) for a country. Metro (DMA) is US only.

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

Per list (top and rising) per keyword.

## `anchorKeyword` (type: `string`):

Compare mode: the keyword repeated in every batch of 5 to put all keywords on one scale. Pick a steady, mid-popularity term. Defaults to your first keyword.

## `trendingGeos` (type: `array`):

Two-letter country codes, one per line. Defaults to the Country field.

## `maxConcurrency` (type: `integer`):

Keywords fetched in parallel. Higher is faster but more likely to hit Google's rate limits.

## `allowResidential` (type: `boolean`):

When datacenter IPs are rate-limited, retry through residential proxies. Included in the price.

## Actor input object example

```json
{
  "mode": "keywordReport",
  "keywords": [
    "electric bike",
    "air fryer",
    "pickleball"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "property": "web",
  "category": 0,
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "resolution": "auto",
  "maxRelated": 25,
  "maxConcurrency": 3,
  "allowResidential": true
}
```

# Actor output Schema

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

One item per keyword or trending search. Download as JSON, CSV or Excel, or read it from this API endpoint.

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

Keywords requested, delivered, without data and failed.

# 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": [
        "electric bike",
        "air fryer",
        "pickleball"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sauliusautomatesit/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": [
        "electric bike",
        "air fryer",
        "pickleball",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("sauliusautomatesit/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": [
    "electric bike",
    "air fryer",
    "pickleball"
  ]
}' |
apify call sauliusautomatesit/google-trends-api --silent --output-dataset

```

## MCP server setup

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