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

Google Trends data as JSON: interest over time, interest by country or region, and top and rising related queries for any keyword, compared or separately. Any country, time range and search type.

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

## Pricing

from $1.00 / 1,000 trends 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

Get **Google Trends** data for any keyword as clean JSON: **interest over time**, **interest by region**, **related queries** (top and rising) and, when Google provides them, **related topics**. It works for web, news, image, YouTube and Shopping searches, any country or region, and any time range from the past hour to 2004 onward.

Compare up to 5 terms on the same 0–100 scale, or fetch many keywords separately in one run.

### What you get

For each search term (or each comparison), one result with:

| Field | Description |
|---|---|
| `interestOverTime` | `[{ date, formattedTime, value, isPartial }]`, or one column per term when comparing |
| `averageInterest` | Average interest over the period |
| `interestByRegion` | `[{ geoCode, geoName, value }]` for countries, or states/regions when a country is set |
| `relatedQueries.top` / `.rising` | `[{ query, value, formattedValue }]`. Rising values can be "Breakout" |
| `relatedTopics.top` / `.rising` | `[{ title, type, mid, value }]`, included only when Google returns topic data |
| `googleTrendsUrl` | Opens the same view on Google Trends |

### Example input

```json
{
  "searchTerms": ["bitcoin", "ethereum"],
  "compareTerms": true,
  "geo": "US",
  "timeRange": "past_90_days"
}
```

### Use cases

- SEO and content planning: find rising queries before they peak
- Product and e-commerce research: seasonality, demand by region
- Investing and market research: attention trends for brands, coins and stocks
- AI agents: give Claude, ChatGPT or Cursor live trend data through the [Apify MCP server](https://mcp.apify.com)

### Pricing

$1.00 per 1,000 results (one result = one term, or one comparison group), plus a $0.002 start fee per run. For example, 10 keywords in one run cost about $0.012. There's no monthly fee, and a term that fails after retries costs nothing.

### Reliability

Google Trends heavily rate-limits automated traffic. This Actor rotates proxy sessions and backs off automatically. If Google blocks every attempt for a term, that term is skipped and not charged.

### Example: a weekly keyword trend report

1. Put your keywords in **Search terms** (one per line), choose a country and **Past 12 months**, then click **Save as a new task**.
2. In the task, open **Schedules** and add a weekly schedule.
3. Each run gives one result per keyword. Sort by `averageInterest`, or look at `relatedQueries.rising` to spot new searches early.
4. Add a Google Sheets, Slack or webhook integration on the task to get the results without opening Apify.

### Support

Something broken or missing? Open an issue on the **Issues** tab. We check them regularly.

# Actor input Schema

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

Keywords or topics, one per line, e.g. "bitcoin", "iphone 17".

## `compareTerms` (type: `boolean`):

Off: each term is fetched separately (one result each). On: up to 5 terms are compared on the same 0–100 scale in one result.

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

ISO code like US, GB, DE, or a region like US-CA. Leave empty for worldwide.

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

Period to analyze.

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

Optional. Format "YYYY-MM-DD YYYY-MM-DD", e.g. "2025-01-01 2025-06-30". Overrides the time range above.

## `searchType` (type: `string`):

Which Google property to measure.

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

Google Trends category ID (0 = all categories). Example: 7 = Finance, 18 = Shopping.

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

Timeline of search interest (0–100).

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

Countries, or sub-regions when a country is set.

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

Top and rising related searches.

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

Top and rising related topics.

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

Interface language, e.g. en-US, de, fr.

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

Apify Proxy is used by default. Google Trends rate-limits heavily; the Actor rotates sessions automatically.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin"
  ],
  "compareTerms": false,
  "geo": "",
  "timeRange": "past_12_months",
  "searchType": "web",
  "category": 0,
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "language": "en-US",
  "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": [
        "bitcoin"
    ]
};

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

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

```

## MCP server setup

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