# Google Trends Scraper & API — Compare Keywords & Breakouts (`valev-lab/google-trends-scraper`) Actor

Google Trends API for keyword research: interest over time, by country, state, city or US metro, plus related queries and Breakouts. Compare up to 5 keywords for the price of one. Trend direction and peak included. Web, YouTube, News, Shopping. Paste Trends URLs. No login.

- **URL**: https://apify.com/valev-lab/google-trends-scraper.md
- **Developed by:** [Daniel Valev](https://apify.com/valev-lab) (community)
- **Categories:** SEO tools, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 search results

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

### What does Google Trends Scraper do?

**Google Trends Scraper is an unofficial Google Trends API.** Give it keywords and it returns the data from [Google Trends Explore](https://trends.google.com/trends/explore) as clean rows: **interest over time**, **interest by country, state, city, or US metro area**, and **related queries** (top and rising, including **"Breakout"** searches), plus a ready-made **average**, **peak**, and **trend direction** (rising, falling, or stable) for every keyword.

**Compare up to 5 keywords on one scale for the price of one**, exactly like adding terms in Google Trends. Pick any **country or region**, a **time range** from the past hour to 2004–today (or your own dates), a **category**, and **Web, YouTube, News, Image, or Google Shopping** search. You can also paste **Google Trends URLs** straight from your browser.

**No login, no API key, no browser.** Download results as JSON, CSV, or Excel, call it from Python or JavaScript, or connect it to Google Sheets, Make, Zapier, or n8n.

#### At a glance

| | |
| --- | --- |
| **Data source** | Google Trends Explore (trends.google.com/trends/explore) |
| **Per term** | Interest over time, interest by region, related queries with Breakouts, average, peak, trend direction |
| **Locations** | Worldwide, 250 countries, 3,000+ regions, US metro areas (DMA) |
| **Time ranges** | Past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months, 5 years, 2004–present, or custom dates |
| **Search types** | Web, YouTube, News, Images, Google Shopping |
| **Comparisons** | Up to 5 terms on one 0–100 scale, for the price of one |
| **Speed** | About 5–15 seconds per search on Apify, whether one term or a comparison |
| **Reliability** | 20 of 20 test runs on Apify succeeded with complete data (November 2026) |
| **Price** | From $2.00 per 1,000 terms; failed or incomplete rows are free |
| **Login or API key** | Not needed |

### Why use this Google Trends scraper?

- 🔎 **SEO and content planning:** find the rising queries and "Breakout" searches around your keywords, and see which months your topic peaks so you publish ahead of demand.
- 🛒 **Product research:** compare product names, brands, or features side by side, check Google Shopping and YouTube interest, and spot which regions search for them most.
- 📈 **Market timing:** read the trend direction and peak date for each term to see whether interest is climbing, fading, or seasonal before you launch, stock up, or spend on ads.
- 🌍 **Regional targeting:** rank countries, states, cities, or US metro areas by interest to decide where to advertise or expand.
- 📊 **Dashboards and reports:** schedule a run and send the flat interest-over-time table to Google Sheets, Looker Studio, or your database.
- 🤖 **AI agents:** call it as a tool from Claude, Cursor, or any MCP client to answer "is this topic growing?" with real data.

Running on Apify also gives you scheduling, monitoring, API access, webhooks, and integrations with Make, Zapier, n8n, Google Sheets, and more.

Need what is trending **right now** instead of the history of a keyword? Use [Google Trends Trending Now Scraper](https://apify.com/valev-lab/google-trends-trending-now) for today's trending searches in 125 countries, with news and alerts.

### Ways to get Google Trends data, compared

| | Google Trends website | Official Google Trends API | pytrends (Python) | This Actor |
| --- | --- | --- | --- | --- |
| Access | Anyone, by hand | Limited alpha, by application | Open source library | Anyone, with a free Apify account |
| Many keywords at once | One chart at a time | Yes | Yes, but often blocked with 429 errors | Yes, up to 1,000 rows per run |
| Rate limits and blocks | Not a concern | Quotas | You handle them | Retries, proxy rotation, and pacing built in |
| Interest by region, related queries | Yes, CSV per chart | Varies by access level | Yes | Yes, in every row |
| Average, peak, trend direction | No | No | No | Yes |
| Output | CSV per chart | JSON | pandas DataFrame | JSON, CSV, Excel, API, Google Sheets |
| Scheduling and alerts | No | Build it yourself | Build it yourself | Built in |

### What data does it extract?

| Interest | Related searches | Context |
| --- | --- | --- |
| Interest over time: date, timestamp, 0–100 value, partial flag | Related queries, top and rising, with value and "+250%" / "Breakout" | Term and the terms it was compared with |
| Average interest and peak (date and value) | Related topics, when Google returns them (see FAQ) | Location, time range, category, search type |
| Trend direction: rising, falling, or stable | A Google Trends link for every query and topic | Google Trends URL for the same search |
| Interest by country, region, city, or US metro | | Errors per data type, scrape time |

### How to scrape Google Trends

1. Click **Try for free**.
2. Enter one or more **Search terms**, for example `chatgpt`, `claude`, `gemini`, or paste a Google Trends Explore URL.
3. Turn on **Compare terms on one scale** if you want the terms compared against each other.
4. Pick a **Location**, **Time range**, and, if you like, a **Category** and **Search type**.
5. Click **Start** and download the results when the run finishes.

### How much does it cost to scrape Google Trends?

You pay per term result: one search with every data type you picked. A comparison of up to 5 terms counts as **one** result. Apify platform usage is included in the price.

| Event | Free plan | Bronze | Silver | Gold and above |
| --- | ---: | ---: | ---: | ---: |
| 1 term result (single term or comparison of up to 5) | $0.003 | $0.0027 | $0.0024 | $0.002 |
| 1,000 term results | $3.00 | $2.70 | $2.40 | $2.00 |

You are **not** charged for searches that failed, or for rows where any data type you asked for could not be fetched; those rows are still saved, free, with an `errors` list. Each run also has a start fee of $0.00005.

Examples on the Free plan: 100 keywords one by one cost about $0.30; the same 100 keywords compared in groups of 5 cost about $0.06. Set a **maximum total charge** on the run and the Actor stops there.

### Input example

```json
{
  "searchTerms": ["chatgpt", "claude", "gemini"],
  "compareMode": true,
  "geo": "US",
  "timeRange": "today 12-m",
  "category": "0",
  "property": "web",
  "dataTypes": ["interestOverTime", "interestByRegion", "relatedQueries", "relatedTopics"],
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "language": "en-US",
  "maxItems": 100
}
```

- **Search terms:** keywords, or Google Trends Explore URLs such as `https://trends.google.com/trends/explore?q=chatgpt,claude&geo=US&date=today%205-y`. A URL keeps its own terms, location, dates, category, and search type.
- **Compare terms on one scale:** on, terms are compared in groups of up to 5 and share one 0–100 scale; off, each term is scaled to its own peak.
- **Location:** empty for worldwide, a country code (`US`, `DE`, `BG`) or name (`Germany`), a region (`US-CA`, `BG-22`), or a US metro (`US-NY-501`). Unknown codes stop the run with a clear message before anything is charged.
- **Time range:** `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 custom dates such as `2024-01-01 2024-03-31`.
- **Category:** a Google Trends category ID; `0` is all categories. The input form lists the top-level ones (for example 5 Computers & Electronics, 7 Finance, 18 Shopping); any of Google's 1,100+ category IDs works.
- **Search type:** `web`, `youtube`, `news`, `images`, or `froogle` (Google Shopping).
- **Region detail:** `auto` (Google's default), `COUNTRY` (worldwide searches), `REGION` (a country's states or regions), `CITY`, or `DMA` (US metro areas, US locations only).

### Output example

One row per term. Lists are shortened here.

```json
{
  "term": "claude",
  "comparedWith": ["chatgpt", "gemini"],
  "comparisonGroup": 1,
  "geo": "US",
  "geoName": "United States",
  "timeRange": "today 12-m",
  "category": 0,
  "categoryName": "All categories",
  "property": "web",
  "interestOverTime": [
    { "date": "2025-11-02", "timestamp": 1762041600, "value": 7, "isPartial": false },
    { "date": "2026-10-25", "timestamp": 1792886400, "value": 25, "isPartial": false },
    { "date": "2026-11-01", "timestamp": 1793491200, "value": 23, "isPartial": true }
  ],
  "averageInterest": 20.1,
  "peak": { "date": "2026-05-24", "value": 34 },
  "trendDirection": "rising",
  "interestByRegion": [
    { "geoCode": "US-DC", "name": "District of Columbia", "value": 100 },
    { "geoCode": "US-CA", "name": "California", "value": 80 }
  ],
  "relatedQueries": {
    "top": [
      { "query": "claude ai", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=claude+ai&date=today+12-m&geo=US" }
    ],
    "rising": [
      { "query": "claude cowork", "value": 117450, "formattedValue": "Breakout", "link": "https://trends.google.com/trends/explore?q=claude+cowork&date=today+12-m&geo=US" }
    ]
  },
  "relatedTopics": null,
  "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=chatgpt%2Cclaude%2Cgemini&hl=en-US&geo=US",
  "errors": [],
  "scrapedAt": "2026-11-07T12:53:37.807Z"
}
```

The dataset has two views:

- **Overview:** one line per term with average, peak, trend direction, and the Google Trends link.
- **Interest over time (flat):** one line per term and date (`term`, `date`, `timestamp`, `value`, `isPartial`, …), ready to export as CSV or Excel and chart in a spreadsheet.

Each run also saves a `RUN_SUMMARY` record with the status of every search, retries, and charges.

### Use the Google Trends API from code

Every run can be started through the [Apify API](https://docs.apify.com/api/v2), and results come back as JSON.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("valev-lab/google-trends-scraper").call(run_input={
    "searchTerms": ["electric bike", "e-scooter"],
    "compareMode": True,
    "geo": "DE",
    "timeRange": "today 5-y",
    "dataTypes": ["interestOverTime", "relatedQueries"],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["term"], row["averageInterest"], row["trendDirection"])
```

For a flat CSV of interest over time, download `https://api.apify.com/v2/datasets/<DATASET_ID>/items?view=interestOverTime&format=csv`.

AI assistants can use it as a tool through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp): `https://mcp.apify.com?tools=valev-lab/google-trends-scraper`.

### How reliable is it?

In 20 back-to-back test runs on Apify in November 2026 (a 3-keyword US comparison and a single keyword in Bulgaria, alternating), **all 20 succeeded with every data type complete**. When Google rate-limited a proxy IP, the run switched to a new one and finished a few seconds later.

- **HTTP only, no browser.** Each search is one Explore request plus one request per data type and term, so runs take seconds.
- **Automatic retries** with exponential backoff and jitter on rate limits and server errors, with a new proxy IP and fresh cookies after each block, and requests paced per IP.
- **Datacenter proxy first**, residential proxy only after repeated blocks, so most runs stay fast.
- **Partial data instead of failure.** If one data type fails for a term, the row still has everything else, lists what is missing in `errors`, and is not charged.
- **A failing search never fails the run.** It is retried once, logged in `RUN_SUMMARY`, and the other searches continue.
- **Input checked before any request.** Location codes, time ranges, categories, and region detail are validated against Google's own lists, with a message that says what to fix.

### FAQ

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

Google has a limited alpha API for a small group of approved testers, and no public API for Explore data. This Actor works as a **Google Trends API**: call it over HTTP, from Python or JavaScript, or from Make, Zapier, and n8n, and get JSON back.

#### Is there a free Google Trends API?

The Google Trends website is free but manual. With a free Apify account you get monthly credit that covers hundreds of searches with this Actor: one search costs $0.003 on the Free plan, and a comparison of 5 keywords costs the same as one.

#### How do I get Google Trends data into Python?

Use the `apify-client` package as shown in [Use the Google Trends API from code](#use-the-google-trends-api-from-code), then load the rows into pandas with `pd.DataFrame(items)`. For a time series table, read the flat `interestOverTime` view. If `pytrends` stopped working for you because of 429 errors, this is a drop-in way to get the same data with retries and proxies handled for you.

#### How do I download Google Trends data as CSV?

Run the Actor, open the **Interest over time (flat)** view in the dataset, and click **Export → CSV**. You get one line per keyword and date, which opens directly in Excel or Google Sheets. Interest by region and related queries are in the JSON or Excel export.

#### How do I read interest over time?

Google Trends does not publish search volumes. Every value is relative: 100 is the highest interest for the term (or for the comparison) in that place and time, 50 is half as much, and 0 means too little data. In a comparison, all terms share one scale, so you can read which term is searched more. Separate searches each have their own scale and are not comparable with each other.

#### How do I compare more than 5 keywords in Google Trends?

Google compares at most 5 terms at once. With more than 5 terms in compare mode, the Actor runs several comparisons of up to 5. Values are comparable within a comparison, not across comparisons. To compare many terms on one scale, put the same anchor term (for example a big brand) in every group.

#### How is trend direction calculated?

From the slope of a straight line fitted to the last 25% of complete points. If the line rises by more than 10% of that period's average (and at least 2 points), the trend is `rising`; if it falls by as much, `falling`; otherwise `stable`. The last point of a series is often partial (the current week or day) and is left out of the average, peak, and trend.

#### What does "Breakout" mean in Google Trends?

A rising query whose growth is over +5,000% compared with the previous period, usually a new search. Google shows "Breakout" instead of a percentage; `value` still holds the number, so you can sort Breakouts by size.

#### What is the difference between related queries and related topics?

Related queries are the exact searches people typed, such as "claude code". Related topics group many searches about one thing, such as one topic for an AI assistant that covers all its spellings and nicknames. This Actor returns related queries for every keyword. Google currently returns no related topics to automated requests (checked in November 2026), and offers none for comparisons, so `relatedTopics` is empty or null. When Google returns them again, they appear in the same field at no extra cost.

#### How do I use Google Trends for keyword research?

1. Enter your seed keywords with **Related queries** selected.
2. Sort the `rising` list by `value`: Breakouts and high percentages are new demand that keyword tools have not caught up with yet.
3. Compare your best candidates (up to 5 at once) to see which one people search most, and check `peak` and `trendDirection` to avoid fading or one-off topics.
4. Use **Interest by region** to see where each keyword is strongest.

#### How do I see Google Trends by state or city?

Set **Location** to a country (for example `US`) to get interest by state, or to a state (for example `US-CA`) to get cities. Set **Region detail** to `DMA` for US metro areas, or `CITY` for cities across the country.

#### Why does a small state such as Wyoming top the regional list?

Interest by region is a share of all searches in each place, scaled so the top place is 100. In a place with few searches, a small number of them can push it to the top, so small states, territories, and cities can outrank big ones. These are Google's own numbers, the same as on the Google Trends website. For a steadier picture, use a longer time range or compare regions with **Region detail** set to `DMA` (US metro areas).

#### Why do some rising queries look unrelated to my keyword?

Google's rising lists sometimes contain searches that have nothing to do with the keyword. This happens most with very broad keywords, worldwide searches, and short time ranges. The Actor returns Google's lists unchanged. You get cleaner results with a specific keyword (for example `protein powder` rather than `tools`), a country instead of worldwide, and a 12-month or longer time range.

#### How do I get daily Google Trends data for a long period?

Google decides the granularity from the time range: hourly or by the minute for the past day or less, daily up to about 9 months, weekly up to 5 years, and monthly beyond. For daily data over a long period, run several custom ranges of up to 9 months each.

#### Can I use Google Trends URLs?

Yes. Copy the URL from your browser on the Explore page and paste it into **Search terms**. The Actor reads its terms, location, time range, category, and search type. Comparisons across different locations or time ranges in one URL are not supported; split them into separate URLs.

#### What about today's trending searches?

That is a different part of Google Trends. Use [Google Trends Trending Now Scraper](https://apify.com/valev-lab/google-trends-trending-now) to get the live Trending Now list for 125 countries, with search volume, news articles, and a monitor mode for alerts.

#### Do I need a Google account or API key?

No. The Actor reads the same public data the Google Trends website shows.

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

The Actor collects only public, aggregated, anonymized search interest, with no personal data. You are responsible for how you use the results; check Google's terms and your local laws if you are unsure.

#### Something is not working. Where do I report it?

Open an issue on the Actor's **Issues** tab with the run ID. Google sometimes changes its pages; fixes are usually quick.

*This Actor is not affiliated with, endorsed by, or sponsored by Google. Google Trends is a trademark of Google LLC.*

# Actor input Schema

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

Keywords such as "chatgpt", or Google Trends Explore URLs (https://trends.google.com/trends/explore?q=...). A URL keeps its own terms, location, time range, category, and property; settings below fill in whatever the URL leaves out.

## `compareMode` (type: `boolean`):

On: terms are compared in groups of up to 5, like adding terms in Google Trends, so their values share one 0–100 scale. Off: each term is searched on its own and scaled to its own peak.

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

Leave empty for worldwide. A country code (US, DE, BG), a country name (Germany), a region (US-CA, BG-22), or a US metro area (US-NY-501).

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

Pick a preset, or type a custom range as "YYYY-MM-DD YYYY-MM-DD" (from 2004-01-01).

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

Narrow results to a category, as in Google Trends. Pick a top-level one or type any Google Trends category ID (for example 1227 Android OS).

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

Which Google search to measure.

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

Each row includes every data type you pick. Fewer types make runs faster. Google currently returns related topics empty for automated requests and never for comparisons; they cost nothing extra.

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

Level of the interest-by-region breakdown. Automatic follows Google: countries for worldwide, regions for a country, cities for a region. Countries need a worldwide search, regions need a country, and US metro areas (DMA) need a US location.

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

Also list places with little search volume, as with the matching checkbox in Google Trends.

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

Google's hl language code, for example en-US, de, or bg. It sets the language of region names and related searches labels.

## `maxItems` (type: `integer`):

The most rows (terms) to save. Comparisons are kept whole, so the run stops before a comparison that would go past this number.

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

Apify datacenter proxy is used first. After repeated blocks the run switches to residential proxy automatically, at no extra cost to you.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "claude",
    "gemini"
  ],
  "compareMode": false,
  "geo": "",
  "timeRange": "today 12-m",
  "category": "0",
  "property": "web",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "language": "en-US",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `interestOverTime` (type: `string`):

No description

## `runSummary` (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": [
        "chatgpt",
        "claude",
        "gemini"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("valev-lab/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",
        "gemini",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("valev-lab/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",
    "gemini"
  ]
}' |
apify call valev-lab/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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