# Google Trends Scraper (`flash_kpi/google-trends-scraper`) Actor

Scrape Google Trends for any keywords: interest over time, interest by region, related queries and topics, plus Trending Now searches by country. Automatic proxy fallback avoids rate limits.

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

## Pricing

$1.50 / 1,000 search term results

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

Get Google Trends data as clean JSON: **interest over time**, **interest by region**, **related queries**, **related topics**, term **comparison**, and the current **Trending Now** list for any country.

HTTP-only (no browser), so it is fast and cheap to run. Google Trends rate-limits aggressively — the scraper retries with back-off, renews its session, and switches to Apify Proxy on its own when needed, so a run does not die on the first `429`.

### What you get

One result per search term (or per comparison group):

```json
{
  "searchTerm": "bitcoin",
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "timeline": [
    { "date": "Oct 5 – 11, 2025", "timestamp": "2025-10-05T00:00:00Z", "value": 61, "isPartial": false }
  ],
  "regions": [
    { "geoCode": "US-NV", "geoName": "Nevada", "value": 100 }
  ],
  "regionResolution": "REGION",
  "relatedQueries": {
    "top":    [{ "query": "bitcoin price", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=bitcoin+price..." }],
    "rising": [{ "query": "...", "value": 4950, "formattedValue": "+4,950%", "link": "..." }]
  },
  "relatedTopics": {
    "top":    [{ "title": "Bitcoin", "type": "Cryptocurrency", "mid": "/m/05p0rrx", "value": 100, "formattedValue": "100", "link": "..." }],
    "rising": []
  },
  "scrapedAt": "2026-10-08T12:00:00+00:00"
}
```

With **Compare terms** on, terms are grouped by up to 5 (Google's limit) and share one 0–100 scale: `timeline[].values` and `regions[].values` become objects keyed by term, `averages` holds the average for each term, and `relatedQueries` is keyed by term (Google does not provide related topics in comparison mode).

If Google returned only part of the blocks, the result has a `missing` array listing the blocks that could not be fetched.

**Trending Now** results (one per trend):

```json
{
  "type": "trendingNow", "geo": "US", "position": 1, "title": "cnbc",
  "approxTraffic": "1000+", "approxTrafficNumber": 1000, "startedAt": "2026-10-08T10:50:00Z",
  "news": [{ "title": "...", "url": "https://...", "source": "CNBC", "picture": "https://..." }],
  "exploreUrl": "https://trends.google.com/trends/explore?q=cnbc&geo=US&date=now%201-d"
}
```

### Input

| Field | Description |
|---|---|
| `searchTerms` | Keywords, one result each |
| `compare` | Compare terms on one scale, in groups of up to 5 |
| `geo` | `US`, `GB`, `US-CA` ... empty = worldwide |
| `timeRange` | Past hour … past 5 years, or 2004–present |
| `customTimeRange` | `2024-01-01 2024-12-31` (overrides `timeRange`) |
| `property` | `web`, `images`, `news`, `youtube`, `froogle` (Shopping) |
| `category` | Google Trends category ID, `0` = all |
| `interestOverTime`, `interestByRegion`, `relatedQueries`, `relatedTopics` | Which blocks to extract |
| `regionResolution` | `COUNTRY`, `REGION`, `CITY`, `DMA` |
| `trendingNowCountries` | Country codes for the Trending Now list |
| `proxyConfiguration` | Optional — the scraper picks a proxy itself when Google blocks |

### Notes

- Values are Google's relative 0–100 index, not absolute search volume.
- Hourly ranges (`now 1-H`, `now 1-d`, `now 7-d`) return minute/hour-level points.
- You are charged only for results actually delivered.

# Actor input Schema

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

Keywords to look up on Google Trends, one per line. Each term gives one result, unless "Compare terms" is on.

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

Compare the terms against each other on one 0–100 scale, like the comparison chart on Google Trends. Terms are compared in groups of up to 5 (Google's limit); each group gives one result.

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

Country or region code as used by Google Trends: US, GB, DE, US-CA, GB-ENG ... Leave empty for worldwide.

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

Period of the data.

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

Overrides "Time range". Two dates separated by a space: "2024-01-01 2024-12-31". Hourly precision is also supported: "2026-01-01T00 2026-01-03T00".

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

Which Google property the interest is measured on.

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

Google Trends category number (0 = all categories, 7 = Finance, 3 = Arts & Entertainment ...).

## `interestOverTime` (type: `boolean`):

The timeline chart: a 0–100 value for every point of the period.

## `interestByRegion` (type: `boolean`):

The map: a 0–100 value for every country / region / city.

## `regionResolution` (type: `string`):

Level of detail of "Interest by region". Auto = countries for worldwide, regions for a country.

## `includeLowVolumeRegions` (type: `boolean`):

Also return regions with little search volume.

## `relatedQueries` (type: `boolean`):

Top and rising related search queries.

## `relatedTopics` (type: `boolean`):

Top and rising related topics.

## `trendingNowCountries` (type: `array`):

Optional separate mode: country codes (US, GB, DE, IN ...) to get the current Trending Now list for — title, approximate traffic and related news. One result per trend. Can be used with or without search terms.

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

Interface language (hl) — affects names of regions and topics, e.g. en-US, de, es.

## `timezoneOffset` (type: `integer`):

Offset from UTC in minutes for hourly data, e.g. -300 for New York, 60 for Berlin. 0 = UTC.

## `proxyConfiguration` (type: `object`):

Optional. The scraper retries rate-limited requests itself and switches to Apify Proxy automatically if Google keeps blocking.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compare": false,
  "geo": "",
  "timeRange": "today 12-m",
  "property": "web",
  "category": 0,
  "interestOverTime": true,
  "interestByRegion": true,
  "regionResolution": "",
  "includeLowVolumeRegions": false,
  "relatedQueries": true,
  "relatedTopics": true,
  "language": "en-US",
  "timezoneOffset": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per search term (or per Trending Now entry).

# 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": [
        "bitcoin",
        "ethereum"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("flash_kpi/google-trends-scraper").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": [
        "bitcoin",
        "ethereum",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("flash_kpi/google-trends-scraper").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": [
    "bitcoin",
    "ethereum"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call flash_kpi/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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

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/0akP4cC7zQKpMCaLy/builds/miYHhe6lSDzvjQdld/openapi.json
