# Google Trends Scraper — Real-Time Trends & YouTube (`datasiphon/google-trends-scraper`) Actor

The fastest Google Trends API on Apify. Scrape interest over time, geographic breakdowns, rising queries, and real-time trending searches for 125+ countries across Web, YouTube, News, Images & Shopping with direct publisher links. 256 MB RAM, <1.5s per run.

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

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

## 📈 Google Trends Scraper — Real-Time Trends, Multi-Keyword Compare & YouTube

<p align="center">
  <img src="https://img.shields.io/badge/Reliability-99.9%25-brightgreen?style=for-the-badge" alt="Reliability">
  <img src="https://img.shields.io/badge/RAM-256%20MB%20(16x%20Cheaper)-blue?style=for-the-badge" alt="RAM">
  <img src="https://img.shields.io/badge/Speed-%3C%201.5s-orange?style=for-the-badge" alt="Speed">
  <img src="https://img.shields.io/badge/Properties-5%20Google%20Properties-purple?style=for-the-badge" alt="Properties">
  <img src="https://img.shields.io/badge/Countries-125%2B%20Supported-success?style=for-the-badge" alt="Countries">
</p>

> **The fastest, most reliable Google Trends API on Apify.** Extract historical interest over time, geographic breakdowns, rising queries, related topics, and real-time trending searches for 125+ countries across **Web, YouTube, News, Images, and Google Shopping**. Zero browser overhead, sub-second execution, and 100% direct clickable original publisher news links.

***

### ⚡ Why Choose This Google Trends Scraper Over Competitors?

| Feature / Capability | Official Apify Scraper | Other Fast Scrapers | **Our Scraper (DataSiphon)** |
| :--- | :--- | :--- | :--- |
| **Reliability (Failure Rate)** | ❌ **37.52% (Fails 1 in 3)** | 0.65% | ✅ **< 0.5% (Hardened TLS Impersonation)** |
| **Container RAM (Cost)** | 💸 **4,096 MB (Burns 16x compute)** | 256 MB | 🟢 **256 MB (Lowest possible compute cost)** |
| **Speed per Query** | 🐢 30 – 60 seconds | ⚡ 1 – 3 seconds | 🚀 **< 1.5 seconds** |
| **Architecture** | Heavy Headless Chrome | Basic HTTP | **Pure HTTP + Chrome 124 TLS Fingerprinting** |
| **Multi-Keyword Comparison** | ✅ Yes (normalized) | ❌ **No (Single keyword only)** | ✅ **Yes (True normalized multi-line scale)** |
| **Search Properties** | ❌ Web search only | ❌ Web search only | ✅ **All 5: Web, YouTube, News, Images, Shopping** |
| **Trending Now Feed** | ❌ No (legacy only) | ⚠️ Missing article URLs | ✅ **Yes (125+ countries, dual API + RSS fallback)** |
| **Original Publisher News Links**| ❌ N/A | ❌ Truncated / missing URLs | ✅ **100% Direct Links (`primaryArticleUrl`, `allArticleUrls`)** |
| **Category Selection** | Raw integer input | Trending only | ✅ **Native UI Dropdown (All 25 official categories)** |
| **Date Selection** | Plain text string | Predefined only | ✅ **Interactive Calendar Datepickers (`editor: "datepicker"`)** |
| **Related Queries & Topics** | ✅ Yes (Top & Rising) | ❌ **Disabled in keyword mode** | ✅ **Top & Rising with Breakout tagging** |
| **Trend Analytics & Velocity** | ❌ None | ❌ None | ✅ **Trend Velocity, Volatility Index, Peak Detection** |
| **Breakout Detection** | ❌ Raw string only | ❌ No | ✅ **`isBreakout: true` + Growth Momentum Score** |

***

### 🎯 Key Features & Differentiators

- 🚀 **Zero Browser Overhead**: Built on top of high-performance HTTP with Chrome 124 TLS fingerprinting (`curl_cffi`). No headless browser crashes, no DOM hydration timeouts, and no massive compute bills.
- 🥊 **Head-to-Head Multi-Keyword Comparison**: Compare up to 5 keywords simultaneously on Google's true normalized 0–100 scale. Automatically calculates **Share of Search Interest (%)** per brand/keyword.
- 📺 **All 5 Google Search Properties**:
  - `web` — Google Web Search (General consumer demand)
  - `youtube` — YouTube Video Search (Essential for creators and video SEO)
  - `news` — Google News (PR & media monitoring)
  - `images` — Google Images Search (Product design & visual trends)
  - `froogle` — Google Shopping (E-commerce purchase intent)
- 🔥 **Dedicated Trending Now Feed with Direct News Links**: Scrapes breaking news topics matching `trends.google.com/trending`. Unlike competitors, **never misses a news link**: returns `primaryArticleUrl`, `primaryArticleSource`, `primaryArticleTitle`, and `allArticleUrls` so clicking opens the publisher's actual article (e.g. Washington Post, CBS News, FOX Sports, NYT).
- 📅 **Interactive Calendar Date Pickers**: Select custom date ranges visually with calendar widgets (`startDate` and `endDate`) or choose from native Google Trends presets (`Past hour`, `Past 4 hours`, `Past day`, `Past 7 days`, `Past 30 days`, `Past 90 days`, `Past 12 months`, `Past 5 years`, `2004-present`).
- 🧠 **Proprietary Trend Intelligence**:
  - **Trend Velocity**: Linear regression slope calculating momentum (`ACCELERATING_GROWTH`, `STEADY_RISE`, `PLATEAU`, `DECLINING`, `SHARP_DROP`).
  - **Peak Value & Date**: Exact timestamp and value where search interest peaked.
  - **Volatility Index**: Standard deviation score distinguishing evergreen interest from viral spikes.
  - **Breakout Classifier**: Automatically tags explosive queries (+5000% growth) with `isBreakout: true` and normalized growth scores.
- 🌍 **Worldwide & Subregion Precision**: Target globally, by country (`US`, `GB`, `DE`, `JP`), state/subregion (`US-CA`, `US-NY`), or DMA metro areas.

***

### 📋 Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | String (Dropdown) | `"explore"` | `explore` (Search Terms Analysis), `compare` (Multi-term comparison), or `trending` (Trending Now Feed). |
| `searchTerms` | Array | `["artificial intelligence"]` | Keywords, search phrases, or Knowledge Graph Entity MIDs (e.g. `/m/019h61`). |
| `timeRange` | String (Dropdown) | `"today 12-m"` | Google Trends timeframe presets (`Past hour`, `Past 4 hours`, `Past day`, `Past 7 days`, `Past 30 days`, `Past 90 days`, `Past 12 months`, `Past 5 years`, `2004-present`, or `custom`). |
| `startDate` | String (Calendar) | `""` | Custom Start Date via visual Calendar Datepicker (`YYYY-MM-DD`). |
| `endDate` | String (Calendar) | `""` | Custom End Date via visual Calendar Datepicker (`YYYY-MM-DD`). |
| `geo` | String (Dropdown) | `"US"` | Google Trends country selector (Worldwide or country selection from dropdown, or custom ISO code). |
| `customGeo` | String | `""` | Optional subregion/metro code (e.g. `US-CA` for California, `GB-ENG` for England). |
| `searchProperty` | String (Dropdown) | `"web"` | Google Trends search property: `web`, `youtube`, `news`, `images`, or `froogle` (Shopping). |
| `category` | String (Dropdown) | `"0"` | All 25 Google Trends official categories (All Categories, Finance, Technology, Health, Sports, etc.). |
| `includeInterestOverTime`| Boolean| `true` | Include historical timeseries interest data points. |
| `includeInterestByRegion`| Boolean| `true` | Include geographic popularity breakdown across states/regions. |
| `includeRelatedQueries` | Boolean | `true` | Include Top and Rising related search queries. |
| `includeRelatedTopics`  | Boolean | `true` | Include Top and Rising related Knowledge Graph entities. |
| `trendingCountry` | String (Dropdown) | `"US"` | Country for Trending Now feed (125+ countries supported). |
| `trendingTimeframe` | String (Dropdown) | `"24"` | Trending timeframe window: `4` (Past 4 hours), `24` (Past 24 hours), `48` (Past 48 hours), `168` (Past 7 days). |
| `trendingCategory` | String (Dropdown) | `"all"` | Trending category filter (All, Business, Entertainment, Health, Sci/Tech, Sports, Top Stories). |
| `maxTrendingItems` | Integer | `50` | Maximum number of trending items to extract. |

***

### ⬇️ Turnkey Input Examples

#### 1. Explore Mode with Calendar Date Range

```json
{
  "mode": "explore",
  "searchTerms": ["ChatGPT", "Claude AI"],
  "startDate": "2024-01-01",
  "endDate": "2024-03-31",
  "geo": "US",
  "searchProperty": "youtube",
  "category": "0"
}
```

#### 2. Multi-Keyword Comparison (Brand vs. Brand)

```json
{
  "mode": "compare",
  "searchTerms": ["Nike", "Adidas", "Puma"],
  "timeRange": "today 12-m",
  "geo": "US",
  "searchProperty": "web"
}
```

#### 3. Real-Time Trending Feed (Direct Publisher Links)

```json
{
  "mode": "trending",
  "trendingCountry": "US",
  "trendingTimeframe": "24",
  "trendingCategory": "all",
  "maxTrendingItems": 50
}
```

***

### ⬆️ Sample Output Data

#### 1. Explore Mode Output (with Built-In Trend Intelligence)

```json
{
  "mode": "explore",
  "query": "artificial intelligence",
  "geo": "US",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "averageInterest": 74.82,
  "peakValue": 100,
  "peakDate": "Sep 15, 2024",
  "trendVelocity": 1.25,
  "trendDirection": "STEADY_RISE",
  "volatilityScore": 9.41,
  "timelineData": [
    {
      "timestamp": 1726358400,
      "formattedTime": "Sep 15 – 21, 2024",
      "formattedAxisTime": "Sep 15, 2024",
      "value": [78],
      "hasData": [true],
      "isPartial": false
    }
  ],
  "regionalData": [
    {
      "geoCode": "US-CA",
      "geoName": "California",
      "value": [100],
      "formattedValue": ["100"],
      "hasData": true
    }
  ],
  "relatedQueries": {
    "top": [
      {
        "query": "ai artificial intelligence",
        "value": 100,
        "formattedValue": "100"
      }
    ],
    "rising": [
      {
        "query": "new artificial intelligence model",
        "value": 5000,
        "formattedValue": "Breakout",
        "isBreakout": true,
        "growthScore": 5000
      }
    ]
  },
  "exploreUrl": "https://trends.google.com/trends/explore?q=artificial+intelligence&geo=US",
  "scrapedAt": "2026-09-19T18:00:00.000Z"
}
```

#### 2. Multi-Keyword Comparison Output

```json
{
  "mode": "compare",
  "query": "Nike vs Adidas vs Puma",
  "comparedKeywords": ["Nike", "Adidas", "Puma"],
  "geo": "US",
  "timeRange": "today 12-m",
  "compareShareOfInterest": {
    "Nike": 64.2,
    "Adidas": 28.5,
    "Puma": 7.3
  },
  "timelineData": [
    {
      "timestamp": 1726358400,
      "formattedTime": "Sep 15 – 21, 2024",
      "value": [68, 29, 7]
    }
  ],
  "exploreUrl": "https://trends.google.com/trends/explore?q=Nike,Adidas,Puma&geo=US",
  "scrapedAt": "2026-09-19T18:00:00.000Z"
}
```

#### 3. Trending Now Feed Output (Direct Original Publisher Links)

```json
{
  "mode": "trending",
  "country": "US",
  "query": "Shohei Ohtani 50/50",
  "formattedTraffic": "1M+",
  "trafficNumber": 1000000,
  "trendVelocity": "EXPLOSIVE",
  "publishedTime": "2024-09-20T01:30:00Z",
  "primaryArticleTitle": "Shohei Ohtani creates 50-50 club with historic 3-homer, 10-RBI day",
  "primaryArticleUrl": "https://www.cbsnews.com/news/shohei-ohtani-creates-50-50-club-los-angeles-dodgers/",
  "primaryArticleSource": "CBS News",
  "primaryArticleSnippet": "Shohei Ohtani became the first player in Major League Baseball history with 50 home runs and 50 stolen bases...",
  "allArticleUrls": [
    "https://www.cbsnews.com/news/shohei-ohtani-creates-50-50-club-los-angeles-dodgers/",
    "https://sports.yahoo.com/mlb/shohei-ohtani-50-50-milestone",
    "https://www.espn.com/mlb/story/_/id/shohei-ohtani-first-player-50-50-club"
  ],
  "relatedQueries": ["Dodgers", "MLB records", "50 50 club"],
  "scrapedAt": "2026-09-19T18:00:00.000Z"
}
```

***

### 💻 Developer Integration Code Snippets

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "mode": "explore",
    "searchTerms": ["ChatGPT", "Claude AI"],
    "timeRange": "today 3-m",
    "geo": "US",
    "searchProperty": "youtube"
}

run = client.actor("google-trends-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"Keyword: {item['query']} | Avg Interest: {item['averageInterest']} | Direction: {item['trendDirection']}")
```

#### Node.js / TypeScript (`apify-client`)

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

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

const run = await client.actor('google-trends-scraper').call({
    mode: 'trending',
    trendingCountry: 'US',
    trendingTimeframe: '24',
    maxTrendingItems: 25
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
    console.log(`[Trending] ${item.query} -> Read source: ${item.primaryArticleUrl}`);
}
```

#### cURL (Direct REST API)

```bash
curl "https://api.apify.com/v2/acts/DataSiphon~google-trends-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "explore", "searchTerms": ["Bitcoin"], "timeRange": "now 4-H"}'
```

***

### 💼 High-Value Business Use Cases

1. **SEO & Content Marketing Agencies**:
   - Detect breakout search queries before your competitors write content.
   - Filter by rising queries with `isBreakout: true` (+5000% velocity) to capture early keyword search volume.
2. **YouTube Creators & Influencers**:
   - Filter `searchProperty: "youtube"` to discover what video topics viewers are actively searching for on YouTube rather than general web search.
3. **E-Commerce & Dropshipping (Shopify / Amazon)**:
   - Filter `searchProperty: "froogle"` (Google Shopping) to track product category demand surges, seasonal spikes, and winning product ideas.
4. **Brand Intelligence & Market Share**:
   - Use `mode: "compare"` to benchmark your brand against up to 4 competitors (e.g. `Nike vs Adidas vs Puma`) on Google's true normalized scale and calculate market share percentage.
5. **News Desks & Automated Media Bots**:
   - Poll `mode: "trending"` hourly to get real-time breaking news queries alongside direct publisher links (`primaryArticleUrl`) to trigger automated alerts in Slack, Discord, or Telegram.
6. **AI Agent & RAG Workflows (LLMs)**:
   - Feed real-time search trends into LangChain, LlamaIndex, or AutoGen pipelines for fresh, grounded market commentary.

***

### ❓ Frequently Asked Questions

#### Why does Apify's official actor fail so frequently?

Apify's official Google Trends actor relies on heavy headless Chromium browsers requiring 4,096 MB RAM. Google frequently identifies datacenter browser connections and serves bot checks, causing timeouts and a **37.52% failure rate**. Our scraper uses pure HTTP with authentic Chrome TLS fingerprinting, consuming only **256 MB RAM** with sub-second response times and **99.9% reliability**.

#### Can I scrape YouTube, Google News, or Shopping trends?

Yes! Use the `searchProperty` dropdown to select `youtube`, `news`, `images`, or `froogle` (Google Shopping).

#### How are dates selected?

You can choose any predefined timeframe from the dropdown (such as `Past 4 hours`, `Past 30 days`, `Past 12 months`, etc.) or select `Custom time range` and pick exact start and end dates directly from the visual calendar pickers (`startDate` and `endDate`).

#### Do I need proxies?

For standard queries, the actor runs seamlessly with built-in retry and cookie management. For large-scale automated pipelines with thousands of requests, toggle Apify Residential Proxies in the Proxy configuration.

***

### 🛡️ License & Support

Maintained with ❤️ by **DataSiphon**. For feature requests or custom high-volume integrations, contact via the Apify Console or open an issue on the actor tab.

# Actor input Schema

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

Select how you want to use Google Trends: Explore single/multiple keywords, Compare 2-5 keywords side-by-side, or get the live Trending Now feed with news publisher links.

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

Enter the search term(s) or topic(s) you want to analyze on Google Trends. In 'Compare' mode, enter 2 to 5 terms to benchmark them side-by-side.

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

Location dropdown matching Google Trends. Select 'Worldwide' or pick a country. To specify a state or subregion (e.g. US-CA), select 'Other / Custom Region' and enter it below.

## `customGeo` (type: `string`):

Optional: Enter a subregion, state, or country code (e.g. 'US-CA' for California, 'US-NY' for New York, 'GB-ENG' for England). Used when Geography is set to 'Other / Custom Region'.

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

Time range dropdown matching the options available on Google Trends. Select 'Custom time range' to choose exact start and end dates from the calendar pickers below.

## `startDate` (type: `string`):

Pick the start date from the calendar for custom time range (e.g. 2024-01-01). Used when 'Custom time range' is selected or dates are provided.

## `endDate` (type: `string`):

Pick the end date from the calendar for custom time range (e.g. 2024-12-31). Used when 'Custom time range' is selected or dates are provided.

## `category` (type: `string`):

Dropdown matching Google Trends categories. Narrow your search interest to a specific vertical.

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

Dropdown matching the 5 Google Trends search types: Web Search, Image Search, News Search, Google Shopping, or YouTube Search.

## `includeInterestOverTime` (type: `boolean`):

Extract historical timeline datapoints with timestamps, formatted dates, relative interest values (0-100), and partial period flags.

## `includeInterestByRegion` (type: `boolean`):

Extract geographic breakdown showing popularity across countries, states/provinces, and subregions.

## `includeRelatedQueries` (type: `boolean`):

Extract Top and Rising related search queries with automatic identification of breakout surges (+5000%).

## `includeRelatedTopics` (type: `boolean`):

Extract Top and Rising related entity topics from the Google Knowledge Graph with Topic MIDs.

## `trendingCountry` (type: `string`):

Select country for the Trending Now feed. Over 125 countries supported.

## `trendingTimeframe` (type: `string`):

Time period for real-time trending searches matching Google Trends UI.

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

Filter trending searches by category matching Google Trends Trending Now tabs.

## `maxTrendingItems` (type: `integer`):

Maximum number of trending search stories to return (1 to 500).

## `startUrls` (type: `array`):

Paste any direct Google Trends Explore or Trending URL (e.g. 'https://trends.google.com/trends/explore?q=bitcoin\&geo=US'). The scraper will automatically extract keywords, geography, timeframe, and category.

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

Proxy settings. Apify Proxy with RESIDENTIAL group or auto proxy is recommended for high-volume automated runs.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "artificial intelligence",
    "quantum computing"
  ],
  "geo": "US",
  "customGeo": "US-CA",
  "timeRange": "today 12-m",
  "startDate": "2024-01-01",
  "endDate": "2024-12-31",
  "category": "0",
  "searchProperty": "web",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "trendingCountry": "US",
  "trendingTimeframe": "24",
  "trendingCategory": "all",
  "maxTrendingItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {};

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

# Run the Actor and wait for it to finish
run = client.actor("datasiphon/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 '{}' |
apify call datasiphon/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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