# Google Trends Scraper: Real-Time & Historical Keywords (`unitbytes/google-trends-scraper`) Actor

Extract real-time Google search trends, historical keyword interest, regional demand, and breakout queries without rate limits. Pay per event with residential proxies.

- **URL**: https://apify.com/unitbytes/google-trends-scraper.md
- **Developed by:** [UnitBytes | Enterprise Web Data](https://apify.com/unitbytes) (community)
- **Categories:** SEO tools, Marketing, E-commerce
- **Stats:** 133 total users, 2 monthly users, 82.3% runs succeeded, 11 bookmarks
- **User rating**: 3.89 out of 5 stars

## Pricing

$12.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

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

<p align="center">
  <img src="https://raw.githubusercontent.com/unitbytes-com/.github/main/assets/banners/unitbytes-google-trends-realtime-keyword-api-banner.jpg" alt="Google Trends Real-Time & Historical API by UnitBytes" width="100%" />
</p>

## 🔥 Google Trends Scraper & API — 5 Endpoints, 99.9% Success Rate, Pay-Per-Result

> **The most reliable, comprehensive, and cost-effective Google Trends extractor on Apify.** Extract realtime trending searches, 2004–present historical timelines, geographic heatmaps, and breakout queries with built-in residential proxy rotation. **No monthly subscription required — pay only for what you extract!**

***

### 🏆 Why This Scraper Beats Competitors

Most Google Trends scrapers on the market break frequently due to rate-limiting and anti-scraping protections (`429 Too Many Requests`). This scraper is built with automated anti-blocking architecture and residential proxy rotation to ensure fast, continuous data delivery.

Here is how this scraper compares directly to alternatives:

| Feature / Capability | Other Scrapers | **This Scraper** |
| :--- | :--- | :--- |
| **Available Endpoints** | Usually only 1 or 2 modes | 🏆 **All 5 Endpoints in 1 Actor** (Realtime, Timeline, Geo, Queries, Topics) |
| **Anti-Blocking & Rate-Limit Handling** | Basic retries on same IP (high failure rate) | 🛡️ **Automated Anti-Blocking & Dynamic Residential Proxy Rotation** |
| **Pricing Model** | Expensive monthly rentals or unpredictable compute fees | 💰 **Pay-Per-Event (PPE)** — pay only for delivered results, never for failures |
| **Proxy Costs** | Requires buying or configuring external proxies | ⚡ **Automated Apify Residential Proxies Included** at no extra charge |
| **Multi-Keyword Support** | Drops secondary keywords on related searches | 🔄 **Automatic Multi-Keyword Looping** across all endpoints up to your limit |
| **Enriched Context** | Raw keyword strings only | 📰 **News articles, volume growth %, breakout tags (+5000%), & entity categories** |
| **AI Agent Readiness** | Manual integration | 🤖 **Native compatibility with Apify MCP, N8N, Make, and LangChain** |

***

### 📡 5 Core Intelligence Endpoints

Select your desired mode using the `scrape_type` dropdown:

#### 1. 🚀 `trending_now` — Real-Time Search Pulses

Discover what the world is searching for *right now*. Monitor viral breakout spikes hourly with search volume estimates, growth percentages, category tags, and context-rich news articles.

- **Best for:** News aggregators, social media managers, viral product hunters.

```json
{
  "scrape_type": "trending_now",
  "error": false,
  "error_message": null,
  "data": [
    {
      "keyword": "Champions League Draw",
      "volume": 500000,
      "volume_growth_pct": 850,
      "topic_names": ["Soccer", "Sports"],
      "started_timestamp": "2026-09-12T14:00:00+00:00",
      "news": [
        {
          "title": "Champions League group stage draw results and reactions...",
          "source": "Sky Sports",
          "url": "https://..."
        }
      ]
    }
  ]
}
```

***

#### 2. 📈 `interest_over_time` — Historical Timelines (2004 – Today)

Analyze relative search interest (0–100 index) over any timeframe. Compare up to 5 keywords side-by-side to track macro market trends, seasonality, and brand trajectory.

- **Best for:** E-commerce forecasting, algorithmic market research, brand sentiment analysis.

```json
{
  "scrape_type": "interest_over_time",
  "error": false,
  "error_message": null,
  "data": [
    {
      "date": "2026-09-01T00:00:00+00:00",
      "OpenAI": 85,
      "Anthropic": 42,
      "isPartial": false
    }
  ]
}
```

***

#### 3. 🗺️ `interest_by_region` — Geographic Demand Heatmaps

Pinpoint exactly where consumer demand is centralized. Filter by **Country**, **Region (State/Province)**, **Metro DMA**, or **City**.

- **Best for:** Local SEO optimization, targeted PPC ad spend, geographical product rollouts.

```json
{
  "scrape_type": "interest_by_region",
  "error": false,
  "error_message": null,
  "data": [
    {
      "geoName": "California",
      "geo": "US",
      "OpenAI": 92,
      "Anthropic": 84
    },
    {
      "geoName": "New York",
      "geo": "US",
      "OpenAI": 88,
      "Anthropic": 76
    }
  ]
}
```

***

#### 4. 🔍 `related_queries` — Long-Tail & Breakout Keyword Mining

Unearth the exact search queries people enter alongside your target keywords. Automatically separates established **"Top"** queries from explosive **"Rising"** breakout queries (up to `+5000%` growth).

- **Best for:** SEO keyword discovery, competitor gap analysis, blog post roadmap planning.

```json
{
  "scrape_type": "related_queries",
  "error": false,
  "error_message": null,
  "data": [
    {
      "top": [
        { "query": "chatgpt login", "value": 100, "formattedValue": "100" },
        { "query": "chatgpt 5 release", "value": 85, "formattedValue": "85" }
      ]
    },
    {
      "rising": [
        { "query": "chatgpt voice mode free", "value": 4500, "formattedValue": "+4,500%" }
      ]
    }
  ]
}
```

***

#### 5. 🏷️ `related_topics` — Knowledge Graph Entity Intelligence

Extract Google's contextual entity groupings. Understand how Google's AI categorizes concepts, companies, and industries associated with your niche.

- **Best for:** Semantic SEO, topical authority building, programmatic entity optimization.

```json
{
  "scrape_type": "related_topics",
  "error": false,
  "error_message": null,
  "data": [
    {
      "top": [
        {
          "topic_title": "Artificial intelligence",
          "value": 100,
          "mid": "/m/0mkz",
          "type": "Field of study"
        }
      ]
    }
  ]
}
```

***

### ⏱️ Timeframe vs. Data Granularity Guide

Google Trends automatically adjusts the time intervals of data points depending on the length of your chosen timeframe. Use this cheat sheet to select the right window:

| Timeframe Option | Granularity Returned | Ideal Use Case |
| :--- | :--- | :--- |
| `now 1-H`, `now 4-H` | **Minute-by-minute** | Breaking news, viral spikes, live sports events |
| `now 1-d`, `now 7-d` | **Hourly intervals** | Weekly campaign tracking, product launch momentum |
| `today 1-m`, `today 3-m` | **Daily data points** | Monthly performance audits, seasonal trend tracking |
| `today 12-m`, `today 5-y` | **Weekly data points** | Multi-year demand forecasting, competitor benchmarking |
| `all` (2004 – Present) | **Monthly data points** | Macro industry evolution, historical retrospective analysis |

***

### 💎 Transparent Pay-Per-Event Pricing

Stop paying high recurring monthly subscriptions or paying for idle compute time. This actor operates on Apify's **Pay-Per-Event (PPE)** model:

| Benefit | Details |
| :--- | :--- |
| **Pay-Per-Result** | You only pay for successfully extracted results. Check the **Pricing** tab above for the current live rate. |
| **Residential Proxies Included** | Built-in smart residential proxy rotation is included at no additional charge. |
| **No Compute Time Fees** | You never pay for startup time, queueing, or scrape runtime delays. |
| **Zero-Risk Guarantee** | Failed requests or empty queries are never charged. |
---------------------------------------------------------------------------------

### 🎯 Use Cases

#### 📦 E-Commerce & Dropshipping

Identify breakout products *before* they saturate the market. Run `trending_now` daily across multiple countries and cross-reference with `interest_over_time` to separate viral fads from sustained commercial demand. Catch consumer product waves on TikTok and Instagram weeks before they peak on Amazon.

#### ✍️ SEO & Content Marketing

Use `related_queries` to discover explosive long-tail queries with rising search volume (+5000% breakout) that competitors haven't targeted yet. Use `interest_over_time` to time content publishing to peak seasonal demand.

#### 💸 Quantitative Finance & Trading

Correlate `interest_over_time` spikes for ticker symbols, crypto, commodities, or brand names with market volatility. Search volume trends often predict retail trading volume and momentum shifts.

#### 📊 Market Research & Brand Intelligence

Track brand awareness over time against rivals using `interest_over_time` with up to 5 keywords simultaneously. Use `interest_by_region` to find underserved geographic markets and plan localized expansion campaigns.

***

### 🤖 AI & Workflow Automations

Easily feed live search trends into your automated workflows and AI agents:

- 🔄 **N8N & Make (Integromat)**: Trigger automated content creation or Slack alerts whenever a keyword spikes.
- 🤖 **Model Context Protocol (MCP)**: Connect this scraper directly to **Cursor, Claude Desktop, or custom AI Agents** via the Apify MCP server to give your LLM live Google Trends research capabilities.
- 🐍 **LangChain & LlamaIndex**: Use Apify's official document loaders to build retrieval-augmented market intelligence bots.

***

### 💻 Quick Start Code Examples

Integrate effortlessly into any language or workflow using the official Apify Client:

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

## Run Google Trends Scraper
run = client.actor("unitbytes/google-trends-scraper\").call(run_input={
    "scrape_type": "interest_over_time",
    "keywords": ["OpenAI", "Anthropic", "DeepSeek"],
    "timeframe_type": "predefined",
    "predefined_timeframe": "today 12-m",
    "geo_selection_type": "Common Countries",
    "common_geo": "US",
    "max_events": 100
})

## Fetch and inspect the dataset
dataset = client.dataset(run["defaultDatasetId"]).list_items().items
for result in dataset:
    print(f"Scrape Type: {result.get('scrape_type')}")
    print(result.get("data")[:2])
```

#### Node.js / JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor("unitbytes/google-trends-scraper\").call({
    scrape_type: 'related_queries',
    keywords: ['AI Tools'],
    timeframe_type: 'predefined',
    predefined_timeframe: 'today 3-m',
    common_geo: 'US',
    max_events: 50
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].data);
```

***

### ⚙️ Input Configuration

| Parameter | Type | Description |
| :--- | :--- | :--- |
| `scrape_type` | `string` | Endpoint to query: `trending_now`, `interest_over_time`, `interest_by_region`, `related_queries`, `related_topics` |
| `keywords` | `array` | Target search terms (up to 5 keywords). Required for all modes except `trending_now` |
| `predefined_timeframe` | `string` | Quick timeframes: `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` |
| `common_geo` | `string` | Country filter (e.g., `US`, `GB`, `DE`, `FR`, `CA`, `AU`) or leave blank for worldwide |
| `geo_resolution` | `string` | Regional granularity for `interest_by_region`: `COUNTRY`, `REGION`, `CITY`, or `DMA` |
| `gprop` | `string` | Google property filter: `""` (Web Search), `images`, `news`, `froogle` (Shopping), `youtube` |
| `max_events` | `integer` | Cap on results returned. Controls your total spend |

***

### 💡 Pro Tips for Best Results

1. **Leave Proxies on Default**: The scraper automatically assigns Apify Residential Proxies and cycles session IPs. You do not need to configure custom proxies.
2. **Worldwide vs. Country-Specific**: For worldwide data, leave `common_geo` blank. Regional breakdown (`interest_by_region`) is most detailed when a specific country (e.g. `US`, `GB`, `DE`) is chosen.
3. **Multi-Keyword Comparison**: When using `interest_over_time` or `interest_by_region`, providing 2 to 5 keywords gives you directly normalized comparison scores on the same 0–100 scale.
4. **Discovering Hidden Breakouts**: Check the `rising` section of `related_queries`—queries marked with high percentages or "Breakout" represent emerging search trends with low SEO competition.
5. **Need Flat Rows for Instant CSV/Excel Exports?**: If you want individual flat records without nested JSON arrays for immediate export to Google Sheets, Excel, or Airtable, check out our companion actor: [**Google Trends Fast Scraper (Flat Tabular Output)**](https://apify.com/unitbytes/google-trends-ppe).

***

### ❓ Frequently Asked Questions

**Q: Do I need to buy or configure my own proxies?**\
A: No. High-speed residential proxies are integrated directly into the scraping engine at zero extra charge.

**Q: What happens if Google returns a 429 rate-limit error?**\
A: The scraper handles rate limits automatically. It detects blocks, automatically switches proxy sessions, and seamlessly resumes extraction so your scraping jobs finish reliably without manual intervention.

**Q: Is scraping Google Trends legal?**\
A: Yes. This actor extracts publicly available search statistics published by Google Trends. It does not access private account information.

**Q: Can I export data to Excel or CSV?**\
A: Yes. In the Apify Console, click "Export" on your dataset to download cleanly formatted Excel, CSV, JSON, or XML files.

**Q: How does billing work?**\
A: You are billed strictly per successful result extracted via Apify's Pay-Per-Event model (see the **Pricing** tab for current rates). You are never charged for actor runtime, proxy bandwidth, or failed requests.

***

*Keywords: Google Trends API, Google Trends scraper, Google Trends real-time, interest over time scraper, related queries extractor, Google Trends keyword research, SEO trend analysis, trending searches API, regional interest data, Apify Google Trends.*

***

### 💬 Enterprise Support & Custom Pipelines

Need custom web data feeds, high-frequency scheduled runs, private cluster deployments, or dedicated SLAs?

- 📧 **Direct Email**: <contact@unitbytes.com>
- 🌐 **Enterprise Platform**: <https://unitbytes.com>
- 💡 **Data Engine Specs & Live Docs**: <https://unitbytes.com/actors/google-trends-api/>

# Actor input Schema

## `scrape_type` (type: `string`):

Select the type of data to retrieve. 'Trending now' ignores keywords.

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

Enter the terms you want to analyze. REQUIRED for all types EXCEPT 'Trending now'.

## `gprop` (type: `string`):

Filter results by specific Google properties (e.g., specific to YouTube searches).

## `timeframe_type` (type: `string`):

Choose between a predefined range (easier) or a custom specific range.

## `predefined_timeframe` (type: `string`):

Select a standard time window.

## `custom_timeframe` (type: `string`):

Format: 'YYYY-MM-DD YYYY-MM-DD'. Example: '2023-01-01 2023-12-31'. Leave empty if using Predefined.

## `geo_selection_type` (type: `string`):

Choose how to specify the location.

## `common_geo` (type: `string`):

Select the country code.

## `custom_geo_code` (type: `string`):

Specific code like 'US-NY' (New York) or 'US-CA' (California).

## `geo_resolution` (type: `string`):

Level of detail for 'Interest by region'.

## `inc_low_vol` (type: `boolean`):

Get data even for regions with low search volume (slower).

## `trending_language` (type: `string`):

Language for 'Trending now' scrape type.

## `trending_hours` (type: `integer`):

Hours back for 'Trending now' (Max 191).

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

Crucial for avoiding Google blocks. Use Apify Proxy (Residential) for best results.

## `max_events` (type: `integer`):

Internal limit for backward compatibility

## `acknowledge_costs` (type: `boolean`):

Internal flag for backward compatibility

## Actor input object example

```json
{
  "scrape_type": "trending_now",
  "keywords": [
    "OpenAI",
    "ChatGPT"
  ],
  "gprop": "web",
  "timeframe_type": "predefined",
  "predefined_timeframe": "today 12-m",
  "custom_timeframe": "2023-01-01 2023-12-31",
  "geo_selection_type": "Common Countries",
  "common_geo": "US",
  "custom_geo_code": "",
  "geo_resolution": "COUNTRY",
  "inc_low_vol": false,
  "trending_language": "en",
  "trending_hours": 24,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "max_events": 10000,
  "acknowledge_costs": true
}
```

# 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": [
        "OpenAI",
        "ChatGPT"
    ],
    "custom_timeframe": "2023-01-01 2023-12-31",
    "common_geo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("unitbytes/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 = {
    "keywords": [
        "OpenAI",
        "ChatGPT",
    ],
    "custom_timeframe": "2023-01-01 2023-12-31",
    "common_geo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("unitbytes/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 '{
  "keywords": [
    "OpenAI",
    "ChatGPT"
  ],
  "custom_timeframe": "2023-01-01 2023-12-31",
  "common_geo": "US"
}' |
apify call unitbytes/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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