# Google Trends Scraper (interest over time, regions, related) (`scrapemole/google-trends-scraper`) Actor

Scrape Google Trends: interest over time, interest by region, related queries, related topics and Trending Now, for any keyword, country and time range. Built-in retries, cookie sessions and proxy rotation. Pay per search term.

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

## Pricing

from $1.50 / 1,000 search term processeds

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

Scrape **Google Trends** data for any keyword, country and time range: **interest over time**, **interest by region** (country, state, city, metro), **related queries** (top and rising, including Breakout), **related topics**, and **Trending Now** daily searches with news. No code, no Google account, no API key. Export to JSON, CSV, Excel or Google Sheets, or call it from your app, Python, n8n, Make, Zapier or an AI agent.

Built to fix the things that make Google Trends scrapers fail: HTTP 429 errors, empty related topics and silently missing data.

### What you get

| Data | Details |
|---|---|
| Interest over time | 0-100 values per date (hourly, daily, weekly or monthly, chosen by Google for the range), with partial-period flag and averages |
| Interest by region | Countries, regions/states, cities or US metro areas (DMA), with ISO-style geo codes |
| Related queries | Top and Rising lists, growth % and **Breakout** flag, with links |
| Related topics | Top and Rising topics with topic type and Google Knowledge Graph ID |
| Compare mode | Up to 5 terms on the same scale, exactly like Compare on trends.google.com |
| Trending Now | Today's trending searches per country with approximate search volume, start time and news articles |
| Google properties | Web, Image, News, Google Shopping and YouTube search |

### Why this scraper is reliable

Most Google Trends failures come from four things. This Actor handles each of them:

1. **HTTP 429 "Too Many Requests".** Google rejects API calls that arrive without a browser cookie. Every session first picks up a cookie like a real visitor does, then calls the API.
2. **Rate limits and blocks.** Blocked requests are retried with exponential backoff on a fresh IP and cookie session. If Google keeps blocking, the Actor switches to residential IPs automatically. You don't pay extra for that.
3. **Silently empty related topics.** Google tags some IPs as automated traffic and quietly returns empty "related topics" for them. The Actor detects that tag, gets a fresh IP and asks again. If topics still can't be retrieved, the item says so clearly; it never passes empty data off as a real result.
4. **All-or-nothing runs.** Every section is fetched separately. If one section fails, you still get the others, with an `errors` list explaining exactly what failed and why (`status: "partial"`).

**Live test, 8 Oct 2026:** 30 runs against real Google Trends from a cloud server **with no proxy at all** (the hardest setup). See [Test results](#test-results) below for the real numbers.

### How to scrape Google Trends

1. Enter one or more **search terms** (e.g. `chatgpt`, `claude ai`).
2. Pick a **location** (empty = Worldwide, or `US`, `GB`, `US-CA`...) and a **time range**.
3. Click **Start**. Results appear in the Dataset tab. Download them as JSON, CSV or Excel.

#### Input example

```json
{
  "searchTerms": ["chatgpt", "claude ai", "gemini"],
  "compare": true,
  "geo": "US",
  "timeRange": "today 12-m",
  "outputMode": "perSearch"
}
```

#### Output example (one item per search term)

```json
{
  "type": "searchTerm",
  "searchTerm": "chatgpt",
  "geo": "Worldwide",
  "timeRange": "today 12-m",
  "status": "complete",
  "averages": { "chatgpt": 82 },
  "interestOverTime": [
    { "date": "2026-10-04T00:00:00.000Z", "formattedTime": "Oct 4 – 10, 2026", "values": { "chatgpt": 95 }, "isPartial": true }
  ],
  "interestByRegion": [
    { "geoCode": "RW", "geoName": "Rwanda", "values": { "chatgpt": 100 } }
  ],
  "relatedQueries": {
    "top": [{ "query": "ai chatgpt", "value": 100, "formattedValue": "100", "isBreakout": false }],
    "rising": [{ "query": "how to use chatgpt effectively", "value": 2550, "formattedValue": "+2,550%", "isBreakout": false }]
  },
  "relatedTopics": { "top": [], "rising": [] },
  "errors": [],
  "trendsUrl": "https://trends.google.com/trends/explore?q=chatgpt&hl=en-US&date=today+12-m",
  "scrapedAt": "2026-10-08T11:52:50.487Z"
}
```

Prefer spreadsheets? Set **Output format** to **Flat rows** to get one row per data point (`rowType`: interestOverTime, interestByRegion, relatedQuery, relatedTopic). That's ideal for CSV, Excel, Google Sheets and BI tools.

#### Trending Now example

```json
{ "mode": "trendingNow", "trendingGeos": ["US", "GB", "DE"] }
```

Returns `title`, `approxTraffic` ("200K+"), `approxTrafficNumber`, `startedAt`, `picture` and `news` (title, url, source) for each trend.

### Switching from another Google Trends Actor

Already calling **apify/google-trends-scraper** from code, a schedule or Make/Zapier? Change the Actor ID and keep your input JSON: this Actor accepts the same field names.

| Their input | Here |
|---|---|
| `searchTerms` | Same |
| `isMultiple: true` + `"term a, term b"` | Compared together (same as `compare: true`) |
| `timeRange` (`""`, `now 7-d`, `today 5-y`, …) | Same values; `""` means past 12 months |
| `customTimeRange: "2024-01-01 2024-06-30"` | Same, and it takes precedence |
| `geo`, `category` (`"7"` or `""`) | Same |
| `startUrls` with `trends.google.com/trends/explore?...` links | Terms, geo, date, category and search type are read from the link |
| `maxRequestRetries` | Same as `maxRetries` |
| `viewedFrom`, `spreadsheetId`, `skipDebugScreen`, `pageLoadTimeoutSecs`, `maxItems` | Ignored (not needed: no browser) |

The output is one row per search term (or per comparison) with `interestOverTime`, `interestByRegion`, `relatedQueries` and `relatedTopics`; set `outputMode` to `rows` for flat rows. You pay per search term, not per compute minute.

### Pricing

Pay per result: **you pay per search term processed**, with all four data sections included. You are **not charged** for search terms that fail. Platform and proxy costs are included in the price. There are no extra compute, proxy or start fees.

| Apify plan | Price per search term | 1,000 search terms |
|---|---|---|
| Free | $0.003 | $3.00 |
| Starter (Bronze) | $0.002 | $2.00 |
| Scale (Silver) | $0.0018 | $1.80 |
| Business (Gold) | $0.0015 | $1.50 |

Trending Now: $0.0005 per trend ($0.0004 Scale, $0.0003 Business). Set **Max cost per run** in Apify and the Actor stops cleanly when it reaches it.

### Use cases

- **SEO and content:** find rising and Breakout queries before competitors, and plan content around seasonality.
- **Market research:** compare brands, products or categories by country and over five years.
- **E-commerce and dropshipping:** spot trending products on Google Shopping and YouTube search.
- **Finance and data science:** use search interest as an alternative-data signal in models and dashboards.
- **AI agents and automations:** give your agent fresh Google Trends data through the Apify API or MCP server.

### Integrations and API

Run it from the Apify API, the JavaScript or Python client, **n8n**, **Make**, **Zapier**, Google Sheets, or as a tool for AI agents through the Apify MCP server.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("scrapemole/google-trends-scraper").call(run_input={
    "searchTerms": ["bitcoin", "gold"], "compare": True, "timeRange": "today 5-y"
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["searchTerms"], item["averages"])
```

### Test results

Live test on 2026-10-08 against real Google Trends, from a cloud server with **no proxy** (Google rate-limits cloud IPs hardest, so this is a worst case):

| Metric | Result |
|---|---|
| Runs (explore, compare, flat rows, Trending Now; 10 countries, 6 time ranges, web + YouTube) | **30/30 (100.0%)** finished with data |
| Search terms with data | **28 / 28** (0 failed) |
| Interest over time | 23/23 (100.0%) |
| Interest by region | 23/23 (100.0%) |
| Related queries | 23/23 (100.0%) |
| Related topics | 0/17 (0.0%): Google hid topics from this cloud IP (it tags such IPs as automated). On Apify the Actor gets a fresh IP and switches to residential IPs to fetch them. |
| Rate-limit recoveries | Runs hit up to 14 blocks (HTTP 429) and still completed |
| Invalid input | Fails fast with a precise message, nothing charged |
| Spending limit | Stops exactly at the user's max cost per run |

### FAQ

**Is there an official Google Trends API?** Google announced a Trends API alpha in July 2025. Access is still by application to a small pilot group, and the alpha doesn't include Trending Now. This Actor gives you the same data as the trends.google.com website today, for any keyword, with no application.

**Why are the values 0-100 and not search volumes?** Google Trends only publishes relative interest: 100 is the peak for the selected terms, place and time. In compare mode all terms share one scale. Trending Now does include approximate search volume (e.g. "200K+").

**Why do I get different numbers than yesterday?** Google samples its data, and the newest point is often partial (`isPartial: true`). For stable series, use complete periods.

**What do "partial" and the `errors` list mean?** One section (e.g. related topics) couldn't be fetched, but the rest of the data is real and complete. Each error has a code (`BLOCKED`, `NO_DATA`, `PARSE_ERROR`...) and a plain-English message.

**Why are related topics missing in compare mode?** Google doesn't return related topics when several terms are compared. Run the terms one by one to get them.

**How do I pick a category?** Use the number after `cat=` in a trends.google.com URL, e.g. 7 = Finance, 71 = Food & Drink. 0 = all categories.

**Can I get hourly data?** Yes: use the Past hour/4 hours/day/7 days ranges, or a custom range like `2024-05-01T00 2024-05-07T23`.

**Is scraping Google Trends legal?** The Actor only collects publicly available, aggregated and anonymous statistics that anyone can see on trends.google.com. It doesn't collect personal data. Check that your own use complies with the laws and terms that apply to you.

**Something broke. What now?** Open an issue on the Issues tab with the run link. Every run also saves a `RUN_SUMMARY` record (requests, retries, blocks, errors) in its key-value store, which helps us fix things fast.

### More from ScrapeMole

ScrapeMole builds focused, reliable scrapers for public data: pay per result, no start fees, clear error rows that are never charged, and a `RUN_SUMMARY` on every run.

- [YouTube Transcript & Subtitles Scraper](https://apify.com/scrapemole/youtube-transcript-scraper)
- [YouTube Scraper](https://apify.com/scrapemole/youtube-video-channel-scraper)
- [YouTube Comments Scraper](https://apify.com/scrapemole/youtube-comments-scraper)
- [Telegram Channel Scraper](https://apify.com/scrapemole/telegram-channel-scraper)
- [Amazon Product & Search Scraper](https://apify.com/scrapemole/amazon-product-scraper)

Building an AI agent with its own wallet? The YouTube and Google Trends data is also sold per call over [x402](https://www.x402.org) (USDC on Base, no account): see [scrapemole.pages.dev](https://scrapemole.pages.dev). Questions or a missing field? Open an issue on this Actor. ScrapeMole is the maker of this Actor.

# Actor input Schema

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

<b>Explore</b> returns interest over time, by region and related queries/topics for your search terms (like trends.google.com/explore). <b>Trending now</b> returns today's trending searches with related news for one or more countries.

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

Keywords to look up, one per line. You can also use a Google topic ID such as /m/0d6lp. Each term is billed as one search term.

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

Off: every term is scraped on its own (values are relative to that term's peak). On: terms are compared on one chart, in groups of up to 5 (Google's limit), so values are relative to each other, exactly like the Compare feature on trends.google.com.

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

Leave empty for Worldwide. Use a country code (US, GB, DE, IN...) or a region code (US-CA, GB-ENG, DE-BY...).

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

Period to look at. Choose Custom to set exact dates below.

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

Only used when Time range is Custom. Format: <code>2024-01-01 2024-12-31</code>. For hourly data within a week: <code>2024-05-01T00 2024-05-07T23</code>.

## `searchType` (type: `string`):

Which Google search to measure.

## `category` (type: `string`):

Google Trends category to narrow ambiguous terms (0 = all categories). Examples: 7 Finance, 5 Computers & Electronics, 71 Food & Drink, 44 Beauty & Fitness. The ID is the <code>cat=</code> value in a trends.google.com URL. Text field so inputs from other Google Trends Actors ("7" or "") work as-is.

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

Timeline of search interest (0-100).

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

Search interest per country, region, city or metro area.

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

Auto = same as trends.google.com (countries for Worldwide, regions/states for a country, metro areas for a US state). City needs a country. Metro (DMA) is US only.

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

Also return regions where Google has too little data (value 0).

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

Top and rising related searches, including Breakout queries.

## `includeRelatedTopics` (type: `boolean`):

Top and rising related topics (Google does not return topics when comparing several terms).

## `outputMode` (type: `string`):

<b>One item per search term</b>: everything for a term in one JSON object (best for APIs and AI agents). <b>Flat rows</b>: one row per data point (best for CSV, Excel and Google Sheets). Billing is the same: per search term.

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

Only used in Trending now mode. 2-letter country codes.

## `maxTrendingItems` (type: `integer`):

Only used in Trending now mode. Google's public feed usually lists the top 10-20 trends per country.

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

Language for topic names and dates, e.g. en-US, de, fr, es, ja.

## `timezoneOffsetMinutes` (type: `integer`):

Timezone used by Google to bucket hourly/daily data, in minutes WEST of UTC like trends.google.com uses (0 = UTC, 300 = New York winter, -60 = Berlin winter).

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

How many search terms to process at once. Google Trends rate-limits aggressively; 2 is the sweet spot.

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

On a block (HTTP 429/CAPTCHA) the scraper waits with exponential backoff, switches to a fresh IP and cookie session, then retries.

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

Leave the default. The scraper starts on Apify Proxy (auto) and switches to residential IPs automatically only if Google keeps blocking, at no extra cost to you.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "chatgpt",
    "claude ai"
  ],
  "compare": false,
  "geo": "",
  "timeRange": "today 12-m",
  "searchType": "web",
  "category": "0",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "outputMode": "perSearch",
  "trendingGeos": [
    "US"
  ],
  "maxTrendingItems": 50,
  "language": "en-US",
  "timezoneOffsetMinutes": 0,
  "maxConcurrency": 2,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All dataset rows (status ok or error).

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

JSON summary: processed/ok/failed counts, error codes, events charged, HTTP stats.

# 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": [
        "chatgpt",
        "claude ai"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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