# Google Trends Scraper – Tube Atlas & Search Interest (`utils/google-trends-actor`) Actor

Scrape Google Trends at scale: interest-over-time for up to 200 keywords, regional breakdown, custom date ranges and 5 search types (Web, Images, News, YouTube, Shopping), plus live Trending Searches by country. Fully automated — add keywords, get clean JSON straight to your dataset.

- **URL**: https://apify.com/utils/google-trends-actor.md
- **Developed by:** [Oliver Queen](https://apify.com/utils) (community)
- **Categories:** Automation, E-commerce, SEO tools
- **Features:** Limited permissions
- **Stats:** 4 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 4.67 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

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

keyword: scrape interest-over-time for each keyword. trending: scrape Google's live Trending Now searches (no keywords needed).

## `trendingGeo` (type: `string`):

Country code to fetch trending searches for.

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

How far back to look.

## `trendingSort` (type: `string`):

Ordering of results.

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

Filter trending searches by topic.

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

Keep the top N items per geo (1-500).

## `keywords` (type: `array`):

Keywords to query (max 200).

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

Country code. Also used by trending mode when its Country is unset.

## `time` (type: `string`):

Keyword mode: Google Trends time parameter.

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

Keyword mode: optional exact historical window. When filled, it replaces Time range above. Format: YYYY-MM-DD YYYY-MM-DD, e.g. "2022-11-01 2022-12-18". Constraints: valid calendar dates, start on/before end, start on/after 2004-01-01, end not in the future. Invalid ranges fail the run immediately with a clear error instead of returning 400s from Google.

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

Google Trends search property. Note: News Search has limited historical coverage — for custom date ranges far in the past, many keywords legitimately return no data (empty on Google's own UI too). Web Search is recommended for historical research.

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

Google Trends category filter - the cat= URL parameter (0 = all categories). Pick a category in the Google Trends UI and copy its id from the address bar.

## `fetchRegional` (type: `boolean`):

Include interest by region (state/city) breakdown for each keyword. Adds ~1 extra API call per batch. On by default; untick if you only need the series.

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

Geographic depth of the regional breakdown (only used when Fetch regional data is on). Auto = Google's default (country/region level). City/DMA needs 'Include low-volume geos' on (default).

## `includeLowVolumeGeos` (type: `boolean`):

Return every geo Google knows, including very low-volume ones. Needed for Region resolution City/DMA (without it Google replies with mostly empty rows).

## `fetchRelated` (type: `boolean`):

Add top & rising related queries for every keyword. Costs 1 extra API call per keyword, no extra per-event fee. On by default so real runs include related queries; untick for cheap series-only bulk runs.

## `fetchRelatedTopics` (type: `boolean`):

Experimental: top & rising related topics (Knowledge Graph entities with mid ids). Costs 2 extra API calls per keyword (a single-keyword explore + the topics widget). NOTE: since ~2025 Google serves this feed only to logged-in sessions — anonymous runs usually get empty lists (the fetch is best-effort and never fails the run).

## `outputType` (type: `string`):

flat (default): one row per data point - ready for CSV/Excel export and the dataset views. grouped: one row per keyword with points/dates/regions arrays - best for API consumers.

## `includeSummary` (type: `boolean`):

Include per-keyword summary rows (average, peak value/date, latest value/date) computed from the timeline. Free — no extra API calls.

## `logLevel` (type: `string`):

summary (default): 10%% progress lines only. raw: full engine/scheduler log — use when debugging a run.

## `egressFallback` (type: `string`):

What to do when no local WARP tunnel answers the startup probe. 'free' scans public proxies (~8-10s), 'direct' skips the scan and uses the direct source only, 'none' fails the run instead of returning 429-affected partial data. Has no effect while tunnels are up (the free scan is skipped entirely).

## `useDirect` (type: `boolean`):

Also fetch through this machine's own IP (no proxy), interleaved with the proxy rotation. Turns itself off for the rest of the run after 3 consecutive blocks, so it is only a cost when Google accepts the direct IP.

## `rpmPerTunnel` (type: `integer`):

Pacing cap per unique egress IP, in HTTP requests per minute. Lanes that present the same IP share one budget: the run probes each tunnel's egress IP at startup (Cloudflare hands WARP tunnels a small rotating IP pool, so several tunnels often look like one IP) and groups their pacing together. Prevents Google 429s proactively; 0 disables pacing. 14 fits Google's measured 10-15 req/min/IP ceiling and is what keeps a 200-keyword run under ~20s; lower it (e.g. 6) when several runs execute concurrently.

## Actor input object example

```json
{
  "mode": "keyword",
  "trendingGeo": "US",
  "trendingHours": "24",
  "trendingSort": "relevance",
  "trendingCategory": "all",
  "trendingMaxItems": 20,
  "keywords": [
    "artificial intelligence"
  ],
  "geo": "US",
  "time": "today 12-m",
  "property": "",
  "category": 0,
  "fetchRegional": true,
  "regionResolution": "",
  "includeLowVolumeGeos": true,
  "fetchRelated": true,
  "fetchRelatedTopics": false,
  "outputType": "flat",
  "includeSummary": true,
  "logLevel": "summary",
  "egressFallback": "free",
  "useDirect": true,
  "rpmPerTunnel": 14
}
```

# Actor output Schema

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

No description

# 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 = {
    "keywords": [
        "artificial intelligence"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("utils/google-trends-actor").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 = { "keywords": ["artificial intelligence"] }

# Run the Actor and wait for it to finish
run = client.actor("utils/google-trends-actor").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 '{
  "keywords": [
    "artificial intelligence"
  ]
}' |
apify call utils/google-trends-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,utils/google-trends-actor"
        }
    }
}
```

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/Sv1WetfGh5QcHP5l0/builds/slms1L6r16bb8e3NE/openapi.json
