# Google Trends Scraper ⚡ Compare Keywords, Pay Only on Success (`pulselab/google-trends-scraper`) Actor

Google Trends data in 1-2 seconds, no browser. Get interest over time for any keyword, country and period, or compare up to 5 keywords on one 0-100 scale. You pay only for searches that return data. Failed searches cost $0 and are listed by name. Clean rows for Sheets, n8n, Make and AI agents.

- **URL**: https://apify.com/pulselab/google-trends-scraper.md
- **Developed by:** [Pulse Lab](https://apify.com/pulselab) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 successful searches

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/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 ⚡ Compare Keywords, Pay Only on Success

Get Google Trends **interest over time** for any keyword, country and period, and **compare up to 5 keywords** on one 0-100 scale. No browser, so a search finishes in 1-2 seconds.

**You pay only for searches that return data.** Failed searches cost $0 and are listed by name in the run status.

### Why this Actor

- **Fast.** Direct requests instead of a headless browser. A typical search takes 1-2 seconds.
- **Keyword comparison that works.** Put up to 5 terms on one line and get them on the same 0-100 scale, exactly like the Google Trends compare view.
- **Honest billing.** One charge per successful search. If Google blocks a request or returns nothing, you are not charged.
- **Clear failures.** The run status tells you how many searches succeeded and which ones failed. No silent empty results.
- **Clean output.** One row per date and keyword. Ready for Google Sheets, Excel, n8n, Make, Zapier and AI agents.

### Input

| Field | Required | Description |
|---|---|---|
| Search terms | Yes | One line = one search. Separate up to 5 terms with commas to compare them, for example `nike, adidas, puma` |
| Country code | No | Two-letter code such as `US`, `GB`, `DE`, `KR`. Leave empty for worldwide |
| Time range | No | Past 7 days, 30 days, 90 days, 12 months (default) or 5 years |

Example input:

```json
{
    "searchTerms": ["nike, adidas, puma", "iphone, samsung galaxy"],
    "geo": "US",
    "timeRange": "today 12-m"
}
```

This runs 2 searches: one comparing three brands, one comparing two phones.

### Output

One row per date and keyword:

```json
{
    "searchGroup": "nike, adidas, puma",
    "keyword": "nike",
    "date": "2025-10-05",
    "dateLabel": "Oct 5 – 11, 2025",
    "value": 38,
    "isPartial": false,
    "geo": "US",
    "timeRange": "today 12-m"
}
```

| Field | Meaning |
|---|---|
| searchGroup | The terms that were compared together |
| keyword | The term this row belongs to |
| date | Start date of the period (YYYY-MM-DD) |
| value | Google Trends interest, 0-100, relative to the highest point in the search |
| isPartial | `true` when the period is not finished yet, so the value can still change |
| geo | Country code, or `WORLDWIDE` |

### Pricing

You are charged once for each search that returns data. A search is one line of search terms, whether it has 1 keyword or 5.

Not charged: searches that fail, searches with more than 5 terms, and runs where nothing could be fetched.

### Good to know

- Values are relative, not absolute search volumes. 100 is the peak inside each search, so numbers from two different searches cannot be compared directly. Put terms on the same line to compare them.
- Terms with very little search interest can come back as 0.
- Google Trends allows at most 5 terms per comparison. Lines with more are skipped and not charged.
- Past 7, 30 and 90 days return daily data. Past 12 months and 5 years return weekly data.
- This Actor currently returns interest over time. Interest by region and related queries are not included yet.

### FAQ

**Is this an official Google API?**
No. Google does not offer a public Trends API. This Actor reads the same public data the Google Trends website shows.

**What happens if Google blocks a request?**
The Actor retries up to 3 times with a fresh session. If it still fails, that search is marked as failed and you are not charged for it.

**Can I schedule it?**
Yes. Use Apify schedules to run it daily or weekly and send the results to Sheets, a webhook or your own app.

**Something is wrong or missing?**
Please report it in the Issues tab and it will be fixed.

# Actor input Schema

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

One line = one comparison. Separate up to 5 terms with commas, e.g. nike, adidas, puma

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

Two-letter country code such as US, GB, KR. Leave empty for worldwide.

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

Period to analyze.

## Actor input object example

```json
{
  "searchTerms": [
    "nike, adidas, puma"
  ],
  "timeRange": "today 12-m"
}
```

# 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 = {
    "searchTerms": [
        "nike, adidas, puma"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("pulselab/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 '{
  "searchTerms": [
    "nike, adidas, puma"
  ]
}' |
apify call pulselab/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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