# Google Trends Scraper — Interest, Regions & Related Queries (`silentshadow55/google-trends-actor`) Actor

Google Trends data as a fast API — no browser, no pytrends. Interest over time, interest by region, related & rising queries for any term, worldwide or by country/state, across Web, YouTube, News, Images & Shopping. Compare up to 5 terms on one scale. Built for scheduled monitoring.

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

## Pricing

from $5.00 / 1,000 trend results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Trends Scraper — Interest Over Time, Regions & Related Queries

Get **Google Trends data as a fast, reliable API**: interest over time, interest by region, related queries, and rising topics for any search term — worldwide or for any country, state, or metro area, across **Web, YouTube, News, Images, and Shopping** search.

**No browser. No pytrends. No 429 roulette.** This Actor speaks directly to the same JSON endpoints the Trends website uses, with automatic session rotation and backoff when Google rate-limits — so runs are fast (seconds per term, not minutes) and cheap.

### Why this exists

- **Google Trends has no official public API** (the long-promised one is still in limited alpha).
- **pytrends, the Python library everyone used for a decade, was abandoned in April 2025** and no longer works reliably.
- Browser-based Trends scrapers are slow, expensive, and flaky — a headless Chrome per keyword to fetch what is ultimately a JSON response.

This Actor is the missing piece: pytrends' functionality, maintained, as a pay-per-result API.

### What you get per search term

- 📈 **Interest over time** — the full 0–100 series at Google's finest granularity for your timeframe (hourly/daily/weekly), with partial-period flags, plus computed `average_interest` and `peak`
- 🗺️ **Interest by region** — countries, states/regions, cities, or US metro areas (DMA)
- 🔍 **Related queries** — top and **rising** (including "Breakout" markers — the early-signal goldmine)
- 🏷️ **Related topics** — top and rising topic entities (Google serves these less reliably than related queries; when Trends has none for a term, the field is an explicit empty `{"top": [], "rising": []}`, never a missing column)
- ⚖️ **True compare mode** — up to 5 terms normalized on one shared 0–100 scale, exactly like the Trends UI comparison (independent scaling when off)
- 🌐 **All five search properties** — Web, YouTube, News, Images, Shopping

### Example output

Every item carries the same fields (an unrequested or empty dataset is an explicit `null`/`[]`, never a missing column), so exports stay rectangular:

```json
{
  "term": "chatgpt",
  "geo": "US",
  "timeframe": "today 12-m",
  "category": 0,
  "property": "web",
  "compared_with": null,
  "interest_over_time": [
    { "date": "Jul 6, 2026", "timestamp": 1751760000, "value": 71, "is_partial": false }
  ],
  "average_interest": 78.9,
  "peak": { "date": "Oct 19, 2025", "value": 100 },
  "interest_by_region": [
    { "geo_code": "US-UT", "geo_name": "Utah", "value": 100 }
  ],
  "related_queries": {
    "top": [ { "query": "chatgpt login", "value": 100, "formatted_value": "100", "link": "https://trends.google.com/trends/explore?q=chatgpt+login" } ],
    "rising": [ { "query": "chatgpt agents", "value": 0, "formatted_value": "Breakout", "link": "https://trends.google.com/trends/explore?q=chatgpt+agents" } ]
  },
  "related_topics": { "top": [], "rising": [] },
  "errors": []
}
```

### Input

```json
{
  "searchTerms": ["standing desk", "walking pad"],
  "geo": "US",
  "timeframe": "today 12-m",
  "compareAllTerms": true,
  "dataTypes": ["interestOverTime", "relatedQueries"]
}
```

Timeframes: `now 1-H` → `today 5-y`, `all`, or custom ranges like `2025-01-01 2025-06-30`. Geo: country (`US`), region (`US-TX`), or empty for worldwide.

### Who uses this

- **SEO & content teams** — seasonality, topic momentum, and rising queries before they're competitive
- **E-commerce & product research** — validate demand and spot breakout products by region
- **Investors & analysts** — search interest as an alternative data signal
- **Journalists & researchers** — quantify attention around events and narratives
- **AI agents** — "is interest in X growing?" answered with real data via Apify's MCP integration

### FAQ

**Is there an official Google Trends API?** No — Google's announced API remains limited-access alpha. The Trends website is the only public source, and this Actor reads the same JSON its charts read.

**Is this a pytrends replacement?** Yes, deliberately. pytrends was archived in April 2025. This Actor covers its core surface (interest over time, interest by region, related queries/topics, categories, properties, compare mode) without you maintaining cookies, retries, or proxies.

**What do the 0–100 values mean?** Google normalizes each request: 100 = peak popularity within *your* timeframe/geo/term-set. Values are relative, not absolute search volumes. Use `compareAllTerms` to make multiple terms share one scale.

**How does it handle Google's rate limits?** Polite pacing, exponential backoff, automatic cookie-session rotation, and per-session proxy identities via Apify Proxy. Failed sub-requests are reported per-term in an `errors` field rather than failing your whole run.

**Can I export CSV/Excel?** Yes — every run's dataset downloads as JSON, CSV, XLSX, or XML, and is reachable via API, webhooks, and integrations (Google Sheets, Make, Zapier, LangChain).

**Is this legal?** It reads the same publicly available, aggregated, anonymized statistics Google publishes to every visitor at trends.google.com.

### Pricing

Pay-per-result: **each search term is one result** (~half a cent at $5 per 1,000 terms), plus platform usage. A 50-keyword SEO sweep costs about a quarter; a daily 5-term brand tracker runs for pennies a month on an [Apify schedule](https://docs.apify.com/platform/schedules). No subscription, no seat — you pay for the terms you actually check.

### Roadmap

- Daily trending searches / real-time trends endpoint
- Long-format output option (one row per data point, Sheets-ready)
- Autocomplete/topic-entity resolution (search "mercury" → pick planet vs element)

Found a term or geo that misbehaves? Open an issue — fixes ship fast.

***

**Building something on this actor?** Open an issue on the Issues tab and say what you're working on - real use cases get priority fixes and shape the roadmap.

# Actor input Schema

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

Terms to get Google Trends data for. Each term produces one result item. Use quotes inside a term for exact-match behavior, or a topic like 'chatgpt'.

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

Time range: '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', or a custom range like '2025-01-01 2025-06-30'.

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

Two-letter country code ('US', 'GB', 'DE'), a region code ('US-TX'), or empty for worldwide.

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

Which Google property to measure interest on.

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

Google Trends category to narrow results (0 = all categories). Find IDs in the Trends UI URL after picking a category, e.g. 71 = Food & Drink.

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

Which Trends datasets to fetch for each term. Fewer types = faster, cheaper runs.

## `compareAllTerms` (type: `boolean`):

When on (2-5 terms), all terms are normalized together on one 0-100 scale so values are directly comparable — exactly like adding comparison terms in the Trends UI. When off, each term is scaled independently.

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

Granularity for 'interest by region'. Leave unset for automatic (countries for worldwide, states/regions for a country). Forcing a level that doesn't fit the geo can return no data.

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

Proxies to use. Google rate-limits IPs aggressively, so keep Apify Proxy enabled; switch to residential groups if you run very large term lists.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt"
  ],
  "timeframe": "today 12-m",
  "geo": "",
  "searchProperty": "web",
  "category": 0,
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "compareAllTerms": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("silentshadow55/google-trends-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ]
}' |
apify call silentshadow55/google-trends-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=silentshadow55/google-trends-actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/59AeCAwoLgovzkrEl/builds/XeumeGZTxlSZYh9mQ/openapi.json
