# Google Trends Scraper (`data_ops_main/google-trends`) Actor

Scrapes Google Trends data for a list of keywords. Outputs precise trend metrics — average interest, direction, peak, growth rate, volatility, and composite trend score - to the Apify dataset.

- **URL**: https://apify.com/data_ops_main/google-trends.md
- **Developed by:** [yourlocalhost](https://apify.com/data_ops_main) (community)
- **Categories:** Developer tools, SEO tools, Other
- **Features:** Limited permissions
- **Stats:** 162 total users, 20 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.

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 📈

> Turn raw Google Trends search interest into **decision-ready metrics** — average interest, direction, growth rate, volatility, and a single **0–100 trend score** — for any list of keywords, in any country, on autopilot.

Google Trends is free to *look at*, but painful to *use at scale*: there's no bulk export, the UI caps comparisons at 5 keywords, datacenter scripts get blocked within minutes, and you still have to eyeball every chart to decide if a keyword is actually rising. **This Actor does all of that for you** — and returns clean JSON/CSV/Excel you can drop straight into a spreadsheet, a dashboard, or your own ranking pipeline.

***

### ✨ Why this Actor (instead of doing it yourself)

| | 🟢 This Actor | 🔴 DIY script / Google Trends UI |
|---|---|---|
| **Doesn't get blocked** | Routes every request through rotating **residential proxies** with automatic retries | Datacenter IPs get rate-limited (`429`) within minutes |
| **Bulk keywords** | Unlimited keywords per run | UI caps you at 5; manual copy-paste |
| **Real metrics, not charts** | Growth rate, volatility, direction & a **0–100 score** computed for you | You read charts by eye |
| **Structured export** | JSON, CSV, Excel, API — ready for Sheets/BI | No bulk export at all |
| **Maintenance** | We handle Google's changes & blocks | You patch broken scrapers forever |
| **Scheduling & alerts** | Built into Apify (cron, webhooks, integrations) | Build it yourself |

You're not paying for data Google gives away — you're paying for **reliability, scale, and the analysis that turns it into a decision.**

***

### 🚀 Quick start (60 seconds)

1. Click **Try for free** / **Start**.
2. Paste your keywords (one per line).
3. Pick a country and timeframe.
4. Hit **Start** — results stream into the dataset as they're scraped.
5. Export as **JSON, CSV, or Excel**, or pull them via the **API**.

```json
{
  "keywords": ["air fryer", "matcha", "stanley cup"],
  "geo": "US",
  "timeframe": "today 3-m",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

That's it. No proxies to buy, no captchas to solve, no scrapers to babysit.

***

### 💡 What you can do with it

- **Validate product demand** before you source or launch — is interest *rising* or already cooling off?
- **SEO & content planning** — find search terms that are growing *now* and prioritize them by score.
- **Dropshipping & e-commerce** — score hundreds of product ideas in one run and keep only the winners.
- **Seasonal & market research** — compare keyword popularity across countries and time windows.
- **Feed your own pipeline** — pipe the `trend_score` into automated ranking, dashboards, or alerts.

***

### 📊 What makes the output valuable

The Google Trends UI gives you a squiggly line. This Actor gives you **numbers you can sort, filter, and act on** — including metrics the UI never shows you:

| Field | Description |
|-------|-------------|
| `trend_score` | **Composite 0–100 score** blending interest, momentum, and stability — sort by this to instantly surface winners |
| `trend_direction` | `rising`, `falling`, or `stable` |
| `growth_rate` | % change of the latest period vs the previous one |
| `avg_interest` | Average search interest over the timeframe |
| `peak_interest` | Highest interest value in the period |
| `current_interest` | Most recent interest level |
| `volatility` | How stable the trend is (lower = more dependable) |
| `data_points` | Number of data points behind the metrics |
| `raw_data` | Full Google Trends timeline, so you can build your own charts |
| `extracted_at` | ISO timestamp of extraction |

#### Example result

```json
{
  "keyword": "air fryer",
  "geo": "US",
  "timeframe": "today 3-m",
  "avg_interest": 62,
  "trend_direction": "rising",
  "peak_interest": 100,
  "current_interest": 78,
  "growth_rate": 26,
  "volatility": 12,
  "trend_score": 74,
  "data_points": 90,
  "extracted_at": "2026-06-06T14:30:00.000Z"
}
```

***

### 💳 Pricing — pay only for results you get

This Actor uses **pay-per-result** billing: you're charged a small amount **for each keyword successfully analyzed**, and **nothing for keywords that fail or get blocked**. No monthly commitment, no surprise platform bills — your cost scales exactly with the value you receive.

**Worked example:** scraping **100 keywords** at a price of *$X per 1,000 results* costs roughly **$X ÷ 10** for the whole run. (See the live price on the Actor's pricing tab — it's always shown before you start.)

You can cap spend per run at any time using the **maximum charge** field in the Apify run options, so you're never billed more than you intend.

> 💡 **Tip:** Start with the free trial run, check the quality of the `trend_score` column on your own keywords, then scale up. Most users go paid once they see how much manual chart-reading it replaces.

***

### ⚙️ Input reference

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `keywords` | array | **Yes** | — | Keywords / product names to analyze (one lookup each) |
| `geo` | string | No | `"GB"` | ISO country code (`US`, `GB`, `FR`, `DE`, …) |
| `timeframe` | string | No | `"today 3-m"` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y` |
| `proxyConfiguration` | object | No | Apify Proxy (Residential) | **Keep residential on** for the best success rate against Google's blocks |
| `delayBetweenRequests` | integer | No | `10000` | Delay (ms) between keywords. Increase if you ever see blocks |
| `maxRetries` | integer | No | `4` | Retries per keyword (fresh proxy session + backoff) before giving up |
| `requestTimeout` | integer | No | `30000` | Timeout (ms) per request |

***

### 🛡️ Built to survive Google's blocks

Most free Google Trends scripts die the moment Google notices them. This Actor is engineered for reliability:

- **Residential proxy rotation** — each request (and each retry) uses a fresh, real-user IP.
- **Automatic retries with exponential backoff** — transient `429`/block responses are retried, not dropped.
- **HTML/block detection** — recognizes Google's block pages and rotates instead of saving garbage.
- **Graceful rate limiting** — configurable delays keep you under Google's radar.
- **Graceful abort** — stop a run anytime; it shuts down cleanly without partial charges.

***

### ❓ FAQ

**Is this legal?** It collects the same publicly available data shown on the Google Trends website. It stores **no personal data**. Always review Google's Terms of Service for your use case.

**Why did a keyword return no data?** Some niche keywords genuinely have too little search volume for Google to report. You're **not charged** for keywords that return no result.

**How accurate are the numbers?** `avg_interest`, `peak_interest`, and `raw_data` come directly from Google Trends. `trend_score`, `growth_rate`, and `volatility` are computed from that timeline using transparent formulas (see the source).

**Can I schedule it?** Yes — use Apify **Schedules** to run it daily/weekly, and **Webhooks/Integrations** (Make, Zapier, Slack, Google Sheets) to push results anywhere automatically.

**Can I run it without a proxy?** You can, but Google will likely block datacenter IPs quickly. Residential proxy is strongly recommended and on by default.

***

### 🤝 Support

Found a bug or want a new metric? Open an issue on the Actor page — issues are read and acted on. Your feedback directly shapes the roadmap.

### 🔧 For developers

```bash
apify run            # run locally
apify login && apify push   # deploy to Apify
```

**Built with:** [Apify SDK](https://docs.apify.com/sdk/js/) · [google-trends-api](https://www.npmjs.com/package/google-trends-api) · [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent)

# Actor input Schema

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

List of search keywords/product names to look up on Google Trends. Each keyword triggers a separate trends lookup.

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

ISO country code to filter Google Trends results (e.g. GB for United Kingdom, US for United States, FR for France).

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

Time range for the trends data.

## `delayBetweenRequests` (type: `integer`):

Delay in milliseconds between each keyword lookup. Google Trends has strict rate limits — increase this if you get blocked.

## `requestTimeout` (type: `integer`):

Timeout in milliseconds for each Google Trends API call.

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

How many times to retry a keyword (with a fresh proxy session and exponential backoff) when Google rate-limits or blocks the request.

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

Google blocks datacenter IPs aggressively. Residential Apify Proxy is strongly recommended for reliable results.

## Actor input object example

```json
{
  "keywords": [
    "trending products",
    "best sellers",
    "new arrivals"
  ],
  "geo": "GB",
  "timeframe": "today 3-m",
  "delayBetweenRequests": 10000,
  "requestTimeout": 30000,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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": [
        "trending products",
        "best sellers",
        "new arrivals"
    ],
    "geo": "GB",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_ops_main/google-trends").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": [
        "trending products",
        "best sellers",
        "new arrivals",
    ],
    "geo": "GB",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("data_ops_main/google-trends").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": [
    "trending products",
    "best sellers",
    "new arrivals"
  ],
  "geo": "GB",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call data_ops_main/google-trends --silent --output-dataset

```

## MCP server setup

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

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/KYyYuLygEhU7NZwgd/builds/RGEgemmrPW9M32Y07/openapi.json
