# Google Trends Scraper Pro: Compare Keywords, Regions & CSV (`muarafa/google-trends-pro`) Actor

Scrape Google Trends: interest over time, interest by region/city, related queries and topics. Compare up to 5 keywords, any country, any time range. CSV export, smart retries and proxy rotation. $0.005 per query.

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

## Pricing

$5.00 / 1,000 query 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 Pro – Compare Keywords, Regions, Related Queries & CSV Export

Get **everything Google Trends shows you** – as clean JSON and ready-to-open CSV files – for any keyword, any country and any time range. Compare up to **5 keywords on the same scale**, get **interest by state, city or metro**, and pull **top & rising related queries and topics**. Built to *not* hang and *not* bill you for empty runs.

**$0.005 per query** ($5 per 1,000). Failed queries are never charged.

### Why this scraper?

Most Google Trends scrapers on the market drive a full browser, are slow, get rate-limited and – the most common complaint – **run for minutes and return nothing while still charging you**. This one is different:

| Problem with other scrapers | What Google Trends Scraper Pro does |
|---|---|
| Runs hang for 20+ minutes with no output | Lightweight HTTP client, typical query finishes in **3–10 seconds** |
| Blocked by Google (HTTP 429) → empty dataset | **Smart retry**: exponential backoff + fresh cookies + new proxy IP on every retry |
| You pay even when nothing comes back | **No data = no charge.** Failed queries are logged with the reason, never billed |
| One term at a time | **Compare up to 5 terms** in one query, exactly like the Trends website |
| JSON only | **CSV files** for every query + one combined CSV, linked in each result |
| Only country-level data | Region resolution: **country, state/region, city or US metro (DMA)** |

### What you get

For every line in **Search terms** you get one result with:

- **Interest over time** – the 0–100 timeline for each term, with dates and partial-data flags
- **Average interest** per term for the period
- **Interest by region** – countries, states, cities or metros
- **Related queries** – top & rising, for each term
- **Related topics** – top & rising entities, for each term
- **CSV download links** – interest over time and interest by region
- **Explore URL** – open the exact same view on trends.google.com

### Input example

```json
{
  "searchTerms": ["chatgpt, gemini, claude", "electric car"],
  "geo": "US",
  "timeRange": "today 12-m",
  "regionResolution": "AUTO",
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "exportCsv": true,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

- `"chatgpt, gemini, claude"` → **one comparison query** (3 terms on the same scale) = 1 result
- `"electric car"` → a single-term query = 1 result

Time ranges: past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months, 5 years, 2004–present, or a **custom** range like `2024-01-01 2024-12-31`. Search type: Web, Images, News, Shopping, YouTube. Any Google Trends category ID.

### Output example

```json
{
  "query": "chatgpt vs gemini vs claude",
  "keywords": ["chatgpt", "gemini", "claude"],
  "geo": "US",
  "timeRange": "today 12-m",
  "averages": { "chatgpt": 74, "gemini": 27, "claude": 19 },
  "interestOverTime": [
    {
      "date": "2025-10-19T00:00:00.000Z",
      "formattedTime": "Oct 19 – 25, 2025",
      "values": { "chatgpt": 100, "gemini": 19, "claude": 6 },
      "isPartial": false
    }
  ],
  "interestByRegion": [
    { "geoCode": "US-NJ", "geoName": "New Jersey", "values": { "chatgpt": 65, "gemini": 20, "claude": 15 }, "hasData": true }
  ],
  "relatedQueries": {
    "chatgpt": {
      "top": [{ "query": "what is chatgpt", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=what+is+chatgpt..." }],
      "rising": [{ "query": "chatgpt 5", "value": 4250, "formattedValue": "+4,250%", "link": "..." }]
    }
  },
  "relatedTopics": { "chatgpt": { "top": [], "rising": [] } },
  "csvInterestOverTimeUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-chatgpt-vs-gemini-vs-claude-over-time.csv",
  "csvInterestByRegionUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-chatgpt-vs-gemini-vs-claude-by-region.csv",
  "exploreUrl": "https://trends.google.com/trends/explore?q=chatgpt%2Cgemini%2Cclaude&date=today+12-m&geo=US",
  "status": "ok",
  "partialErrors": [],
  "durationSecs": 4.2
}
```

CSV (`...-over-time.csv`):

```csv
date,chatgpt,gemini,claude,isPartial
2025-10-19,100,19,6,false
2025-10-26,91,19,6,false
```

A combined long-format file `ALL-interest-over-time.csv` (query, date, keyword, value) is saved to the run's key-value store – perfect for Excel, Google Sheets, Looker Studio or pandas.

### Use cases

- **SEO & content planning** – find rising queries before competitors, pick the keyword with more demand
- **Market research** – compare brands, products or categories across countries and states
- **E-commerce & dropshipping** – spot seasonal peaks and trending products (use *Google Shopping* search type)
- **YouTube creators** – measure topic demand on YouTube search specifically
- **Finance & crypto** – track retail attention on tickers and coins over time
- **Dashboards & AI agents** – schedule daily runs and feed the JSON/CSV to BI tools, Make, Zapier or LLM pipelines

### Pricing

Pay-per-event: **$0.005 per successful query** (one line of search terms, up to 5 compared keywords) – that's **$5 per 1,000 queries**, with all sections (timeline, regions, related queries & topics, CSV) included. No data → no charge. You can cap spending with the *Maximum cost per run* setting; the scraper stops cleanly when the cap is reached.

### Tips for large runs

- Keep **Apify Proxy** enabled (default). If you see many 429 retries in the log, switch the proxy group to **RESIDENTIAL**.
- Increase **Delay between queries** to 3–5 s for runs with hundreds of queries.
- Values are **relative** (0–100) inside one query. To compare terms with each other, put them on the same line.

### FAQ

**Are the numbers absolute search volumes?** No – Google Trends only publishes relative interest (0–100). This is the same data you see on trends.google.com.

**Why are related topics sometimes empty?** Google doesn't publish them for every term/period (e.g. very small volume). The website shows the same empty list.

**Can I use it via API?** Yes – call it from the Apify API, the JS/Python client, Make, Zapier, n8n or as an MCP tool for AI agents.

Questions or a feature request? Open an issue on the **Issues** tab – we respond fast.

# Actor input Schema

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

One query per line. To COMPARE up to 5 terms on the same scale (like the Trends website), put them on one line separated by commas, e.g. <code>bitcoin, ethereum, solana</code>. Each line is one query and one billable result.

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

Country or region code. Leave empty for Worldwide. Examples: <code>US</code>, <code>GB</code>, <code>DE</code>, <code>EG</code>, <code>US-CA</code> (California), <code>GB-ENG</code>.

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

Period to analyse. Choose <b>Custom</b> to set exact dates below.

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

Used only when Time range = Custom. Format: <code>YYYY-MM-DD YYYY-MM-DD</code>, e.g. <code>2024-01-01 2024-12-31</code>.

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

Which Google property the interest is measured on.

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

Google Trends category ID (0 = all categories). Examples: 3 = Arts & Entertainment, 5 = Computers & Electronics, 7 = Finance, 18 = Shopping, 45 = Health, 71 = Food & Drink.

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

Timeline of relative interest (0–100) for each term.

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

Breakdown by country / state / city.

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

Granularity of the region breakdown. AUTO = what the Trends website shows (countries for Worldwide, states/regions for a country).

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

Also return regions with too little data (value 0).

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

Top and rising related search queries for each term.

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

Top and rising related topics (entities) for each term.

## `exportCsv` (type: `boolean`):

Save ready-to-open CSV files (interest over time, interest by region, and one combined file) to the key-value store. Links are added to every result.

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

Language for names of regions and topics, e.g. <code>en-US</code>, <code>de</code>, <code>ar</code>.

## `timezoneOffset` (type: `integer`):

Offset from UTC in minutes as Google expects it (UTC = 0, New York = 300, Berlin = -60).

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

When Google rate-limits (HTTP 429), the scraper waits with exponential backoff and retries with a fresh session and proxy IP.

## `delayBetweenQueriesSecs` (type: `integer`):

Pause between queries. Higher = fewer blocks on large runs.

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

Google Trends rate-limits datacenter IPs. Apify Proxy is enabled by default; switch to the RESIDENTIAL group if you see repeated 429 errors.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt, gemini, claude",
    "electric car",
    "iphone 17"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "customTimeRange": "2024-01-01 2024-12-31",
  "property": "",
  "category": 0,
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "AUTO",
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "exportCsv": true,
  "language": "en-US",
  "timezoneOffset": 0,
  "maxRetries": 6,
  "delayBetweenQueriesSecs": 1,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        "chatgpt, gemini, claude",
        "electric car"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("muarafa/google-trends-pro").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": [
        "chatgpt, gemini, claude",
        "electric car",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("muarafa/google-trends-pro").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": [
    "chatgpt, gemini, claude",
    "electric car"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call muarafa/google-trends-pro --silent --output-dataset

```

## MCP server setup

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

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/frhSNnZKCASaldVjm/builds/nbMAojhBreXAdmuwA/openapi.json
