# Google Trends Scraper - Trending, Keywords & Compare (`alex_expert/google-trends-scraper`) Actor

Reliable Google Trends data: daily trending searches, interest over time, interest by region and related queries. Filter by category and search type (Web, News, Images, Shopping, YouTube). Residential proxy rotation and 429 backoff so runs do not fail.

- **URL**: https://apify.com/alex\_expert/google-trends-scraper.md
- **Developed by:** [Alexander Shulga](https://apify.com/alex_expert) (community)
- **Categories:** SEO tools, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 result rows

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?

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 — Trending Now, Keyword Research & Comparison

Extract Google Trends data reliably: **daily trending searches**, **interest over time**,
**interest by region**, **related queries** and **side-by-side keyword comparison** — as JSON,
CSV or Excel, or straight through the API.

Built for people whose runs keep failing. Google rate limits Google Trends aggressively and
returns `HTTP 429` to datacenter IPs under load. This Actor keeps a sticky residential session,
rotates to a fresh IP on every failure, backs off exponentially, and **never dies silently**:
if one keyword fails, the rest still return, and the run summary says exactly what went wrong.

### What it does

- **Trending now** — today's hot searches for one or many countries, with traffic estimates and news links.
- **Keyword research** — interest over time, interest by region, top and rising related queries.
- **Compare keywords** — put up to 5 terms on one normalised chart, the way Google Trends compares them.
- **Paste a Google Trends URL** — copy the address from your browser; keywords, country, time range
  and category are read straight out of it.
- **Custom date ranges** — any period, not just the presets.
- **Max items cap** — a hard ceiling so you always know the most a run can cost.

### Quick start

1. Pick a mode:
   - **Trending now** — today's hot searches for a country. No keywords needed. Just press **Start**.
   - **Keyword research** — interest, regions and related queries for your own terms.
2. Set the country (`US`, `GB`, `DE`, `UA`, ...). In Trending now mode you can pass several: `US,DE,GB`.
3. Press **Start**.

Default settings work out of the box — no configuration needed for your first run.
Common typos are fixed automatically: `USA` becomes `US`, `UK` becomes `GB`.

### Who this is for

- **SEO specialists** tracking keyword seasonality and finding rising terms before competitors.
- **Content teams** picking topics from what people search for today.
- **Market researchers** comparing regional demand or several brands against each other.
- **AI and automation builders** feeding fresh trend signals into agents and dashboards.

### Output example

Trending now:

```
{
  "type": "trendingNow",
  "geo": "US",
  "keyword": "fanduel",
  "traffic": "200+",
  "date": "Sat, 29 Aug 2026 00:30:00 -0700",
  "news": [
    { "title": "FanDuel Casino Promo Code 2026", "url": "https://...", "source": "USA Today" }
  ]
}
```

Keyword research:

```
{ "type": "interestOverTime", "keyword": "bitcoin", "geo": "US", "date": "Aug 2026", "value": 78 }
{ "type": "interestByRegion", "keyword": "bitcoin", "region": "California", "value": 91 }
{ "type": "relatedQuery",     "keyword": "bitcoin", "relatedType": "rising", "relatedQuery": "bitcoin etf" }
```

Comparison mode — values are relative to each other, not independent:

```
{ "type": "comparisonOverTime", "keyword": "coffee", "value": 62, "comparedWith": "coffee vs tea vs juice" }
{ "type": "comparisonOverTime", "keyword": "tea",    "value": 30, "comparedWith": "coffee vs tea vs juice" }
{ "type": "comparisonOverTime", "keyword": "juice",  "value": 17, "comparedWith": "coffee vs tea vs juice" }
```

### Control what you pay for

You are charged per result row, so you decide how much data a run produces. Switch off any
section you do not need, or set **Max items** for a hard ceiling.

| Run | Rows | Cost on the Free tier |
|---|---|---|
| Trending now, one country | ~10 | ~$0.03 |
| One keyword, everything on | ~150 | ~$0.45 |
| One keyword, related queries only | ~50 | ~$0.15 |
| Comparison of 3 terms, chart only | ~155 | ~$0.47 |
| Anything, with `maxItems: 25` | 25 | ~$0.08 |

Higher Apify plans get automatic volume discounts, down to $0.30 per 1,000 rows.
The Actor also honours the maximum charge you set on a run and stops cleanly instead of
burning compute you are not paying for.

### Input reference

| Field | Description | Default |
|---|---|---|
| `mode` | `trendingNow` or `keywords` | `trendingNow` |
| `keywords` | Search terms (keyword mode only) | `["bitcoin"]` |
| `startUrls` | Google Trends URLs pasted from the browser | empty |
| `compareKeywords` | Compare all keywords on one normalised chart (max 5) | `false` |
| `geo` | Country code, comma-separated in trending mode. Empty = worldwide | `US` |
| `timeframe` | `now 1-H` … `today 12-m` … `all` | `today 12-m` |
| `customTimeRange` | Any period, e.g. `2023-01-01 2023-12-31`. Overrides Time range | empty |
| `category` | Narrow to a Google Trends category (Finance, Travel, Health, …) | All |
| `searchProperty` | Web, Images, News, Shopping or YouTube search | Web |
| `includeTimeseries` | Interest over time | `true` |
| `includeRegions` | Interest by region | `true` |
| `includeRelated` | Related top and rising queries | `true` |
| `maxItems` | Hard cap on result rows. 0 = no limit | `0` |
| `language` | Language of returned labels, e.g. `en-US`, `de` | `en-US` |
| `maxRetries` | Retries per request, each with a fresh IP | `8` |
| `proxyConfiguration` | Residential proxies recommended for large runs | Apify RESIDENTIAL |

### Troubleshooting

- **Getting few or no rows in keyword mode?** Enable Apify Proxy with the `RESIDENTIAL` group.
  Datacenter IPs get throttled by Google once a run grows.
- **Wrong country code?** You get an immediate, explicit error instead of a run that hangs and
  then fails. Use two-letter ISO codes: `US`, `GB`, `DE`, `UA`, `PL`.
- **Comparison values look low?** That is the point: in comparison mode 100 belongs to the most
  popular term and everything else is scaled against it.
- **Run finished but something was missing?** Open the `RUN_SUMMARY` record in the key-value
  store — it lists every keyword or country that failed and why.

### What this Actor deliberately does not do

Two things are advertised elsewhere but do not actually work any more, so they are not offered here:

- **Related topics.** Google answers programmatic requests with an empty list for every keyword,
  and the request is cryptographically signed so it cannot be altered. Charging you for a call
  guaranteed to return nothing would be dishonest. Related **queries** are unaffected.
- **Trending searches for past dates.** The endpoint that served historical daily trends now
  returns 404. Only today's trending list is available.

### Integrations

Results can be pushed to Google Sheets, Slack, Zapier and Make, or pulled via the Apify API and MCP.

# Actor input Schema

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

Trending now = today's hot searches for a country (no keywords needed). Keyword research = interest over time, interest by region and related queries for your own keywords.

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

Search terms to analyse. Used only when mode = Keyword research. Plain words, not URLs. Example: coffee machine

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

Paste addresses copied straight from trends.google.com/trends/explore. Keywords, country, time range and category are read from the URL. Works alongside the Keywords field.

## `compareKeywords` (type: `boolean`):

Put all keywords on one normalised chart, the way Google Trends compares terms. Values become relative to each other instead of independent. Maximum 5 terms.

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

Two-letter ISO code: US, GB, DE, UA, PL. In Trending now mode you can pass several separated by commas: US,DE,GB. Leave empty in Keyword research mode for worldwide data.

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

Google Trends time range. Keyword research mode only.

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

Overrides Time range. Two ISO dates separated by a space, for example: 2023-01-01 2023-12-31

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

Narrow results to one Google Trends category. Keyword research mode only.

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

Which Google surface to measure. Keyword research mode only.

## `includeTimeseries` (type: `boolean`):

Popularity score 0-100 for each point in the time range.

## `includeRegions` (type: `boolean`):

Which regions search for this keyword the most.

## `includeRelated` (type: `boolean`):

Top and rising related search queries.

## `maxItems` (type: `integer`):

Hard cap on result rows, so you always know the maximum a run can cost. 0 means no limit.

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

Interface language for the returned labels, for example en-US or de.

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

Google rate limits aggressively. Each retry rotates to a fresh proxy IP. Permanent errors such as a wrong country code are never retried.

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

Residential proxies are recommended for large runs. Google returns HTTP 429 to datacenter IPs under load.

## Actor input object example

```json
{
  "mode": "trendingNow",
  "keywords": [
    "bitcoin",
    "ethereum"
  ],
  "startUrls": [],
  "compareKeywords": false,
  "geo": "US",
  "timeframe": "today 12-m",
  "customTimeRange": "",
  "category": "0",
  "searchProperty": "",
  "includeTimeseries": true,
  "includeRegions": true,
  "includeRelated": true,
  "maxItems": 0,
  "language": "en-US",
  "maxRetries": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All collected rows: trending searches, interest over time, interest by region and related queries.

## `csv` (type: `string`):

Same data as a spreadsheet-ready CSV file.

## `runSummary` (type: `string`):

Which keywords or countries succeeded, which failed, and why.

# 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": [
        "bitcoin",
        "ethereum"
    ],
    "geo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("alex_expert/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": [
        "bitcoin",
        "ethereum",
    ],
    "geo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("alex_expert/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": [
    "bitcoin",
    "ethereum"
  ],
  "geo": "US"
}' |
apify call alex_expert/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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