# Google Trends Scraper (`zhuylanz/google-trends-scraper`) Actor

Reliable Google Trends data: interest over time, interest by region and related queries (top and rising), for up to 5 compared terms per query. Pay only for successful queries.

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

## Pricing

from $1.00 / 1,000 successful 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

Get Google Trends data for any keyword, country, and time range: **interest over time, interest by region, and related queries** (top and rising). Compare up to 5 terms on one scale, run hundreds of keywords in one go, and pay only for queries that return data.

Built and maintained by [LaPage Digital](https://lapage.vn), a web and SEO agency that uses this Actor in its own keyword research.

### Why this Actor

- **Reliable and fast.** Several workers run in parallel, each with its own warmed-up Google session, and any blocked request is retried on a fresh proxy session. In testing, 20 queries across 2 countries completed in 20 seconds with no retries.
- **Never stuck.** If requests keep getting blocked, the run stops after 3 failed queries in a row instead of looping, and lists the remaining queries as `skipped` so you can rerun just those.
- **You pay for results, not attempts.** A query is charged only when its data is saved. Failed queries are still listed in the dataset with the error, free of charge, so you know exactly what is missing.
- **Ready-made summary.** Every result includes the average, peak (with date), latest value, and recent change in percent for each term, so you can rank keywords without post-processing.
- **One row per query.** Each dataset item holds everything for one term (or comparison) in one location, plus a link that opens the same view in Google Trends.

### What you get

| Section | Contents |
|---|---|
| `interestOverTime` | Date, label, and 0–100 value per term. Partial (still-collecting) periods are flagged with `isPartial`. |
| `interestByRegion` | Country, subregion, city, or US metro (DMA) with 0–100 value per term. |
| `relatedQueries` | Top and rising related searches per term. Rising entries show the growth percentage, or "Breakout" for growth above 5000%. |
| `summary` | Average, peak, peak date, latest value, and recent change per term. Partial periods are excluded. |

### Input

| Field | Description |
|---|---|
| Search terms | Keywords to look up. |
| Compare terms | Group terms in sets of up to 5 so values share one scale. |
| Locations | Country or region codes (`US`, `VN`, `GB`, `US-CA`). Empty means Worldwide. Each location is a separate query. |
| Time range | Past hour to 2004–present, or a custom `YYYY-MM-DD YYYY-MM-DD` range. |
| Data to collect | Any of interest over time, interest by region, related queries. Fewer sections run faster. |
| Category, search type | Google Trends category ID, and web, image, news, Shopping, or YouTube search. |
| Region level | Country, subregion, city, or US metro. |
| Language, timezone | Labels in your language; timestamps aligned to your timezone. |
| Parallel workers | Queries run at the same time (default 4). |

#### Example

```json
{
    "searchTerms": ["web design", "website maintenance"],
    "compareTerms": true,
    "geos": ["US", "GB"],
    "timeRange": "today 12-m"
}
```

### Output example

```json
{
    "searchTerms": ["web design", "website maintenance"],
    "geo": "US",
    "timeRange": "today 12-m",
    "status": "ok",
    "summary": {
        "web design": { "average": 53.3, "peak": 100, "peakDate": "2026-06-14T00:00:00.000Z", "latest": 31, "latestDate": "2026-10-18T00:00:00.000Z", "recentChangePercent": -41 },
        "website maintenance": { "average": 10.5, "peak": 32, "peakDate": "2026-06-14T00:00:00.000Z", "latest": 4, "latestDate": "2026-10-18T00:00:00.000Z", "recentChangePercent": -70 }
    },
    "interestOverTime": [
        { "date": "2026-10-18T00:00:00.000Z", "label": "Oct 18 – 24, 2026", "values": { "web design": 31, "website maintenance": 4 }, "isPartial": false }
    ],
    "interestByRegion": [
        { "geoCode": "US-WY", "geoName": "Wyoming", "values": { "web design": 66, "website maintenance": 34 } }
    ],
    "relatedQueries": {
        "web design": {
            "top": [{ "query": "best web design", "value": 100, "formattedValue": "100" }],
            "rising": [{ "query": "web design aiocoders", "value": 7400, "formattedValue": "Breakout" }]
        }
    },
    "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=web+design%2Cwebsite+maintenance&geo=US",
    "scrapedAt": "2026-10-25T05:00:00.000Z"
}
```

Lists are shortened here; real results contain the full series (for example 52 weekly points for 12 months).

### Pricing

You pay per successful query: one search term (or one comparison of up to 5 terms) in one location. Failed, skipped, and no-data queries are free. Apify platform usage is included in the price.

### Good to know

- **Values are relative, not search volumes.** Google Trends scales each query to 0–100, where 100 is the peak within that query. Compare terms in one query to put them on the same scale. For absolute volumes, use a keyword-volume tool.
- **Related topics are not included.** Google returns empty related-topic lists to automated access, so this Actor does not offer a field that would always be empty.
- **Low-volume terms** can return no data at all. Such queries are marked `no-data` and are not charged.

### Support

Open an issue on the Actor's **Issues** tab.

# Actor input Schema

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

Keywords to look up. Each term is one query unless "Compare terms" is on.

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

Group terms into comparisons of up to 5, so values share one scale (like typing them side by side in Google Trends).

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

Country or region codes such as US, VN, GB or US-CA. Each location multiplies the number of queries. Leave empty for Worldwide.

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

Preset time range. Ignored when a custom range is set.

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

Two dates as YYYY-MM-DD YYYY-MM-DD, for example 2024-01-01 2024-12-31.

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

Which Google Trends sections to fetch. Fewer sections make runs faster.

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

Google Trends category ID, for example 13 for Internet & Telecom. 0 means all categories.

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

Which Google search to measure.

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

Level of detail for interest by region. Leave empty for Google's default (countries for Worldwide, subregions inside a country).

## `includeLowSearchVolumeRegions` (type: `boolean`):

Also return regions where Google reports low search volume.

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

Language for labels and region names, such as en-US or vi.

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

Minutes behind UTC, as Google expects: 0 for UTC, -420 for Vietnam (UTC+7), 300 for US Eastern.

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

How many times to retry a blocked or failed request with a fresh proxy session.

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

How many queries run at the same time, each with its own Google and proxy session. Higher is faster but can trigger more rate limiting.

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

Apify Proxy is recommended. Google rate-limits datacenter IPs quickly at volume.

## Actor input object example

```json
{
  "searchTerms": [
    "web design",
    "website maintenance"
  ],
  "compareTerms": false,
  "geos": [],
  "timeRange": "today 12-m",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "category": 0,
  "property": "",
  "regionResolution": "",
  "includeLowSearchVolumeRegions": false,
  "language": "en-US",
  "timezoneOffset": 0,
  "maxRetries": 5,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per query with interest over time, interest by region and related queries.

# 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 design",
        "website maintenance"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhuylanz/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 design",
        "website maintenance",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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