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

Google Trends interest over time, by region, related queries and topics, plus Trending now. Up to 5 terms per comparison, retries on 429, no start fee.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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: Interest Over Time, Regions, Related Queries, Trending Now

Get **Google Trends** data as clean JSON, without a Google account or API key: **interest over time, interest by region, related queries, related topics and Trending now**. Compare up to 5 keywords at once across Web, YouTube, News, Images or Shopping search. Use it as a **Google Trends API** from your code, a spreadsheet, a notebook or an AI agent over MCP.

The Actor uses the same public JSON endpoints that trends.google.com uses. No browser.

### What can this Google Trends scraper do?

- **Interest over time**: the full 0-100 timeline per term, plus `average`, `peakValue`, `peakDate` and `latestValue`
- **Interest by region**: countries, regions or cities, depending on the `geo` you choose
- **Related queries and related topics**: the "Top" and "Rising" lists, with Breakout flags
- **Trending now** (beta): today's trending searches per country, with search volume, growth, related queries, categories and news links
- **Keyword comparison**: up to 5 terms on one shared scale, like the Trends UI; longer lists are split into groups of 5
- **Every Trends filter**: geo, time range (`now 1-H` to `all`, or custom dates), category and search property (web, YouTube, news, images, Google Shopping)
- **Built for reliability**: each HTTP 429 or captcha gets exponential backoff with a **new proxy session**, and the cookie session is refreshed when it goes stale. A source that fails gives you a **warning row** that says why. The run never hangs silently.

### What data can you extract from Google Trends?

| Data type | One row per | Key fields |
|---|---|---|
| `interestOverTime` | term | `points[]` (`date`, `formattedTime`, `value`, `isPartial`), `average`, `peakValue`, `peakDate`, `latestValue` |
| `interestByRegion` | term | `resolution`, `regions[]` (`geoCode`, `geoName`, `value`, `coordinates`) |
| `relatedQueries` | term | `top[]`, `rising[]` (`query`, `value`, `formattedValue`, `breakout`, `link`) |
| `relatedTopics` | term | as related queries, plus `topicId` (Knowledge Graph mid) and `topicType` |
| `trendingNow` | trending search | `term`, `rank`, `searchVolume`, `increasePercent`, `startedAt`, `endedAt`, `active`, `relatedQueries`, `categories`, `news[]` |

Every result row also carries `terms`, `comparisonId`, `geo`, `timeframe`, `category`, `property`, `exploreUrl` and `scrapedAt`. **One row per term per data type**: each row holds a whole timeline or region list, not hundreds of tiny rows. Terms in one comparison share Google's 0-100 scale, and `comparisonId` tells you which rows can be compared with each other.

### How to scrape Google Trends

1. Click **Try for free** and open the Input tab.
2. Enter up to 5 **Search terms** to compare (or more; they are split into groups of 5).
3. Choose **What to collect**, a **Location** (empty = worldwide) and a **Time range**.
4. Keep **Apify Proxy RESIDENTIAL** on. Google Trends rate-limits hard.
5. Click **Start**, then export to JSON, CSV or Excel, or fetch the dataset with the API.

### Input

| Field | Default | Notes |
|---|---|---|
| `terms` | (required unless only `trendingNow`) | Search terms. With `compareTerms` on, they are compared in groups of up to **5**. That is Google's limit, and values are only comparable inside one group. |
| `compareTerms` | `true` | `false` looks up each term on its own, so each term is scaled to its own peak. |
| `dataTypes` | all except `trendingNow` | `interestOverTime`, `interestByRegion`, `relatedQueries`, `relatedTopics`, `trendingNow` |
| `geo` | `""` (worldwide) | `US`, `DE`, `US-CA`, or `US-CA-807` (a metro). The region map resolution follows from it: worldwide gives countries, a country gives regions, a region gives cities. |
| `timeframe` | `today 12-m` | `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`, or `2024-01-01 2024-06-30`. Aliases such as `past 90 days` also work. |
| `category` | `0` | A Google Trends category id. It is the `cat=` value in a trends.google.com URL. |
| `property` | `web` | `web`, `youtube`, `news`, `images`, or `froogle` (Google Shopping) |
| `trendingGeo`, `trendingHours` | `geo` or `US`, `24` | Trending now settings. `4` is realtime (the past 4 hours), `24` is daily, and `48` and `168` are also accepted. |
| `trendingNewsCount`, `maxTrending` | `3`, `50` | News links per trend, and the maximum number of trends |
| `maxRelated`, `maxRegions` | `25`, `250` | Caps on list sizes inside a row |
| `language`, `timezoneOffset` | `en-US`, `0` | `timezoneOffset` is Google's `tz` (minutes, positive west of UTC). It only affects labels. Output dates are UTC. |
| `requestDelayMs`, `maxRetries` | `1500`, `5` | Politeness settings, and the retry budget for 429s and captchas |
| `proxyConfiguration` | none | **Recommended: Apify Proxy RESIDENTIAL.** Without a proxy, expect `RATE_LIMITED` warnings after a few requests. |

```json
{
  "terms": ["chatgpt", "gemini", "claude"],
  "geo": "US",
  "timeframe": "today 12-m",
  "dataTypes": ["interestOverTime", "interestByRegion", "relatedQueries"],
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output example

Every row has `type: "result"` and a `dataType`.

**interestOverTime:** one row per term.

```json
{
  "type": "result", "dataType": "interestOverTime", "term": "chatgpt",
  "terms": ["chatgpt", "gemini"], "comparisonId": "chatgpt | gemini @ US / today 12-m",
  "geo": "US", "timeframe": "today 12-m", "category": 0, "property": "web",
  "average": 87, "peakValue": 100, "peakDate": "2026-10-11T00:00:00.000Z", "latestValue": 91,
  "points": [{ "date": "2026-09-27T00:00:00.000Z", "formattedTime": "Sep 27 – Oct 3, 2026", "value": 78, "isPartial": false }],
  "exploreUrl": "https://trends.google.com/trends/explore?q=chatgpt%2Cgemini&geo=US&date=today+12-m&hl=en-US",
  "scrapedAt": "2026-10-31T12:00:00.000Z"
}
```

`latestValue` is the last **complete** bucket. The current, partial week or day is still listed in `points`, with `isPartial: true`.

**interestByRegion:** `{ "dataType": "interestByRegion", "term": "chatgpt", "resolution": "REGION", "regions": [{ "geoCode": "US-NY", "geoName": "New York", "value": 75, "coordinates": null }] }`

**relatedQueries / relatedTopics:** `{ "top": [{ "query": "chatgpt login", "value": 100, "formattedValue": "100", "breakout": false, "link": "…" }], "rising": [{ "query": "chatgpt atlas", "value": 550300, "formattedValue": "Breakout", "breakout": true }] }`. Topic items also include `topicId` and `topicType`. For `rising`, `value` is percentage growth. Google shows growth above 5000% as "Breakout".

**trendingNow:** one row per trending search.

```json
{ "type": "result", "dataType": "trendingNow", "term": "world series", "rank": 1, "geo": "US", "hours": 24,
  "searchVolume": 2000000, "increasePercent": 1000, "startedAt": "…", "endedAt": null, "active": true,
  "relatedQueries": ["dodgers", "world series game 7"], "categories": ["Sports"], "categoryIds": [17],
  "news": [{ "title": "…", "url": "https://…", "source": "…", "publishedAt": "…", "imageUrl": "…" }] }
```

`searchVolume` is Google's lower bound, so `2000000` means "2M+".

**Warning rows** tell you what is missing and why:

```json
{ "type": "warning", "code": "RATE_LIMITED", "message": "explore: Blocked by trends.google.com: HTTP 429", "context": { "terms": ["x"], "dataType": "explore" }, "scrapedAt": "…" }
```

The codes are `RATE_LIMITED`, `BLOCKED` (captcha), `BAD_REQUEST` (Google rejected the parameters, such as an unknown geo), `NO_DATA` (too little search volume), `UNEXPECTED_RESPONSE` (Google changed the format), `HTTP_ERROR` and `NETWORK_ERROR`. `RUN_SUMMARY` in the key-value store has per-comparison counts and HTTP stats (requests, retries, blocks, rotations).

### Use with AI agents (MCP)

The Actor works as a tool through the [Apify MCP server](https://mcp.apify.com). Add it by its Actor ID (shown at the top of this page), for example `https://mcp.apify.com?tools=<actor-id>`, and connect that URL in Claude, Cursor, VS Code or any MCP client.

- To compare keywords, use `{ "terms": ["a", "b"], "geo": "US", "timeframe": "today 3-m", "dataTypes": ["interestOverTime"] }`. Read `average` and `latestValue` first. They are compact, so you can skip `points` unless you need the curve.
- To see what is trending, use `{ "dataTypes": ["trendingNow"], "trendingGeo": "US", "trendingHours": 4, "maxTrending": 10, "trendingNewsCount": 0 }`.
- Filter on `type == "result"`. Read `warning` rows to tell the user why something is missing, for example "Google rate-limited the request, try again in a minute".

### Pricing

**This Actor is currently free.** There is no per-result fee and no start fee. You only pay for your own Apify platform usage (compute and proxy; residential proxy is the main cost), and small runs fit in the free plan's monthly credit. Pay-per-result pricing may be added later; if that happens, it will be announced in advance on this page and through Apify's usual notice to users.

### FAQ

#### Is there an official Google Trends API?

Google has an official Trends API in alpha with limited access. This Actor is an alternative that reads the public endpoints behind trends.google.com, much like the `pytrends` library does, with retries and proxy rotation built in.

#### Is it legal to scrape Google Trends?

The output is aggregated, anonymous statistics. Google's Terms of Service restrict automated access to its services, so you are responsible for checking that your use is acceptable. See **Responsible use** below.

#### Why do I need residential proxies?

Google Trends rate-limits by IP and answers shared or datacenter IPs with HTTP 429 quickly. Residential IPs plus the default 1.5 s delay recover most of them.

#### Can I compare more than 5 keywords?

You can pass more, but Google compares at most 5 at a time. Larger lists are split into groups of 5, and values are only comparable inside one group (same `comparisonId`).

#### Are the values search counts?

No. They are relative (0-100) within the comparison. Trending now `searchVolume` is the only absolute number, and it is a lower bound.

#### How many results do I get?

One row per term per data type, plus one row per trending search (up to `maxTrending`, max 500). A 3-term comparison with all four data types gives about 11 rows (related topics can be missing for low-volume terms).

### Limits (honest)

- **These are not official APIs.** They are the internal JSON endpoints behind trends.google.com, and Google can change them without notice. The weekly live smoke run is the alarm for that. The **Trending now** RPC (`i0OFE` via `batchexecute`) is the newest and most fragile part.
- **Rate limits are IP-scoped and strict.** Retries and new proxy sessions recover most 429s. A burst of large runs from one IP can still end in `RATE_LIMITED` warnings. Use residential proxies and keep `requestDelayMs` at 1000 ms or more.
- **Max 5 terms per comparison** (a Google limit).
- **Low-volume terms** return `NO_DATA` for some widgets. Related topics are often empty for niche terms and for some geos.
- The region map resolution is chosen by Google from the `geo`. It can't be forced, because changing the widget request invalidates its token.
- The trending category names come from the IDs in the trends.google.com/trending filter. Unknown IDs appear as `Category <id>`.

### Responsible use

- The Actor only reads **aggregated, anonymous** public statistics. There is no personal data in the output, apart from news headlines and publisher names in Trending now.
- It does not log in, does not solve captchas, and does not try to get around Google's limits beyond pacing and retrying. If Google keeps refusing, you get a warning row.
- It is polite by default: one request at a time, at least 1.5 s apart with jitter, and backoff that honours the response.
- Google's Terms of Service restrict automated access to its services. You are responsible for checking that your use is acceptable. For high-volume or commercial needs, look at Google's official Trends API (alpha) as well.

This Actor is not affiliated with Google.

### Development

```bash
npm install
npm run typecheck && npm run lint && npm test     # offline, constructed fixtures (see test/fixtures/README.md)
npm run build && npm run smoke                    # live; set SMOKE_PROXY_URL, Google blocks CI IPs
SMOKE_SAVE_DIR=raw npm run smoke                  # save real responses to replace the fixtures
```

# Actor input Schema

## `terms` (type: `array`):

Search terms to look up. With "Compare terms" on, up to 5 terms are compared in one chart (values scaled together, like the Trends UI); more terms are split into groups of 5. Not needed for a Trending-now-only run.

## `compareTerms` (type: `boolean`):

On: terms are compared together (max 5 per comparison). Off: every term is looked up on its own, so each is scaled 0-100 against itself.

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

Pick any of: interest over time, interest by region, related queries, related topics, Trending now.

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

Empty = worldwide. ISO country ("US", "DE"), region ("US-CA") or US metro ("US-CA-807"). The region map resolution follows from it: worldwide -> countries, country -> regions, region -> cities.

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

Google Trends format: "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", or a date range "2024-01-01 2024-06-30". Aliases like "past 90 days" work too.

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

Google Trends category id (0 = all categories). Example: 71 = Food & Drink, 5 = Computers & Electronics. The id is the "cat=" value in a trends.google.com URL.

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

Which Google search to measure.

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

Cap for the top and rising lists in related queries/topics rows (Google returns up to ~25).

## `maxRegions` (type: `integer`):

Cap for the regions list in interest-by-region rows (sorted by value).

## `trendingGeo` (type: `string`):

Country (or US state, e.g. "US-NY") for Trending now. Defaults to the Location above, or US.

## `trendingHours` (type: `string`):

4 = realtime (past 4 hours), 24 = daily, 48, or 168 = past 7 days.

## `trendingNewsCount` (type: `integer`):

0 to 10 linked news articles per trending search.

## `maxTrending` (type: `integer`):

Maximum number of trending searches (one row each).

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

Interface language for labels and topic names, e.g. "en-US", "de", "ja".

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

Google's tz parameter in minutes, positive west of UTC (300 = US Eastern standard time, -60 = CET). Only shifts labels; dates in the output are UTC.

## `requestDelayMs` (type: `integer`):

Minimum pause between two requests, with jitter. Google Trends rate-limits hard; going below ~1000 ms invites 429s.

## `maxRetries` (type: `integer`):

Retries per request on 429 / captcha / 5xx. Each 429 or captcha also switches to a new proxy session (new IP) with exponential backoff.

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

Strongly recommended. Google Trends answers 429 quickly to shared/datacenter IPs. Use Apify Proxy RESIDENTIAL (or your own rotating proxies).

## Actor input object example

```json
{
  "terms": [
    "chatgpt",
    "gemini"
  ],
  "compareTerms": true,
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "category": 0,
  "property": "web",
  "maxRelated": 25,
  "maxRegions": 250,
  "trendingHours": "24",
  "trendingNewsCount": 3,
  "maxTrending": 50,
  "language": "en-US",
  "timezoneOffset": 0,
  "requestDelayMs": 1500,
  "maxRetries": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped items in the run's default dataset (JSON, CSV, Excel via the dataset API).

## `runSummary` (type: `string`):

Per-source counters, warnings and errors for this run.

# 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 = {
    "terms": [
        "chatgpt",
        "gemini"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("telkontar44/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 = {
    "terms": [
        "chatgpt",
        "gemini",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("telkontar44/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 '{
  "terms": [
    "chatgpt",
    "gemini"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call telkontar44/google-trends --silent --output-dataset

```

## MCP server setup

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