# Google Trends Scraper: Related Queries, Compare & Trending Now (`ksvan/google-trends-scraper`) Actor

Bulk Google Trends data over fast HTTP (no browser): interest over time, interest by region, related & rising queries, up to 5-term comparison, YouTube/News/Shopping search, plus Trending Now for any country.

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

## Pricing

Pay per event

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: Related Queries, Compare & Trending Now

Get Google Trends data in bulk without opening a browser. Paste a list of keywords and get, for every one of them, **interest over time**, **interest by region**, and **related queries (top + rising)** in one clean JSON record. Or pull the full **Trending Now** list for any country.

It talks to Google Trends over plain HTTP instead of driving a headless browser, so runs are fast, cheap and rarely fail. Every request that Google rate-limits is retried automatically on a fresh residential IP.

### What you get

| Feature | Details |
|---|---|
| Bulk keywords | Hundreds of terms per run; one result per term |
| Compare up to 5 terms | Same 0-100 scale, exactly like the Trends website |
| Interest over time | Hourly to monthly points, with partial-period flag and average |
| Interest by region | Countries, regions/states, cities or US metro areas (DMA) |
| Related queries | Top and **rising** (incl. "Breakout") queries for each term |
| Search type | Web, **YouTube**, News, Images or **Google Shopping** |
| Time range | Past hour to 2004-present, or any custom date range |
| Category filter | Any Google Trends category (e.g. 22 = Books & Literature) |
| Trending Now | Full list per country (often 300-600 trends in the US) with search volume, % increase, start/end time, category and related searches |

### Use cases

- **SEO and content planning**: find rising queries before they peak and plan posts around seasonal spikes.
- **Product and niche research**: compare demand for products, book genres or app ideas across countries.
- **YouTube and Shopping research**: measure demand on YouTube search or Google Shopping, not only web search.
- **Newsrooms and social media**: monitor Trending Now in several countries every hour.
- **AI agents and automations**: call it from n8n, Make, Zapier or the Apify MCP server and feed structured trend data to your LLM.

### Input example: keyword analysis

```json
{
  "mode": "keywords",
  "searchTerms": ["cozy mystery", "romantasy", "dark academia"],
  "compareTerms": false,
  "geo": "US",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "relatedQueries": true
}
```

### Output example: one keyword

```json
{
  "type": "keyword",
  "term": "cozy mystery",
  "geo": "US",
  "timeRange": "today 12-m",
  "property": "web",
  "averageInterest": 55.0,
  "interestOverTime": [
    {"date": "Oct 12, 2025", "timestamp": 1760227200, "isPartial": false, "value": 42}
  ],
  "interestByRegion": [
    {"geoCode": "US-WY", "name": "Wyoming", "value": 100}
  ],
  "relatedQueries": {
    "top": [{"query": "cozy mystery books", "value": 100, "formattedValue": "100"}],
    "rising": [{"query": "agatha christie", "value": 110, "formattedValue": "+110%", "isBreakout": false}]
  },
  "exploreUrl": "https://trends.google.com/trends/explore?q=cozy%20mystery&date=today%2012-m&geo=US"
}
```

With **Compare terms** on, a result has `"type": "comparison"`, a `terms` list, and per-term `values` in every timeline point and region, plus related queries for each term under `related`.

### Input example: Trending Now

```json
{
  "mode": "trending",
  "trendingCountries": ["US", "GB", "DE"],
  "trendingHours": 24,
  "trendingCategory": 0,
  "trendingMaxItems": 100
}
```

Each trend:

```json
{
  "type": "trending",
  "rank": 1,
  "term": "world series 2026",
  "geo": "US",
  "searchVolume": 1000000,
  "increasePercent": 800,
  "startedAt": "2026-10-16T02:40:00+00:00",
  "endedAt": null,
  "isActive": true,
  "categories": ["Sports"],
  "relatedQueries": ["world series", "world series schedule"],
  "timeWindowHours": 24
}
```

### Pricing

Pay per result: you are charged for each keyword (or comparison group) result and for each trending item that is saved. Failed terms are reported with `"type": "error"` and are **not** charged. Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### Tips

- Google Trends values are **relative** (0-100) within one request. Use **Compare terms** when you need terms on the same scale.
- Short time ranges ("Past hour", "Past 4 hours") return minute-level points; "2004 - present" returns monthly points.
- Very rare terms may return empty related queries; that is Google's data, not an error.
- Keep the residential proxy on. Google blocks datacenter IPs quickly.

### FAQ

**Is scraping Google Trends legal?** The Actor only collects aggregated, anonymous statistics that Google shows publicly on trends.google.com. It collects no personal data. Check your own use case and local laws.

**Why are numbers not absolute search volumes?** Google Trends publishes relative interest, not volumes. Trending Now does include Google's approximate search volume buckets (e.g. 200K+, 1M+).

**Something broke or you need a field?** Open an issue on the Actor page.

# Actor input Schema

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

Keywords: analyse your search terms (timeline, regions, related queries and topics). Trending: today's Trending Now list for one or more countries.

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

One term per line. Each term becomes one result (or groups of 5 when 'Compare terms' is on).

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

Put terms side by side on the same 0-100 scale, in groups of up to 5 (Google's limit). Off = every term is scaled on its own.

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

Country code (US, GB, DE, PL...) or region code (US-CA, GB-ENG). Leave empty for worldwide.

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

Period to analyse. Ignored when 'Custom time range' is filled.

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

Overrides 'Time range'. Format: 2024-01-01 2024-12-31

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

Which Google search to measure.

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

Google Trends category (0 = all). Examples: 22 Books & Literature, 7 Finance, 45 Health, 18 Shopping, 958 Jobs & Education.

## `interestOverTime` (type: `boolean`):

Timeline of relative interest (0-100).

## `interestByRegion` (type: `boolean`):

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

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

Level of detail for 'Interest by region'.

## `relatedQueries` (type: `boolean`):

Top and rising search queries related to each term.

## `trendingCountries` (type: `array`):

Country codes for Trending Now, e.g. US, GB, DE, PL.

## `trendingHours` (type: `string`):

How far back Trending Now looks.

## `trendingCategory` (type: `string`):

Limit Trending Now to one category.

## `trendingActiveOnly` (type: `boolean`):

Skip trends that have already ended.

## `trendingMaxItems` (type: `integer`):

0 = all (often 300-600 in the US).

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

Language of topic names and dates, e.g. en-US, de, pl.

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

How many terms are processed in parallel.

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

Attempts per request, each on a fresh proxy IP.

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

Residential proxy is recommended; Google blocks datacenter IPs quickly.

## Actor input object example

```json
{
  "mode": "keywords",
  "searchTerms": [
    "cozy mystery",
    "romantasy"
  ],
  "compareTerms": false,
  "geo": "",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "category": 0,
  "interestOverTime": true,
  "interestByRegion": true,
  "regionResolution": "auto",
  "relatedQueries": true,
  "trendingCountries": [
    "US"
  ],
  "trendingHours": "24",
  "trendingCategory": "0",
  "trendingActiveOnly": false,
  "trendingMaxItems": 0,
  "language": "en-US",
  "maxConcurrency": 5,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Keyword, comparison and Trending Now records.

# 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": [
        "cozy mystery",
        "romantasy"
    ],
    "trendingCountries": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ksvan/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": [
        "cozy mystery",
        "romantasy",
    ],
    "trendingCountries": ["US"],
}

# Run the Actor and wait for it to finish
run = client.actor("ksvan/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": [
    "cozy mystery",
    "romantasy"
  ],
  "trendingCountries": [
    "US"
  ]
}' |
apify call ksvan/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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