# Google Trends Related Queries Scraper - Interest by City, DMA (`snow_leo_data/google-trends-scraper`) Actor

Google Trends data without a browser: interest over time, by region and city, related and rising queries, plus daily trending searches for 125 countries. Compare more than 5 keywords on one scale, with custom time ranges and categories. Runs via API and names the reason when a result is empty.

- **URL**: https://apify.com/snow_leo_data/google-trends-scraper.md
- **Developed by:** [Snow Leo Data](https://apify.com/snow_leo_data) (community)
- **Categories:** SEO tools, News, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 trend rows

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

../README.md

# Actor input Schema

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

Keywords to look up. A Google Trends topic id such as /m/05p0rrx works too and is treated as an entity rather than a string. Leave empty only when you ask for trending_now alone.

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

Which Google Trends surfaces to pull. Every choice becomes rows in the same table, told apart by the result_type column.

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

Country code such as US, or a sub-region such as US-CA or GB-ENG. Empty means worldwide. Google answers HTTP 400 to a code it does not know, so an unknown code is refused here before any request is made.

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

Period for interest, region and related data. Resolution follows the period: 1 hour gives minutes, 7 days gives hours, 12 months gives weeks, all gives months back to 2004.

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

Overrides Time range. Two dates separated by a space: 2024-01-01 2024-06-30. Anything else is refused before the run starts, because Google answers HTTP 400 to it.

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

Google Trends category id, 0 means all categories. Ids come from the same picker Google uses, for example 7 is Finance and 71 is Food & Drink.

## `searchType` (type: `string`):

Which Google surface the interest is measured on.

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

Granularity of interest_by_region. REGION gives states or provinces, CITY gives cities with coordinates, DMA gives the 210 US TV markets.

## `trendingGeos` (type: `array`):

Country codes for trending_now, for example US, GB, DE. Sub-regions such as US-CA work as well. Measured 2026-09-16: 125 of 208 ISO codes return trends.

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

How far back trending searches are taken. Measured for the US on 2026-09-16: 49 trends in 4 hours, 328 in 24 hours, 684 in 48 hours, 2860 in 7 days.

## `trendingMinVolume` (type: `integer`):

Keep only trends with at least this many searches. 0 keeps everything. A trend without a volume is kept: missing data is not a mismatch.

## `trendingCategories` (type: `array`):

Keep only these trend categories, by id: 1 Autos, 2 Beauty, 3 Business, 4 Entertainment, 5 Food, 6 Games, 7 Health, 8 Hobbies, 9 Jobs, 10 Law, 11 Other, 13 Pets, 14 Politics, 15 Science, 16 Shopping, 17 Sports, 18 Technology, 19 Travel, 20 Climate. Empty keeps all.

## `includeTrendNews` (type: `boolean`):

Adds news titles, links and sources from the Google Trends RSS feed. The feed carries 10 trends per country, so headlines land only on those; the rest keep their numeric article ids.

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

Stop after this many rows are DELIVERED to the dataset, not after this many are collected. 0 means no limit.

## `onlyNew` (type: `boolean`):

Remembers delivered rows between runs in a named key-value store and skips the unchanged ones, so a schedule does not pay for the same data twice.

## `emitUnchanged` (type: `boolean`):

Only matters with Only new: delivers unchanged rows too, marked UNCHANGED in change_type.

## `compactOutput` (type: `boolean`):

Keeps only the columns the data type exists for, dropping run metadata. Useful for AI agents and for spreadsheets.

## `excludeEmptyFields` (type: `boolean`):

Drops null and empty columns from each row instead of writing them out.

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

Interface language for Google Trends, for example en-US or de-DE. It changes region names and the wording of formatted values, not the data itself.

## `requestPauseSecs` (type: `string`):

Measured on 2026-09-16: 34 requests back to back from Apify raised no rate limit, but several hundred within minutes did, and only waiting cleared it (a fresh cookie did not). The default pause keeps a run well inside that.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt"
  ],
  "dataTypes": [
    "interest_over_time",
    "related_queries"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "searchType": "web",
  "regionResolution": "REGION",
  "trendingGeos": [
    "US"
  ],
  "trendingHours": "24",
  "trendingMinVolume": 0,
  "includeTrendNews": false,
  "maxItems": 0,
  "onlyNew": false,
  "emitUnchanged": false,
  "compactOutput": false,
  "excludeEmptyFields": false,
  "language": "en-US",
  "requestPauseSecs": "0.35"
}
```

# Actor output Schema

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

All collected rows

# 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"
    ],
    "dataTypes": [
        "interest_over_time",
        "related_queries"
    ],
    "geo": "US",
    "trendingHours": "24"
};

// Run the Actor and wait for it to finish
const run = await client.actor("snow_leo_data/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"],
    "dataTypes": [
        "interest_over_time",
        "related_queries",
    ],
    "geo": "US",
    "trendingHours": "24",
}

# Run the Actor and wait for it to finish
run = client.actor("snow_leo_data/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"
  ],
  "dataTypes": [
    "interest_over_time",
    "related_queries"
  ],
  "geo": "US",
  "trendingHours": "24"
}' |
apify call snow_leo_data/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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