# Google Trends Scraper: Compare Keywords, Regions & Trending (`p0l4r/google-trends-reliable`) Actor

Reliable Google Trends data for any keyword and country: interest over time, by region, related queries and trending searches. Compare up to 5 terms on one 0-100 scale, 50 queries per run. Compact JSON for AI agents. Empty results are never charged.

- **URL**: https://apify.com/p0l4r/google-trends-reliable.md
- **Developed by:** [P0L4R](https://apify.com/p0l4r) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 interest over times

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: compare keywords, regions and trending searches

**Use this Actor to get Google Trends interest over time, interest by region, related queries or today's trending searches for any keyword and country.** It works for people (Excel, Sheets), automations (API, Make, n8n, Zapier) and AI agents (Apify MCP).

Google does not offer a public Google Trends API, so this Actor works as one: send keywords and countries, get clean data back as flat rows (one row per data point) or compact JSON (one item per data block). Enter a term, press Start, and download the result as JSON, CSV, Excel or through the API.

### Why this Actor

- **Real comparisons.** Up to 5 terms in one query share the same 0-100 scale, so "coffee vs tea" is a fair comparison, not two unrelated curves.
- **Batches in one run.** Up to 50 queries (terms x countries) run in a single run with a single start fee.
- **All the keyword data.** Interest over time, interest by region and top and rising related queries, each one optional.
- **You don't pay for empty results.** Errors, empty answers, terms and regions Google has no data for are reported in their own rows or left out, and never charged. The only fixed cost is the small start fee of each run.
- **Checked every day.** An automated test runs the Actor against live Google Trends every morning, so changes on Google's side are caught and fixed early.

### What you can get

- **Interest over time** for 1 to 5 terms compared on the same 0-100 scale, in chronological order.
- **Interest by region** (subregions of a country, or countries when the search is worldwide), listing only regions Google has data for.
- **Related queries** (top and rising), optional.
- **Trending searches** for one or more countries: the top ~10 Google currently lists for each, with traffic estimate and the related news item.

Only public, aggregated Google Trends data is returned. No personal data is collected.

### Quick start

The minimal input is a single term. Everything else has a default (worldwide, last 12 months, interest over time only):

```json
{
  "searchTerms": ["coffee"]
}
```

#### Compare terms

Separate terms with commas inside one item to compare them on the same scale (1 to 5 terms per comparison):

```json
{
  "searchTerms": ["coffee, tea, matcha"],
  "geos": ["US"],
  "timeframe": "today 5-y"
}
```

#### Several countries

Every search term is crossed with every country or region code (for example `ES` or `US-CA`). Each combination is one query:

```json
{
  "searchTerms": ["electric car"],
  "geos": ["ES", "FR", "DE", "IT"],
  "timeframe": "today 12-m"
}
```

#### Regions and related queries

Switch on the extra blocks you need. Each block is charged only when it is delivered:

```json
{
  "searchTerms": ["running shoes"],
  "geos": ["US"],
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true
}
```

#### Trending searches

```json
{
  "mode": "trending",
  "trendingCountries": ["US", "ES", "GB"]
}
```

### Input

| Field | Default | Description |
|---|---|---|
| `mode` | `keyword` | `keyword` for interest data, `trending` for trending searches by country. |
| `searchTerms` | `["coffee"]` | One query per item. Use commas to compare up to 5 terms in one item. Topic IDs such as `/m/02rcjd0` are accepted as-is (there is no topic search). |
| `geos` | empty (worldwide) | Two-letter ISO country codes (`ES`, `US`, `GB` for the United Kingdom; `UK` is accepted as `GB`) or ISO region codes (`US-CA`, `ES-MD`). Crossed with every search term. |
| `timeframe` | `today 12-m` | A Google value (`now 7-d`, `today 1-m`, `today 12-m`, `today 5-y`, `all`) or a custom range `YYYY-MM-DD YYYY-MM-DD`. See *Time resolution* below. |
| `trendingCountries` | `["US"]` | Two-letter ISO country codes for Trending mode. Returns the current top ~10 trending searches per country; past dates are not available. |
| `category` | `0` | Google Trends category ID. 0 means all categories. |
| `includeInterestOverTime` | `true` | Time series of search interest. Turn it off if you only want regions or related queries: each block is charged separately. |
| `includeInterestByRegion` | `false` | Interest broken down by region: first-level regions for a country (for example Spanish autonomous communities or US states), countries for a worldwide query. |
| `includeRelatedQueries` | `false` | Top and rising related queries. |
| `outputFormat` | `rows` | `rows`: one item per data point, opens directly in Excel or Sheets. `compact`: one item per query and block with its points in a `rows` list; recommended for API, automation, AI agents and large runs. |

In keyword mode at least one data block must be selected.

#### Time resolution

Google chooses the spacing of `interestOverTime` points from the timeframe; you cannot pick it:

| Timeframe | Points |
|---|---|
| `now 7-d` | hourly |
| Up to about 9 months (`today 1-m`, `today 3-m`, short custom ranges) | daily |
| Up to 5 years (`today 12-m`, `today 5-y`) | weekly |
| Longer (`all`, long custom ranges) | monthly |

For day-by-day data, use a custom range shorter than about 9 months, for example `2025-11-01 2025-11-30`. Google Trends data starts in 2004, so `all` goes back to January 2004.

### Output

Every row has a `type` field. Rows are flat, so they open cleanly in CSV, Excel, Google Sheets or an AI agent.

All keyword rows (`interestOverTime`, `interestByRegion`, `relatedQuery`) also carry these common fields: `query` (the label of the query, for example `coffee, tea @ US`), `term`, `geo`, `timeframe` and `category`.

| `type` | Fields | Charged |
|---|---|---|
| `interestOverTime` | common fields, `date`, `value` (0-100), `isPartial`, `hasData` | Yes, see Pricing |
| `interestByRegion` | common fields, `regionCode`, `regionName`, `value` (0-100), `hasData` | Yes, see Pricing |
| `relatedQuery` | common fields, `relatedType` (`top` or `rising`), `relatedQuery`, `value`, `formattedValue` | Yes, see Pricing |
| `trending` | `country`, `rank`, `title`, `approxTraffic`, `publishedAt`, `newsTitle`, `newsUrl`, `newsSource` | Yes, once per country |
| `noData` | `query`, `block`, `message` | No |
| `error` | `query`, `block`, `message` | No |

Dates are ISO 8601 (`2026-03-01`; short ranges such as `now 7-d` include the time, in UTC). When several terms are compared, there is one row per term and date.

#### Understanding the values

- **Values are relative, not search counts.** Google Trends never publishes absolute volumes (for those, use keyword tools such as Google Ads Keyword Planner). Each `value` is the share of all searches in that place and time, rescaled so that **100 is the highest point in your query**. 50 means half the interest of that peak; 0 means very little (or no data, see `hasData`).
- **Terms in the same query share one scale.** With `"coffee, tea"`, 100 is the peak of either term, so `coffee 39` vs `tea 32` in the same week means coffee was searched about 1.2 times more.
- **Separate queries are not comparable in level.** `"coffee"` and `"tea"` as two separate items each get their own 100. Compare the shape of the curves, not the numbers. To compare more than 5 terms, repeat one anchor term in every query (for example `"coffee, tea, matcha, chai, water"` and `"coffee, latte, mocha, decaf, water"`) and rescale with it.
- **Changing the timeframe or country changes the values**, because the peak they are measured against changes.
- **Related queries:** `top` values are relative popularity (0-100). `rising` values are growth in % over the previous period; `formattedValue` "Breakout" means growth above 5000%. For a term that did not exist at the start of a long timeframe (for example `chatgpt` over 5 years), most rising queries are "Breakout".
- **Region names** (`regionName`) are in English; `regionCode` is the ISO code.
- **Trending `rank`** is the position in Google's trending list for that country (the order Google publishes it), not a ranking by traffic; use `approxTraffic` to compare volume. The news item is the one Google attaches to each trend.

`hasData` is Google's own flag: `false` means Google had too little data for that term, date or region, so its `value` (usually `0`) is not a real measurement. If Google flags every value of a block this way, you get a `noData` row instead and that block is not charged.

Example `interestOverTime` row:

```json
{
  "type": "interestOverTime",
  "query": "coffee",
  "term": "coffee",
  "geo": "",
  "timeframe": "today 12-m",
  "category": 0,
  "date": "2026-03-01",
  "value": 78,
  "isPartial": false,
  "hasData": true
}
```

Example `error` row:

```json
{
  "type": "error",
  "query": "coffee @ ES",
  "block": "interestOverTime",
  "message": "... You were not charged."
}
```

#### Compact output

With `"outputFormat": "compact"` each delivered block is one item with the same top-level fields every time (`type`, `query`, `geo`, `timeframe`, `category`, or `type`, `country` for trending) and its data points in `rows`:

```json
{
  "type": "interestOverTime",
  "query": "coffee @ ES",
  "geo": "ES",
  "timeframe": "today 12-m",
  "category": 0,
  "rows": [
    {"term": "coffee", "date": "2026-03-01", "value": 78, "isPartial": false, "hasData": true}
  ]
}
```

To turn compact data into the flat rows above, read the dataset with `unwind=rows` (for example `GET /v2/datasets/{id}/items?unwind=rows&format=csv`). `noData` and `error` rows look the same in both formats. Compact output is cheaper for long series (see Pricing).

In a comparison, a term for which Google has no data (too little search volume, or a typo) does not fill the output with zeros: it gets one `noData` row with its `term` and is not charged, while the other terms are delivered normally. If the request for one term fails, that term gets its own `error` row.

Nothing is dropped silently: every query that fails produces an `error` row with an explanation, and every valid but empty answer produces a `noData` row. The run status message summarizes how many queries had data, had no data or failed.

### Pricing

This Actor uses **pay-per-event** pricing. You are charged for:

- a small **per-run start fee**, and
- one event **per search term and data block** delivered with data (a comparison of 3 terms counts as 3), or per country in Trending mode. In the default flat output, long series count per **60 data points**: a year of weekly data (53 points) or up to 60 regions is 1 event, 5 years of weekly data (261 points) is 5. With `"outputFormat": "compact"` each term and block is always 1 event, whatever its length:
  - `interest-over-time`
  - `interest-by-region`
  - `related-queries`
  - `trending-list`

Example: `"searchTerms": ["coffee, tea"]` with the default timeframe (last 12 months), interest over time and related queries = 1 start fee + 2 `interest-over-time` + 2 `related-queries`. Related queries and trending lists are always 1 event per term or country.

**Errors and empty answers are never charged.** `error` and `noData` rows are free, a term or region for which Google had no data is not counted (regions without data are left out of the output), and you only pay for the blocks you asked for. If you only want interest over time, you do not pay for regions or related queries.

The start fee is charged when a run starts, before the input is checked, so a run with invalid input (for example 6 terms in one comparison) costs only that fee and returns a clear error message.

Up to 50 queries run in a single run with a single start fee, so large batches are cheaper here than running one keyword per run.

#### What a run costs

Totals for whole runs, with prices at the time of writing (the **Pricing** tab of this Actor always has the current ones). Apify plans Gold and above get a lower event price.

| Run | Events charged | Standard | Gold and above |
|---|---|---|---|
| `coffee`, last 12 months, interest over time | start + 1 | $0.003 | $0.0015 |
| `coffee, tea` with interest over time and related queries | start + 4 | $0.009 | $0.003 |
| 10 separate terms, interest over time | start + 10 | $0.021 | $0.006 |
| 50 queries with all 3 blocks, last 12 months | start + 150 | $0.301 | $0.076 |
| `coffee`, last 5 years (261 weekly points) | start + 5 | $0.011 | $0.0035 |
| Same, with `"outputFormat": "compact"` | start + 1 | $0.003 | $0.0015 |
| `coffee, tea, matcha`, last 5 years, compact | start + 3 | $0.007 | $0.0025 |
| Trending searches for 5 countries | start + 5 | $0.0085 | $0.0035 |

### Limits

- Up to **50 queries per run** (search terms multiplied by countries or regions). Queries are processed one after another.
- **1 to 5 terms** per comparison.
- Your **spending limit is respected**: before each query the Actor checks that the blocks you asked for can still be paid within your limit. When the limit is reached, the run stops there and the results delivered so far are kept in the dataset.
- A run stopped by the spending limit or by its timeout ends there; it does not continue later. Results delivered so far are kept.
- If the platform restarts a run automatically (for example after a server migration), completed queries are kept and are never charged twice. A query that was interrupted mid-way may need to be run again.
- If Google Trends keeps blocking a run (3 queries in a row fail completely), the remaining queries are skipped with an `error` row each, and you are not charged for them. Try again later.

### Known limitation: related queries

Google sometimes returns no related queries (especially the `rising` list) to automated requests, even for terms that show related queries in the browser. When this happens you get a `noData` row that explains it, and you are not charged for that block. Terms with very low search volume can also have no related queries.

### Use it as a Google Trends API

Start a run and get the rows back in one HTTP request (replace `<YOUR_APIFY_TOKEN>`):

```bash
curl -X POST "https://api.apify.com/v2/acts/p0l4r~google-trends-reliable/run-sync-get-dataset-items"   -H "Authorization: Bearer <YOUR_APIFY_TOKEN>"   -H "Content-Type: application/json"   -d '{"searchTerms": ["coffee, tea"], "geos": ["US"]}'
```

Python, with the `apify-client` package (version 3 or later):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("p0l4r/google-trends-reliable").call(
    run_input={"searchTerms": ["coffee, tea"], "geos": ["US"], "timeframe": "today 5-y"}
)
for row in client.dataset(run.default_dataset_id).iterate_items():
    if row["type"] == "interestOverTime":
        print(row["date"], row["term"], row["value"])
```

JavaScript, with the `apify-client` package:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('p0l4r/google-trends-reliable').call({
    mode: 'trending',
    trendingCountries: ['US', 'GB'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((row) => `${row.country} #${row.rank}: ${row.title}`));
```

### Use it from AI agents (MCP)

Claude, Cursor, VS Code and other MCP clients can call this Actor through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). To give an agent only this Actor:

```bash
claude mcp add --transport http google-trends "https://mcp.apify.com/?actors=p0l4r/google-trends-reliable"
```

Questions an agent can answer with it:

- "Compare interest in coffee and tea in Spain over the last year."
- "Which US states search the most for solar panels?"
- "What is trending in Mexico right now?"
- "How did searches for black friday evolve day by day in the UK in November 2025?"

Hints for agents:

- Put terms to compare in **one** item separated by commas (`"coffee, tea"`); separate items are not on the same scale.
- Use `"outputFormat": "compact"`: one item per data block, fewer items to page through.
- Turn off the blocks the question does not need (`includeInterestOverTime: false` for a region-only question); each block is charged.
- Answer with relative interest (0-100), not search counts.

### Other integrations

- **Zapier, Make and n8n:** trigger runs and use the output rows in your workflows.
- **Google Sheets:** export the dataset to a spreadsheet with the Apify integration.
- **Schedules:** run the Actor daily or weekly to track a keyword over time; each run is kept, so you build your own history.

### Typical uses

- SEO and content planning: find rising topics and compare keywords.
- Product research and e-commerce: spot seasonality and regional demand.
- Dashboards and alerts: schedule runs and feed the data to a sheet or BI tool.
- AI agents that need current search interest.

# Actor input Schema

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

Keyword: interest data for your search terms. Trending: today's trending searches by country.

## `searchTerms` (type: `array`):

Keyword mode only. Each item is one query. Separate terms with commas to compare up to 5 (for example "coffee, tea"): terms in one item share the same 0-100 scale; separate items each have their own 100 and are not comparable in level. Values are relative interest (100 = peak of the query), not search counts. Topic IDs such as /m/02rcjd0 are accepted. Max 50 queries per run after crossing with regions.

## `geos` (type: `array`):

Keyword mode only. Two-letter ISO country codes (ES, US, GB for the United Kingdom) or ISO region codes (US-CA, ES-MD). Each one is crossed with every search term. Leave empty for worldwide.

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

Keyword mode only. A Google value (now 7-d, today 1-m, today 12-m, today 5-y, all) or a custom range as "YYYY-MM-DD YYYY-MM-DD". Google picks the detail: hourly for now 7-d, daily for ranges up to about 9 months, weekly up to 5 years, monthly beyond.

## `trendingCountries` (type: `array`):

Trending mode only. Two-letter ISO country codes (US, MX, GB). Returns the current top ~10 trending searches per country in Google's list order (rank), with approximate traffic; past dates are not available.

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

Keyword mode only. Google Trends category ID. 0 means all categories.

## `includeInterestOverTime` (type: `boolean`):

Keyword mode only. Time series of search interest. Each block is charged separately: turn this off if you only need regions or related queries.

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

Keyword mode only. Search interest broken down by region: first-level regions for a country (e.g. Spanish autonomous communities, US states), countries for worldwide. Region names are in English.

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

Keyword mode only. Top queries (relative popularity 0-100) and rising queries (growth %; "Breakout" = more than 5000%).

## `outputFormat` (type: `string`):

Rows: one dataset item per date, region or related query (opens directly in Excel or Sheets). Compact: one item per query and data block with its points in a "rows" list; 1 event per term and block whatever the series length, best for API, automation, AI agents and long timeframes. Export compact data as a flat table with unwind=rows.

## Actor input object example

```json
{
  "mode": "keyword",
  "searchTerms": [
    "coffee"
  ],
  "geos": [],
  "timeframe": "today 12-m",
  "trendingCountries": [
    "US"
  ],
  "category": 0,
  "includeInterestOverTime": true,
  "includeInterestByRegion": false,
  "includeRelatedQueries": false,
  "outputFormat": "rows"
}
```

# Actor output Schema

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

All rows (or compact blocks) in the default dataset.

# 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 = {
    "searchTerms": [
        "coffee"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("p0l4r/google-trends-reliable").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 = { "searchTerms": ["coffee"] }

# Run the Actor and wait for it to finish
run = client.actor("p0l4r/google-trends-reliable").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 '{
  "searchTerms": [
    "coffee"
  ]
}' |
apify call p0l4r/google-trends-reliable --silent --output-dataset

```

## MCP server setup

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

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/2hQXNbwCjcXD8hZLV/builds/KLrnzThy1Gf33ghMr/openapi.json
