# Google Trends Scraper: Interest, Regions & Related Queries (`sam_i_am_not/google-trends-scraper`) Actor

Fast, reliable Google Trends data without a browser: interest over time, interest by region, related queries and topics, for up to 5 compared terms, any country, time range, category and Google property.

- **URL**: https://apify.com/sam_i_am_not/google-trends-scraper.md
- **Developed by:** [Andrew Van De Poel](https://apify.com/sam_i_am_not) (community)
- **Categories:** SEO tools, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 search queries

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: interest over time, by region, related queries

**Get Google Trends data as JSON, CSV or Excel in seconds: interest over time, interest by region, and top and rising related queries, for up to 5 compared terms, any country, time range, category, or YouTube/Shopping/News search.** No browser and no Google account. Each query takes about 3 seconds.

Built for SEO and content teams, e-commerce and product researchers, marketers, analysts and AI agents who need Trends data on a schedule or at scale, without copying charts by hand.

### What you get

| Panel | What it contains |
|---|---|
| **Interest over time** | Google's 0-100 interest index for every period (minutes, hours, days, weeks or months depending on the range), per keyword |
| **Interest by region** | Index per country, state/region, US metro area (DMA) or city, per keyword |
| **Related queries** | Top and rising related searches with their score or % growth, including "Breakout" flags |
| **Related topics** | Returned when Google provides them. Google currently returns this panel empty for most queries, so don't rely on it |

Filters:

- **Location:** worldwide, any country (`US`, `DE`) or region (`US-CA`)
- **Time range:** past hour up to 2004 to today, or a custom date range
- **Category:** any Google Trends category ID
- **Google property:** web, Image, News, Shopping or YouTube search

### How to use it

1. Add search terms, one query per line. To compare terms on the same scale, put up to 5 on one line separated by commas: `iphone, samsung galaxy, pixel`.
2. Optionally set location, time range, property and category.
3. Click **Start**. Download results from the Output tab as JSON, CSV, Excel or HTML, or fetch them through the API.

#### Input example

```json
{
    "searchTerms": ["taylor swift, beyonce", "air fryer"],
    "geo": "",
    "timeRange": "today 3-m",
    "searchProperty": "youtube",
    "dataTypes": ["interestOverTime", "interestByRegion", "relatedQueries"]
}
```

### Output

#### One item per search term (default)

Each query returns one item with every panel nested inside. The field names match the popular `apify/google-trends-scraper`, so if you're switching, your integration keeps working. Real output, with lists shortened to 2 entries:

```json
{
    "searchTerm": "taylor swift, beyonce",
    "keywords": ["taylor swift", "beyonce"],
    "geo": "",
    "timeRange": "today 3-m",
    "category": 0,
    "searchProperty": "youtube",
    "interestOverTime_timelineData": [
        { "time": "2026-07-24T00:00:00.000Z", "formattedTime": "Jul 24, 2026", "value": [20, 10], "hasData": [true, true], "isPartial": false },
        { "time": "2026-07-25T00:00:00.000Z", "formattedTime": "Jul 25, 2026", "value": [20, 10], "hasData": [true, true], "isPartial": false }
    ],
    "interestBy": [
        { "geoCode": "PH", "geoName": "Philippines", "value": [90, 10], "hasData": [true, true] },
        { "geoCode": "GG", "geoName": "Guernsey", "value": [0, 0], "hasData": [false, false] }
    ],
    "relatedQueries_top": [
        { "keyword": "taylor swift", "query": "patient zero", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=patient+zero&date=today+3-m" }
    ],
    "relatedQueries_rising": [
        { "keyword": "taylor swift", "query": "patient zero", "value": 774800, "formattedValue": "Breakout", "link": "https://trends.google.com/trends/explore?q=patient+zero&date=today+3-m" }
    ],
    "relatedTopics_top": [],
    "relatedTopics_rising": [],
    "sourceUrl": "https://trends.google.com/trends/explore?date=today+3-m&q=taylor+swift%2Cbeyonce&hl=en-US&gprop=youtube",
    "scrapedAt": "2026-10-24T21:10:00.700Z"
}
```

In comparisons, `value[0]` belongs to the first keyword, `value[1]` to the second, and so on.

#### Rows (one per data point)

Set **Output format** to **Rows** to get a flat table that drops straight into Excel, Google Sheets, SQL or a BI tool. Each row has a `dataType` column, and the Output tab has a separate view for each panel.

```json
{ "dataType": "interestOverTime", "query": "coffee", "keyword": "coffee", "date": "2025-10-19T00:00:00.000Z", "dateLabel": "Oct 19 – 25, 2025", "value": 65, "hasData": true, "isPartial": false, "geo": "US", "timeRange": "today 12-m", "category": 0, "searchProperty": "web", "sourceUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=coffee&hl=en-US&geo=US", "scrapedAt": "2026-10-24T21:09:46.956Z" }
{ "dataType": "interestByRegion", "query": "coffee", "keyword": "coffee", "geoCode": "US-WY", "geoName": "Wyoming", "value": 100, "hasData": true, "geo": "US", "timeRange": "today 12-m", "category": 0, "searchProperty": "web", "sourceUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=coffee&hl=en-US&geo=US", "scrapedAt": "2026-10-24T21:09:46.956Z" }
{ "dataType": "relatedQueries", "query": "coffee", "keyword": "coffee", "rankType": "top", "rank": 1, "relatedQuery": "coffee near me", "value": 100, "formattedValue": "100", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=coffee+near+me&date=today+12-m&geo=US", "geo": "US", "timeRange": "today 12-m", "category": 0, "searchProperty": "web", "sourceUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=coffee&hl=en-US&geo=US", "scrapedAt": "2026-10-24T21:09:46.956Z" }
```

A single 12-month query usually produces 100-700 rows.

### Pricing

You pay per **search query**: one line of input, with up to 5 compared terms and every panel you selected.

| Apify plan | Price per query | 1,000 queries |
|---|---|---|
| Free | $0.002 | $2.00 |
| Starter (Bronze) | $0.0008 | $0.80 |
| Scale and above | $0.0005 | $0.50 |

- **Rows format:** each stored row costs an extra $0.015 per 1,000 rows (about $0.006 for a typical 12-month query). The default nested format stores one item per query, so it adds almost nothing.
- **No charge** for queries that fail or that Google has no data for.
- **No start fee** beyond Apify's standard $0.00005 per run.
- Platform usage (compute, proxy) is included.
- Set **Max cost per run** in the run options, and the scraper stops cleanly when it gets there.

### Why use this instead of…

- **Copying from trends.google.com:** batch hundreds of keywords, schedule daily or weekly runs, and get clean numbers instead of screenshots.
- **pytrends or your own script:** no rate-limit fights, proxy management or broken scripts when Google changes something. A live test runs against Google every day, so breakages are caught early.
- **Browser-based scrapers:** this one calls Google's data endpoints directly, so it's faster, cheaper and less likely to fail on slow page loads.

### Use with AI agents (MCP)

This Actor works as a tool through the [Apify MCP server](https://mcp.apify.com), so Claude, ChatGPT, Cursor and other MCP clients can call it directly. Every input field has a plain-English description the agent can read. A typical agent call:

```json
{ "searchTerms": ["electric bike, e-scooter"], "geo": "US", "timeRange": "today 5-y", "dataTypes": ["interestOverTime"] }
```

The default nested output is compact (one item per query), so the results fit comfortably in an agent's context.

You can also call it from code with the Apify API or the `apify-client` package for JavaScript and Python.

### FAQ

**What do the numbers mean?** Google Trends reports relative interest, not search volume. 100 is the peak in the selected time and place, 50 is half that, and 0 means not enough data. Values are only comparable within one query, so put terms on the same line (comma-separated) to compare them.

**Why are values in different queries on different scales?** Google normalizes each query on its own. Compare terms on one line.

**What does "Breakout" mean?** In rising queries, the query grew by more than 5,000%. `value` holds Google's raw growth figure and `isBreakout` is `true`.

**Why are related topics empty?** Google currently returns the related topics panel empty through its data endpoint for most queries. If Google starts returning them again, they'll show up automatically.

**How do I find a category ID?** Open trends.google.com, pick a category, and copy the number after `cat=` in the URL.

**Is scraping Google Trends allowed?** This Actor collects publicly available, aggregated, anonymized data that anyone can view on trends.google.com. It doesn't log in or collect personal data. You're responsible for using the data in line with applicable laws and Google's terms.

**Does the Actor send anything back to the developer?** At the end of each run it sends us a small usage record: how many of each billable event the run was charged, the prices it was charged at, your pricing tier, whether your plan is paid, and a one-way hash of your user ID. That's how we see which Actors are worth maintaining, because Apify doesn't share this with developers. Your input, your results and your account details are never sent.

**Something broke or looks wrong?** Open an issue on the Issues tab. Issues get a response within 48 hours.

# Changelog

This Actor's version history is a separate document: https://apify.com/sam_i_am_not/google-trends-scraper/changelog.md

# Actor input Schema

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

One Google Trends query per line. To compare terms against each other on the same 0-100 scale, put up to 5 on one line separated by commas, e.g. "iphone, samsung galaxy, pixel". Each line is billed as one search query.

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

Two-letter country code ("US", "GB", "DE") or a sub-region code like "US-CA" or "GB-SCT". Leave empty for worldwide.

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

Period to fetch. Google picks the granularity: minutes for 1-4 hours, hourly for 1-7 days, daily up to 90 days, weekly up to 5 years, monthly beyond. Ignored when Custom time range is set.

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

Exact date range as "YYYY-MM-DD YYYY-MM-DD" (start and end, separated by a space). Overrides Time range.

## `searchProperty` (type: `string`):

Which Google search to measure: regular web search, Image search, News, Shopping or YouTube.

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

Google Trends category to narrow ambiguous terms, e.g. 0 = all categories, 5 = Computers & Electronics, 71 = Food & Drink, 107 = Investing. The ID is the "cat" parameter in a trends.google.com URL.

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

Which Google Trends panels to return. Every selected panel is included in the same price per search query.

## `outputFormat` (type: `string`):

"One item per search term" returns a single JSON item per query with all panels nested inside, using the same field names as the apify/google-trends-scraper Actor so existing integrations keep working. "Rows" returns one flat row per data point (best for spreadsheets, SQL and BI tools); a query typically produces 100-700 rows, and rows are billed per row on top of the per-query price.

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

Granularity of Interest by region. Automatic uses Google's default (countries for worldwide, states/regions for a country). DMA (metro areas) is only available for the US; City works for most countries.

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

Language for region names and related topics, as a locale code like "en-US", "de" or "ja".

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

How many queries run in parallel. Higher is faster but Google rate-limits aggressively; 3-5 is the sweet spot.

## `debugSaveResponses` (type: `boolean`):

Developer option: stores every raw Google response in the key-value store.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "air fryer, instant pot, ninja foodi"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "customTimeRange": "2025-01-01 2025-06-30",
  "searchProperty": "",
  "category": 0,
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "outputFormat": "perTerm",
  "regionResolution": "auto",
  "language": "en-US",
  "maxConcurrency": 3,
  "debugSaveResponses": false
}
```

# Actor output Schema

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

One item per search term (default) or one row per data point (Rows format).

## `summary` (type: `string`):

Counts of succeeded and failed queries, failure reasons, warnings and charged events.

# 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": [
        "web scraping",
        "iphone, samsung galaxy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sam_i_am_not/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": [
        "web scraping",
        "iphone, samsung galaxy",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("sam_i_am_not/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": [
    "web scraping",
    "iphone, samsung galaxy"
  ]
}' |
apify call sam_i_am_not/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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