# Google Trends Scraper - Reliable, No Blocks (`the_coder_senior/google-trends-scraper`) Actor

Scrape Google Trends: interest over time, by region, related queries and Trending Now. Built not to get blocked: residential proxies, retries and session rotation.

- **URL**: https://apify.com/the_coder_senior/google-trends-scraper.md
- **Developed by:** [Márcio Makoto Nakamura](https://apify.com/the_coder_senior) (community)
- **Categories:** SEO tools, Marketing, AI
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 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. Reliable, no blocks.

![Google Trends Scraper](https://api.apify.com/v2/key-value-stores/y43eg70lFhzWELtfD/records/cover.svg)

**Google Trends Scraper** pulls interest over time, interest by region, related queries and the live *Trending now* list from Google Trends, and hands you clean JSON. No API key, no Google account, no code.

It is built around one idea: **a scraper is only useful if it finishes.** Google answers scrapers with HTTP 429 and "unusual traffic" pages. This Actor expects that. It rotates residential IPs and cookies, retries with backoff, and never charges you for a query that failed.

**Tested on the Apify cloud before release: 49 of 49 runs finished successfully, and every one of the queries inside them was answered.** Details and an honest comparison are below.

### What you can scrape

| You want | Set | You get |
| --- | --- | --- |
| How interest in a term changed over time | `dataTypes: interestOverTime` | A dated series, 0-100, per term |
| Up to 5 terms on the same scale | `compareTerms: true` | One series with a value per term |
| Where a term is popular | `dataTypes: interestByRegion` | Countries, states, cities or metro areas |
| What people also search | `dataTypes: relatedQueries` | Top and rising queries, with *Breakout* flags |
| What is trending right now | `mode: trendingNow` | Trending searches per country, with volume, start time, category and news |

Filters: **country or region** (`US`, `BR`, `US-CA`...), **time range** (past hour to 2004, or custom dates), **category**, and **property** (web, YouTube, news, images, shopping). Batch as many terms and countries as you want in one run.

### How it works, in four steps

1. Open the Actor and type your terms, one per line.
2. Pick countries, a time range and the data you want.
3. Press **Start**. Runs usually finish in under a minute for a few terms.
4. Download JSON, CSV, Excel or read it through the API.

### Examples

#### 1. Interest over time, compare terms

Input:

```json
{
  "searchTerms": ["iphone", "samsung", "pixel"],
  "compareTerms": true,
  "geos": ["US"],
  "timeRange": "today 12-m",
  "dataTypes": ["interestOverTime"]
}
```

Output (one result):

![Sample output](https://api.apify.com/v2/key-value-stores/y43eg70lFhzWELtfD/records/output.svg)

#### 2. Interest by region

Input: `{"searchTerms": ["bitcoin"], "geos": ["US"], "dataTypes": ["interestByRegion"]}`

```json
{
  "type": "interestByRegion",
  "searchTerms": ["bitcoin"],
  "geo": "US",
  "regions": [
    { "geoCode": "US-WY", "geoName": "Wyoming", "values": { "bitcoin": 100 } },
    { "geoCode": "US-KS", "geoName": "Kansas", "values": { "bitcoin": 47 } }
  ]
}
```

Set `regionResolution` to `CITY`, `REGION`, `COUNTRY` or `DMA` for more or less detail.

#### 3. Related queries

Input: `{"searchTerms": ["bitcoin"], "geos": ["US"], "dataTypes": ["relatedQueries"]}`

```json
{
  "type": "relatedQueries",
  "searchTerms": ["bitcoin"],
  "top":    [ { "query": "bitcoin price", "value": 100, "formattedValue": "100" } ],
  "rising": [ { "query": "how to buy bitcoin safely", "value": 8300, "formattedValue": "Breakout", "isBreakout": true } ]
}
```

#### 4. Trending now by country

Input: `{"mode": "trendingNow", "trendingGeos": ["US", "BR"], "trendingLimit": 10, "trendingHours": "24"}`

```json
{
  "type": "trendingNow",
  "rank": 1,
  "title": "jaguars vs ravens",
  "geo": "US",
  "searchVolume": 500000,
  "increasePercentage": 1000,
  "startedAt": "2026-11-05T11:20:00.000Z",
  "isActive": true,
  "categories": ["Sports"],
  "trendBreakdown": ["jaguars vs ravens", "ravens", "ravens vs jaguars"],
  "news": [{ "title": "...", "url": "https://...", "source": "..." }]
}
```

Top N is from 10 to 500. Keep only some topics with `trendingCategories: ["Sports", "Technology"]`, or only trends that are still going with `trendingActiveOnly: true`.

### How much does it cost?

**You pay per result. Nothing else, no monthly fee.**

| Event | Price |
| --- | --- |
| One result (a full time series, a region table, a related-queries list, or one trending search) | **$0.004** |

A "result" is a whole record, not one data point. A 52-week series for one term is **one** result, not 52. Failed and empty queries are never charged.

| Job | Results | Cost |
| --- | --- | --- |
| 1 term: time series + regions + related queries | 3 | **$0.012** |
| 50 terms in the US, time series only | 50 | **$0.20** |
| Top 25 trending searches in one country | 25 | **$0.10** |
| 20 terms x 3 countries, time series + related queries | 120 | **$0.48** |

The proxy and the compute are included in the price. Set **Max cost per run** in the run options and the Actor stops cleanly when it is reached.

#### Free plan limits

The free Apify plan can run this Actor with a cap so that nobody burns residential proxy traffic for free:

- **Explore mode:** up to **5 queries per run** (one query = one term, or one group of compared terms, in one country).
- **Trending now:** up to **2 countries per run**.

If you go over, the run still succeeds, processes the first ones and tells you in the run status: *"Free plan limit: this run asked for 8 search queries..."*. A paid Apify plan removes the limit. The same notice sits in the input form.

### Reliability, measured

![Reliability comparison](https://api.apify.com/v2/key-value-stores/y43eg70lFhzWELtfD/records/reliability.svg)

**What we ran.** 52 real executions on the Apify cloud with residential proxies: 49 valid runs, 1 run with deliberately invalid input and 2 runs we cancelled by hand. All 49 valid runs succeeded, and all of their queries (batches of up to 60) came back with data, or with a clear "no data" answer for a term that really had none.

**What it covered.** 12 locations (worldwide, US, US-CA, BR, DE, JP, GB, IN, FR, MX, CA, IS), every time range from the past 4 hours to 2004 and custom dates, all 5 properties, compared and separate terms, regions down to city level, a Japanese-language term, a Google topic id, and Trending now for 1 to 5 countries at once.

**What it does not prove.** 49 runs is a small sample. The comparison above shows public Store numbers for the competitors and a test battery for this Actor, so read it as "no failures in testing", not as a promise of 0%. Google changes things without notice. When it does, the failed queries are not charged, and the run report lists them.

**How it stays up.**

| Google does this | The Actor does this |
| --- | --- |
| Answers the first request of a new IP with HTTP 429 (about 1 request in 4 in our test) | Keeps the cookie Google just set and retries at once on the same IP |
| Blocks an IP or sends a "sorry" page | Throws the session away: new residential IP, new cookies, whole query restarted |
| Returns a half-broken answer | Treats it as a failure and retries instead of saving bad data |
| Keeps blocking | Backs off with jitter and tries up to `maxRetries` times, then reports the query as failed and does not charge for it |

**Run report.** Every run saves a `RUN_REPORT` record in the key-value store with queries run, retries, blocked requests and the reason for any failure.

### Input reference

| Field | What it does | Default |
| --- | --- | --- |
| `mode` | `explore` or `trendingNow` | `explore` |
| `searchTerms` | Terms, or Google topic ids like `/m/0dl567` | none |
| `compareTerms` | Compare terms on one scale, in groups of 5 | `false` |
| `geos` | Country or region codes. Empty = worldwide | worldwide |
| `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`, `custom` | `today 12-m` |
| `customStartDate`, `customEndDate` | `YYYY-MM-DD`, when `timeRange` is `custom` | none |
| `property` | `web`, `youtube`, `news`, `images`, `shopping` | `web` |
| `category` | Google Trends category id, `0` = all | `0` |
| `dataTypes` | `interestOverTime`, `interestByRegion`, `relatedQueries`, `relatedTopics` | over time + queries |
| `regionResolution` | `COUNTRY`, `REGION`, `CITY`, `DMA` | Google's choice |
| `trendingGeos`, `trendingHours`, `trendingLimit` (10 to 500), `trendingCategories`, `trendingActiveOnly`, `trendingIncludeNews` | Trending now settings | `US`, `24`, `25` |
| `language`, `timezoneOffset` | Labels language and bucket timezone | `en-US`, `0` |
| `maxConcurrency`, `maxRetries` | Parallel queries and attempts per query | `3`, `8` |
| `proxyConfiguration` | Keep Apify Residential for reliability | Residential |

**Related topics** are best effort. Google returns them for some terms and an empty list for others; empty lists are skipped and never charged.

### Use it from code, agents and MCP

Run it from any language with the Apify API or client:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('the_coder_senior/google-trends-scraper').call({ searchTerms: ['bitcoin'], geos: ['US'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**AI agents:** every input has a plain-English title and description, results are flat JSON with stable field names, and a `RUN_REPORT` record in the key-value store lists failures and no-data queries. Add it to Claude, Cursor or any MCP client through the [Apify MCP server](https://mcp.apify.com) and ask in plain language: *"Compare interest in iphone, samsung and pixel in the US over the last year."*

### FAQ

**Is scraping Google Trends legal?** The Actor reads public pages that anyone can open in a browser. It collects no personal data. You are responsible for how you use the data and for following Google's terms in your jurisdiction.

**Why is the same term different between runs?** Google samples its data. Small differences between runs are normal. Values are always relative, 0 to 100, to the peak in your selection.

**Why do compared terms give different numbers than separate runs?** On a comparison, 100 is the most popular term at its peak. Separate runs scale each term to itself.

**A query returned nothing.** The term has too little search volume for the country and period. Try a broader term, a longer period or worldwide.

**Do I need a proxy?** Yes, and it is included. Google blocks datacenter IPs quickly, so the Actor uses Apify Residential proxies by default, and the proxy cost is already inside the price.

**What if Google changes something?** The parsers are covered by automated tests on real Google responses, so a format change shows up fast. Report it in the Actor's Issues tab and it gets fixed.

**Can I schedule it?** Yes. Use Apify Schedules to track terms daily or weekly, and send results to Google Sheets, Slack, a webhook or your database with the Apify integrations.

*Google and Google Trends are trademarks of Google LLC. This Actor is independent and not affiliated with or endorsed by Google.*

# Actor input Schema

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

<b>Explore</b> = interest over time / by region / related queries for your search terms. <b>Trending now</b> = what is trending right now in a country.

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

Terms to look up, one per line. You can also paste Google topic IDs such as <code>/m/0dl567</code> (Taylor Swift). Used in <i>Explore</i> mode. Batch as many as you want (free plan: 5 queries per run).

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

ON: terms are compared on the same 0-100 scale, in groups of up to 5 (Google's compare feature). OFF: every term gets its own independent 0-100 scale.

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

Google geo codes, e.g. <code>US</code>, <code>BR</code>, <code>GB</code>, or sub-regions like <code>US-CA</code>. Leave empty for worldwide. Every country is queried separately.

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

Period to analyze. Short ranges (past hour/day) return minute- or hour-level data.

## `customStartDate` (type: `string`):

Only when Time range = Custom Dates. Format YYYY-MM-DD.

## `customEndDate` (type: `string`):

Only when Time range = Custom Dates. Format YYYY-MM-DD.

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

Where the searches happened.

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

Google Trends category ID (0 = all categories). Examples: 3 Arts & Entertainment, 7 Finance, 45 Health, 174 Sports, 5 Computers & Electronics, 71 Food & Drink.

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

Each data type of each query is one billable result. Tip: pick only what you need.

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

How detailed the regional breakdown is. Leave empty to let Google choose (countries when worldwide, states/regions inside a country).

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

Used in <i>Trending now</i> mode. Country codes such as <code>US</code>, <code>BR</code>, <code>DE</code>, <code>JP</code>. Free plan: 2 countries per run.

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

How far back to look.

## `trendingLimit` (type: `integer`):

Top N trends by search volume, from 10 to 500. Each trend is one billable result.

## `trendingCategories` (type: `array`):

Keep only trends in these categories, e.g. <code>Sports</code>, <code>Technology</code>, <code>Politics</code>, <code>Entertainment</code>.

## `trendingActiveOnly` (type: `boolean`):

Skip trends that already ended.

## `trendingIncludeNews` (type: `boolean`):

Adds news links and a picture to trends that Google lists in its news feed.

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

Interface language for names and labels, e.g. <code>en-US</code>, <code>pt-BR</code>, <code>es-419</code>.

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

Minutes behind UTC, as Google uses it. Example: 180 for Brazil (UTC-3), 0 for UTC. Affects hourly/daily bucketing.

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

How many queries run at the same time. 3 is a good balance; higher is faster but triggers more blocks (retries are free).

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

Each attempt uses a fresh residential IP and cookies. Failed queries are never charged.

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

Google blocks datacenter IPs. Keep <b>Apify Proxy - Residential</b> for the reliability this Actor is built for.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compareTerms": false,
  "geos": [],
  "timeRange": "today 12-m",
  "property": "web",
  "category": 0,
  "dataTypes": [
    "interestOverTime",
    "relatedQueries"
  ],
  "trendingGeos": [
    "US"
  ],
  "trendingHours": "24",
  "trendingLimit": 25,
  "trendingActiveOnly": false,
  "trendingIncludeNews": true,
  "language": "en-US",
  "timezoneOffset": 0,
  "maxConcurrency": 3,
  "maxRetries": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

## `runReport` (type: `string`):

No description

# 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"
    ],
    "trendingGeos": [
        "US"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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