# Google Trends Scraper API - Trending Now & Rising Queries (`victorrodi/google-trends-api`) Actor

Google Trends API: interest over time with growth %, by country/state/city, rising & breakout queries, full Trending Now list with search volume & news. Rank unlimited keywords on one scale, many countries per run. Fast, no browser; empty results never charged.

- **URL**: https://apify.com/victorrodi/google-trends-api.md
- **Developed by:** [TrendPulse Data](https://apify.com/victorrodi) (community)
- **Categories:** SEO tools, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### 📈 Google Trends Scraper & API — fast, cheap, no browser

**Get Google Trends data in seconds, as clean JSON, CSV or Excel.** This Google Trends scraper calls the same data endpoints as the trends.google.com website — no headless browser — so runs start instantly, cost a fraction of a cent and almost never fail.

✅ **Interest over time** for any keyword (with average, peak, latest value and growth %)
✅ **Interest by region**: countries, states/regions, cities, US metro areas — ranked
✅ **Related queries**: top and **rising** searches, including **"Breakout"** keywords
✅ **Trending now**: hundreds of trending searches per country — **search volume, growth %, start time, related queries, category, news links** — for the past 4 h, 24 h, 48 h or 7 days
✅ **Compare up to 5 keywords** on the same scale — or **rank unlimited keywords** on one scale
✅ **Several countries in one run** to compare markets
✅ Web, **YouTube**, **Google News**, **Google Shopping** and **Image** search
✅ Any category, any country, any period from the past hour to 2004
✅ Paste **Google Trends URLs** straight from your browser
✅ **You never pay for empty results**

***

### 🚀 Why this Google Trends API is different

| | This Actor | Browser-based scrapers |
|---|---|---|
| Speed | 30 keywords in ~100 s | minutes, page by page |
| Reliability (measured) | **30/30 queries**, 1 blocked call out of 157 | frequent timeouts |
| Rank more than 5 keywords on one scale | **Yes** (anchor method) | No |
| Several countries per run | **Yes** | One per run |
| Ready-made insights (avg, peak, growth %) | **Yes** | Raw data only |
| Trending now with volume, growth, related queries **and news** | **Yes**, any country, 19 categories | Partial |
| Charged for empty results | **Never** | Often |

***

### 💡 What can you do with Google Trends data?

- **Keyword research & SEO**: find **rising queries** and breakout topics before your competitors; compare keyword popularity for content planning.
- **E-commerce & dropshipping**: spot trending products early, time stock and promotions with **seasonality**, compare demand by country.
- **Market research**: validate a product idea, measure brand awareness vs competitors, find the regions that care most.
- **Content & YouTube creators**: pick video topics with **YouTube search trends**, ride daily **trending searches**.
- **Finance & data science**: feed search interest into models, dashboards and alerts (crypto, stocks, consumer demand).
- **Resellers & collectors**: detect hype on sneakers, trading cards (Pokémon, One Piece), consoles and toys.
- **Agencies**: automated weekly trend reports for clients with Schedules + Google Sheets.

***

### 🛠️ How to scrape Google Trends (3 steps)

1. **Add your keywords** — one query per line. Put up to 5 terms on one line, separated by commas, to compare them: `iphone, samsung, pixel`.
   Or paste **Google Trends URLs** copied from your browser.
2. **Choose location(s), period and data** — e.g. `US`, `GB`, `DE`… (empty = Worldwide), *Past 12 months*, all data types.
3. **Click Start** and download your dataset as **JSON, CSV, Excel, XML or HTML**, or fetch it through the API.

#### Rank 100+ keywords on one scale

Google only compares 5 terms at a time. Turn on **"Rank all terms on one scale"**: the Actor splits your list into batches sharing one **anchor term** and rescales every batch, so all keywords land on **one comparable 0-100 score**. Perfect for keyword research and product selection.

***

### 📥 Input example

```json
{
  "searchTerms": ["pokemon cards", "iphone, samsung, pixel"],
  "geos": ["US", "GB"],
  "timeRange": "today 12-m",
  "dataTypes": ["interestOverTime", "interestByRegion", "relatedQueries"],
  "keywordRanking": false,
  "trendingNowGeos": ["US"]
}
```

### 📤 Output examples

**Interest over time** (with ready-made summary):

```json
{
  "type": "interestOverTime",
  "searchTerms": ["iphone", "samsung"],
  "geo": "US",
  "timeRange": "today 12-m",
  "summary": {
    "iphone": { "average": 61.4, "max": 100, "maxDate": "2026-09-14T00:00:00Z", "latest": 58, "changePct": 12.5 },
    "samsung": { "average": 22.1, "max": 31, "maxDate": "2026-02-01T00:00:00Z", "latest": 20, "changePct": -4.0 }
  },
  "timeline": [
    { "date": "2025-11-02T00:00:00Z", "label": "Nov 2 – 8, 2025", "values": { "iphone": 55, "samsung": 21 }, "isPartial": false }
  ]
}
```

**Interest by region** (most interested first):

```json
{ "type": "interestByRegion", "geo": "US", "resolution": "REGION",
  "regions": [{ "geoCode": "US-CA", "geoName": "California", "values": { "iphone": 100 }, "hasData": true }] }
```

**Related & rising queries**:

```json
{ "type": "relatedQueries", "term": "pokemon cards",
  "top": [{ "query": "pokemon cards value", "value": 100, "formattedValue": "100", "breakout": false, "link": "https://trends.google.com/…" }],
  "rising": [{ "query": "pokemon 30th celebration", "value": 4650, "formattedValue": "Breakout", "breakout": true, "link": "https://trends.google.com/…" }] }
```

**Keyword ranking** (unlimited terms, one scale):

```json
{ "type": "keywordRanking", "anchorTerm": "bitcoin",
  "ranking": [{ "term": "bitcoin", "score": 100, "averageIndex": 42.3, "rank": 1 }, { "term": "solana", "score": 18.7, "averageIndex": 7.9, "rank": 2 }],
  "notRanked": [] }
```

**Trending now** (full list, biggest first):

```json
{ "type": "trendingNow", "rank": 1, "geo": "US", "timeWindowHours": 24, "title": "world series", "searchVolume": 2000000, "growthPct": 1000,
  "startedAt": "2026-10-31T19:00:00Z", "isActive": true, "categories": ["Sports"], "relatedQueries": ["dodgers", "world series game 7"],
  "news": [{ "title": "…", "url": "https://…", "source": "…", "picture": "https://…" }], "exploreLink": "https://trends.google.com/trends/explore?q=world%20series&geo=US&date=now%207-d" }
```

***

### 💰 Pricing — pay only for results

| What you run | Results | Cost (Starter plan) |
|---|---|---|
| 1 keyword, all data | 3 | ≈ $0.0075 |
| 3 keywords compared, all data | 5 | ≈ $0.0125 |
| 100 keywords, interest over time | 100 | ≈ $0.25 |
| Rank 50 keywords on one scale | 1 | ≈ $0.0025 |
| Trending now, 1 country, top 50 | 50 | ≈ $0.125 |

Platform usage and proxies are **included**. Higher Apify plans get lower prices per result. Set a **maximum cost per run** and the Actor stops cleanly when it is reached. **Empty results and failed queries are never charged.**

***

### 🔌 Use the Google Trends API from your code

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("victorrodi/google-trends-api").call(
    run_input={
        "searchTerms": ["bitcoin, ethereum"],
        "geo": "US",
        "timeRange": "today 3-m",
    }
)
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["type"], item.get("summary"))
```

**JavaScript / Node.js**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('victorrodi/google-trends-api').call({ searchTerms: ['chatgpt, gemini, claude'], geo: 'GB' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**cURL** (run and get results in one call)

```bash
curl -X POST "https://api.apify.com/v2/acts/victorrodi~google-trends-api/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" -d '{"searchTerms": ["air fryer"], "geo": "US"}'
```

Also works with **Make, Zapier, n8n, Google Sheets, Slack, Airbyte, LangChain** and **MCP / AI agents** through Apify integrations.

#### 🤖 Use it from AI agents (Claude, ChatGPT, Cursor…)

This Actor is available to AI assistants through the **[Apify MCP server](https://mcp.apify.com)**. Add the server to Claude Desktop, Claude Code, Cursor or any MCP client, then simply ask:

> *"Use the Google Trends Scraper to compare 'iphone, samsung, pixel' in the US over the past 12 months and tell me which one is growing."*

> *"What is trending on Google in the UK right now in Technology? Use victorrodi/google-trends-api."*

The structured output (summary with growth %, ranked regions, rising queries) is designed to be read directly by LLMs.

***

### 🛡️ Reliability

- Requests are paced like a human visitor and retried on the same session first, then with a **new IP** and exponential backoff.
- If Google keeps blocking, the Actor **switches to residential IPs automatically**.
- One failing block never costs you the rest of the query.
- Every run writes a `RUN_SUMMARY` record (results, failed queries, retries).
- Measured on real runs: **30/30 queries** in the US and **30/30** in Portugal, about 100 seconds each.

More scrapers from the same team (Google News, Flights, Autocomplete, YouTube, Airbnb, Shopify, Telegram…): **[trendpulse-scrapers](https://github.com/Vicshock/trendpulse-scrapers)**.

***

### 📌 Tips

- Values are **relative (0-100)** within one request: compare terms on the same line, or use keyword ranking, to keep them on one scale.
- Short periods return hourly points; long periods return weekly or monthly points.
- Very rare keywords may return no data (Google needs enough volume) — you are not charged.
- Category IDs: 0 all, 5 Computers & Electronics, 7 Finance, 8 Games, 16 News, 18 Shopping, 20 Sports, 71 Food & Drink ([full list](https://github.com/pat310/google-trends-api/wiki/Google-Trends-Categories)).
- **Related topics** are not offered: Google returns them empty to every non-browser tool, and this Actor does not sell empty data.

***

### ❓ FAQ

**Is there an official Google Trends API?** Google opened an alpha API to a small group of testers only. This Actor gives you the same data today, without an application or quota.

**Can I schedule Google Trends reports?** Yes. Save your input as a **Task**, add a **Schedule** (daily, weekly…) and connect the dataset to Google Sheets, Slack or email.

**How many keywords can I track?** Up to 500 queries per run, each with up to 5 compared terms — and keyword ranking puts any number of terms on one scale.

**Why do values only go up to 100?** Google Trends publishes a relative interest index, not absolute search volumes. 100 is the peak within the request.

**Can I get data for a city or a US state?** Yes: set the location to a region code such as `US-CA` or `BR-SP`, and choose region detail *Cities*.

**Is scraping Google Trends legal?** This Actor collects public, aggregated and anonymous statistics. It does not collect personal data. Make sure your use complies with Google's terms and the laws that apply to you.

***

### 💬 Support

Need a field, a new data type or found an issue? Open an issue in the **Issues** tab — it is answered fast. Feature requests are welcome.

More code examples and a **pytrends migration guide**: [github.com/Vicshock/google-trends-api](https://github.com/Vicshock/google-trends-api).

# Actor input Schema

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

One query per line. Put up to 5 terms on one line, separated by commas, to compare them on the same scale (e.g. 'iphone, samsung, pixel'). The two example lines are skipped automatically when you only ask for Trending now or Google Trends URLs, so you never pay for them.

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

Optional. Paste trends.google.com/trends/explore URLs straight from your browser: terms, location, period, category and search type are read from the URL.

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

Country or region code: 'US', 'PT', 'GB', 'US-CA', 'BR-SP'… Leave empty for Worldwide.

## `geos` (type: `array`):

Run every query for each of these locations, e.g. 'US', 'GB', 'DE', 'FR'. Overrides 'Location'. Great to compare markets.

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

Period to analyse. Ignored if 'Custom time range' is filled.

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

Optional, overrides Time range. Format: 'YYYY-MM-DD YYYY-MM-DD', e.g. '2024-01-01 2024-06-30'.

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

Each selected block is one result in the dataset (related queries: one result per compared term). Blocks without data are skipped and never charged.

## `keywordRanking` (type: `boolean`):

Google compares only 5 terms at once. Turn this on to rank ANY number of terms on one common 0-100 scale (anchor-term method). You can then put as many comma-separated terms as you like on one line. Adds one 'keywordRanking' result.

## `anchorTerm` (type: `string`):

Optional. A popular term shared by every batch to link them. Defaults to your first term; pick one with steady volume.

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

Google Trends category ID. 0 = all categories. Examples: 7 Finance, 18 Shopping, 20 Sports, 5 Computers & Electronics, 16 News, 71 Food & Drink, 8 Games.

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

Which Google search the interest comes from: web, image, news, YouTube or Shopping.

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

Detail level for 'Interest by region'. Automatic = countries when Worldwide, regions inside a country.

## `includeLowVolumeRegions` (type: `boolean`):

Also return regions where search volume is too low for a stable index.

## `trendingNowGeos` (type: `array`):

Optional. Country codes (e.g. 'US', 'GB', 'PT'): get the full Trending Now list — hundreds of trends with search volume, growth %, start time, related queries, category and news links.

## `trendingNowHours` (type: `string`):

Period of the Trending Now list.

## `trendingNowCategories` (type: `array`):

Optional. Keep only trends in these categories (Sports, Technology, Shopping…). Empty = all.

## `trendingNowMaxItems` (type: `integer`):

Biggest search volume first. Caps the cost: each trend is one result.

## `trendingNowActiveOnly` (type: `boolean`):

Skip trends that have already ended.

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

Interface language for topic names, e.g. 'en-US', 'pt-PT', 'fr', 'de', 'es'.

## `maxRetries` (type: `integer`):

How many times a blocked request is retried with a new IP before the query is reported as failed.

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

Apify Proxy is used by default. If Google blocks, the Actor switches to residential IPs automatically.

## `debugLog` (type: `boolean`):

Log every request (status, proxy type). Useful only for troubleshooting.

## Actor input object example

```json
{
  "searchTerms": [
    "pokemon cards",
    "iphone, samsung, pixel"
  ],
  "startUrls": [],
  "geo": "",
  "geos": [],
  "timeRange": "today 12-m",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "keywordRanking": false,
  "anchorTerm": "",
  "category": 0,
  "property": "",
  "regionResolution": "",
  "includeLowVolumeRegions": false,
  "trendingNowGeos": [],
  "trendingNowHours": "24",
  "trendingNowCategories": [],
  "trendingNowMaxItems": 50,
  "trendingNowActiveOnly": false,
  "language": "en-US",
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugLog": false
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "searchTerms": [
        "pokemon cards",
        "iphone, samsung, pixel"
    ],
    "trendingNowGeos": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("victorrodi/google-trends-api").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": [
        "pokemon cards",
        "iphone, samsung, pixel",
    ],
    "trendingNowGeos": [],
}

# Run the Actor and wait for it to finish
run = client.actor("victorrodi/google-trends-api").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": [
    "pokemon cards",
    "iphone, samsung, pixel"
  ],
  "trendingNowGeos": []
}' |
apify call victorrodi/google-trends-api --silent --output-dataset

```

## MCP server setup

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

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/Pcqcs3PLbMJYm3dRg/builds/JELiEYPixBmIsJB4v/openapi.json
