# Google Trends Scraper - $1 / 1000 Searches (`scrapeunblocker/google-trends-scraper`) Actor

Scrape Google Trends for any term or compare up to 5: interest over time, interest by country, region, city or metro, and top and rising related queries and topics. Any country, time range, category and Google property (web, images, news, YouTube, shopping). $1 per 1000 searches.

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

## Pricing

from $1.00 / 1,000 searches

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

Scrape **Google Trends** as clean structured JSON - **interest over time**, **interest by region** (country, region, city or US metro) and **top and rising related queries and topics** - for any term, or **compare up to 5 terms** on one chart. Any location, time range, category and Google property (web, images, news, YouTube, shopping). No proxies, browsers or rate limits to deal with.

### Features

- **Interest over time** - one point per time bucket with a 0-100 value per term, ISO date, Unix timestamp and a partial-data flag.
- **Comparisons** - put up to 5 comma-separated terms on one line to get them on the same scale, with averages.
- **Interest by region** - worldwide by country, or inside a country by region, city or US metro (DMA).
- **Related queries** - top and rising, with values and links, for every term.
- **Related topics** - top and rising (optional).
- **Filters** exactly like trends.google.com: location, time range (presets or a custom date range, hourly for the last 7 days), category and property.
- **Many searches per run** - one line per search.

### Use cases

- Keyword and content research, seasonality and demand forecasting.
- Brand and competitor comparison over time and across regions.
- Spotting rising queries for SEO and product ideas.
- Feeding dashboards and BI tools with regular Trends snapshots.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `search_terms` | array | `["web scraping"]` | One search per line: a term, or up to 5 comma-separated terms to compare. |
| `geo` | string | worldwide | ISO-2 country (`US`), region (`US-CA`) or US metro (`US-CA-807`). |
| `timeframe` | string | `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`. |
| `custom_time_range` | string | - | `YYYY-MM-DD YYYY-MM-DD`, overrides `timeframe`. |
| `property` | string | `web` | `web`, `images`, `news`, `youtube` or `shopping`. |
| `category` | integer | `0` | Trends category ID (0 = all). |
| `interest_by_region` | boolean | `true` | Include the region map. |
| `related_queries` | boolean | `true` | Include related queries. |
| `related_topics` | boolean | `false` | Include related topics. |
| `region_resolution` | string | `auto` | `country`, `region`, `city` or `dma`. |
| `include_low_volume` | boolean | `false` | Include low-volume regions. |
| `hl` | string | `en-US` | Language of labels. |
| `tz` | integer | `0` | Timezone offset in minutes (300 = UTC-5). |

#### Example input

```json
{
  "search_terms": ["coffee,tea,matcha", "electric bike"],
  "geo": "US",
  "timeframe": "today 5-y",
  "related_topics": true
}
```

### Output

One dataset item per search (shortened):

```json
{
  "searchTerm": "web scraping",
  "keywords": ["web scraping"],
  "geo": null,
  "timeframe": "today 12-m",
  "property": "web",
  "resolution": "WEEK",
  "exploreUrl": "https://trends.google.com/trends/explore?date=today%2012-m&q=web%20scraping&hl=en-US",
  "interestOverTime": [
    { "date": "2025-09-28T00:00:00Z", "timestamp": 1759017600, "formattedTime": "Sep 28 - Oct 4, 2025", "values": { "web scraping": 61 }, "isPartial": false }
  ],
  "averages": null,
  "interestByRegion": [
    { "geoCode": "IN", "geoName": "India", "values": { "web scraping": 100 } }
  ],
  "regionResolution": "COUNTRY",
  "relatedQueries": {
    "web scraping": {
      "top": [{ "query": "web scraping ai", "value": 100, "formattedValue": "100" }],
      "rising": [{ "query": "firecrawl", "value": 300, "formattedValue": "+300%" }]
    }
  },
  "relatedTopics": null,
  "errors": []
}
```

Searches that fail are listed in the `ERRORS` record of the key-value store and are **not billed**.

### Pricing

**$1 per 1000 searches.** A comparison of up to 5 terms counts as one search. Failed searches are not charged.

### Notes

- Values are relative (0-100) within each search, exactly as on trends.google.com; compare terms in one search to put them on the same scale.
- Very small terms may have no data for narrow locations or short time ranges.

# Actor input Schema

## `search_terms` (type: `array`):

One search per line. A line is a single term ("web scraping") or up to 5 comma-separated terms to compare on one chart ("coffee,tea,matcha"). A Knowledge Graph topic ID such as /m/0dl567 also works.

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

Empty = worldwide. An ISO-2 country (US, DE), a region (US-CA) or a US metro (US-CA-807).

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

Time range of the search.

## `custom_time_range` (type: `string`):

Optional, overrides the time range: 'YYYY-MM-DD YYYY-MM-DD' (e.g. '2025-01-01 2025-06-30'), or hourly within the last 7 days: 'YYYY-MM-DDTHH YYYY-MM-DDTHH'.

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

Which Google search to measure.

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

Google Trends category ID (0 = all categories, 71 = Food & Drink, 5 = Computers & Electronics, ...).

## `interest_by_region` (type: `boolean`):

Include the interest-by-region map.

## `related_queries` (type: `boolean`):

Include top and rising related queries for each term.

## `related_topics` (type: `boolean`):

Include top and rising related topics for each term (Google often returns this list empty).

## `region_resolution` (type: `string`):

Level of the interest-by-region map.

## `include_low_volume` (type: `boolean`):

Also list regions with low search volume.

## `hl` (type: `string`):

Language of labels such as region names and topic titles (en-US, de, fr, ...).

## `tz` (type: `integer`):

Timezone that day and hour buckets align to, in Google's convention: 300 = UTC-5, -60 = UTC+1. Default 0 = UTC.

## `proxy_country` (type: `string`):

ISO-2 exit country. Leave empty - the service picks the best exits itself, and results follow the Location field, not the exit.

## `concurrency` (type: `integer`):

How many searches to run at the same time (1-2).

## Actor input object example

```json
{
  "search_terms": [
    "web scraping"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "property": "web",
  "category": 0,
  "interest_by_region": true,
  "related_queries": true,
  "related_topics": false,
  "region_resolution": "auto",
  "include_low_volume": false,
  "hl": "en-US",
  "tz": 0,
  "proxy_country": "",
  "concurrency": 1
}
```

# Actor output Schema

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

One item per search: interest over time, by region and related queries

## `errors` (type: `string`):

Searches that returned no data, with the reason (not billed)

# 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 = {
    "search_terms": [
        "web scraping"
    ]
};

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

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

```

## MCP server setup

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