# Google Trends API – Interest, Regions & Related Queries (`batuweb/google-trends-scraper`) Actor

Reliable Google Trends API alternative: interest over time, interest by country/region/city, related queries and topics (top & rising) for up to 5 compared keywords. Web, News, YouTube, Images, Shopping. Retries + proxies included. From $0.002/search.

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

## Pricing

from $0.70 / 1,000 search 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 – reliable Google Trends API alternative

Extract **Google Trends data** without the failures: **interest over time**, **interest by region** (country, state, city, metro), **related queries** and **related topics** (top and rising) for any keyword, or compare up to **5 keywords** at once. Works for **Web, News, YouTube, Image and Google Shopping** search, any country, any time range from the past hour to 2004–present.

Built to be polite and reliable: each search runs in a proxy session with Google cookies; if Google rate-limits, the Actor waits (20 s, then 40 s) and retries a couple of times, then returns a free `RATE_LIMITED` record instead of hammering the service. Searches are spaced a few seconds apart.

### What can this Google Trends scraper do?

- 📈 **Interest over time** – weekly/daily/hourly 0–100 timeline plus averages per keyword
- 🗺️ **Interest by region** – countries, regions/states, cities or US metro areas (DMA)
- 🔎 **Related queries** – top and rising (breakout) searches for keyword research and SEO
- 🧩 **Related topics** – top and rising topics with Knowledge Graph IDs, whenever Google provides them (currently only for single-keyword searches, and often empty)
- ⚖️ **Keyword comparison** – up to 5 terms on one line, e.g. `coffee, tea, matcha`
- 🎯 Filter by **country/region (geo)**, **category**, **time range**, **custom dates** and **Google property**
- 🔗 A direct Google Trends link for every result

### How much does it cost?

Pay per result: from $0.002 per search line that returns data (less on higher Apify plans), plus a tiny $0.00005 start fee. A comparison of up to 5 keywords counts as one result. Failed or empty searches are never charged. Proxy costs are included.

### Input

| Field | Example | Notes |
|---|---|---|
| `searchTerms` | `["web scraping", "coffee, tea"]` | One search per line, comma-separate up to 5 keywords to compare (duplicates are removed) |
| `geo` | `DE`, `US-CA` | Empty = worldwide |
| `timeframe` | `today 12-m` | `now 1-H`, `now 7-d`, `today 3-m`, `today 5-y`, `all` … |
| `customTimeRange` | `2024-01-01 2024-12-31` | Overrides `timeframe` |
| `gprop` | `youtube` | `web`, `news`, `youtube`, `images`, `froogle` (Shopping) |
| `category` | `71` | 0 = all categories |
| `regionResolution` | `CITY` | `AUTO`, `COUNTRY`, `REGION`, `CITY`, `DMA` |

Toggle each section (`includeInterestOverTime`, `includeInterestByRegion`, `includeRelatedQueries`, `includeRelatedTopics`) to get only what you need.

### Output example

```json
{
  "type": "result",
  "input": "coffee, tea",
  "terms": ["coffee", "tea"],
  "geo": "DE",
  "timeframe": "today 12-m",
  "averageInterest": { "coffee": 24, "tea": 19 },
  "interestOverTime": { "points": [{ "date": "2025-10-12T00:00:00.000Z", "formattedTime": "Oct 12 – 18, 2025", "values": { "coffee": 24, "tea": 19 } }] },
  "interestByRegion": { "resolution": "REGION", "regions": [{ "geoCode": "DE-HE", "geoName": "Hesse", "values": { "coffee": 65, "tea": 35 } }] },
  "relatedQueries": { "coffee": { "top": [{ "query": "coffee machine", "value": 100 }], "rising": [{ "query": "…", "formattedValue": "Breakout" }] } },
  "relatedTopics": { "coffee": { "top": [], "rising": [] } },
  "trendsUrl": "https://trends.google.com/trends/explore?q=coffee%2Ctea&date=today+12-m&geo=DE"
}
```

Download as JSON, CSV, Excel or via API. Run statistics (requests, proxy usage, failures) are saved to the `OUTPUT` key-value record.

### Use cases

Keyword research and SEO content planning, seasonality analysis, product and market research, brand comparisons, YouTube topic discovery, e-commerce demand forecasting, and feeding trend data into dashboards or AI agents.

### FAQ

**What if Google rate-limits?** You get a free `RATE_LIMITED` record for that search (never charged). Try again later, or with fewer searches per run.

**Are the values absolute search volumes?** No – Google Trends returns relative interest (0–100) normalized to the highest point in the selection.

**Is scraping Google Trends legal?** It collects publicly available, aggregated, anonymous data. No personal data is extracted. Check your local laws and Google's terms for your use case.

### Related tools

- [SEO Audit Toolkit](https://apify.com/batuweb/seo-audit-toolkit) – once you know what people search for, check your site's titles, meta descriptions, broken links, sitemap and robots.txt.

***

Data source: Google Trends; not affiliated with Google. Google Trends is a trademark of Google LLC.

# Actor input Schema

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

One search per line. To compare keywords, put up to 5 on one line separated by commas, e.g. "coffee, tea". Each line is one result (and one charged event).

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

ISO country or region code such as US, DE, GB or US-CA. Leave empty for worldwide.

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

Preset time range. Use "Custom date range" below to override.

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

Optional. Format "YYYY-MM-DD YYYY-MM-DD", e.g. "2024-01-01 2024-12-31". Overrides the time range above.

## `gprop` (type: `string`):

Which Google search to analyse.

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

Google Trends category ID (0 = all categories). E.g. 71 = Food & Drink, 5 = Computers & Electronics, 7 = Finance.

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

Language for region names and topic titles, e.g. en-US, de.

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

Timeline of relative search interest (0–100).

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

Interest per country, region or city.

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

Top and rising related search queries for each term.

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

Top and rising related topics for each term.

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

Granularity for interest by region.

## `includeLowSearchVolumeRegions` (type: `boolean`):

Also return regions with low search volume.

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

Apify Proxy is used by default. The Actor rotates sessions and retries automatically.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "coffee, tea"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "gprop": "web",
  "category": 0,
  "language": "en-US",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "regionResolution": "AUTO",
  "includeLowSearchVolumeRegions": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Overview of each search.

## `fullData` (type: `string`):

Complete records with timelines, regions and related queries/topics.

## `stats` (type: `string`):

Succeeded/failed counts, requests and proxy usage.

# 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": [
        "web scraping",
        "coffee, tea"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("batuweb/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": [
        "web scraping",
        "coffee, tea",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("batuweb/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": [
    "web scraping",
    "coffee, tea"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call batuweb/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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