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

Google Trends for many keywords per run: interest over time, by region, related queries, and trend metrics (rising or falling, change %, peak, busiest month). Compare any number of keywords on one shared scale.

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

## Pricing

from $1.25 / 1,000 keywords

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

Get Google Trends data for **many keywords in one run**: interest over time, interest by country or state, top and rising related searches, and ready-made trend metrics such as rising or falling, % change, peak and busiest month. Compare **any number of keywords on one shared scale**, not just the 8 the Google Trends website allows (5 in classic Explore).

- ✅ **Many keywords per run.** Paste 3 or 300 keywords; each one becomes a clean result.
- ✅ **Compare 10, 50 or 100+ keywords on one scale.** Shared-scale mode links groups of keywords so all values are comparable, with a "share of search" for each keyword.
- ✅ **Trend metrics included.** Average, latest, peak, trend direction, % change and busiest month, so you don't have to compute them yourself.
- ✅ **Rising searches and breakouts.** The top and rising related queries for every keyword.
- ✅ **Fast and light.** Plain HTTP requests, no browser. A run with a few keywords takes seconds.

### What data do you get?

One result per keyword:

| Field | Example | Notes |
|---|---|---|
| `keyword` | matcha | |
| `location`, `timeRange`, `searchType`, `category` | US, today 12-m, web, 0 | What the numbers are for |
| `averageInterest`, `latestInterest`, `peakInterest`, `peakDate` | 75.4, 62, 100, 2026-04-05 | On the 0-100 Google Trends scale |
| `trend`, `trendChangePercent` | rising, 28.7 | Last quarter of the period compared with the first quarter (±10% counts as stable) |
| `busiestMonth` | April | Month with the highest average interest (periods of about a year or longer) |
| `shareOfSearch` | 38.2 | Shared scale only: the keyword's share of all interest in the run, in % |
| `interestOverTime` | `[{ "date": "2025-10-05", "value": 61, "partial": false }, ...]` | The full time series; `partial: true` marks the unfinished last week or day |
| `interestByRegion` | `[{ "code": "US-WY", "name": "Wyoming", "value": 100 }, ...]` | Countries for worldwide searches, states or regions within a country |
| `relatedQueriesTop` | `[{ "query": "matcha latte", "value": 100 }, ...]` | Most searched related queries |
| `relatedQueriesRising` | `[{ "query": "kfc matcha", "change": "+750%", "increasePercent": 750, "breakout": false }, ...]` | Fastest growing related queries; "Breakout" means more than +5,000% |
| `scale` | own / shared | How to compare the values (see below) |
| `googleTrendsUrl`, `scrapedAt` | | Open the same search on Google Trends |

### Own scale or shared scale?

- **Own scale (default):** every keyword gets its own 0-100 curve, where 100 is that keyword's peak. Best to see how each keyword develops over time.
- **Shared scale:** all keywords in the run are compared with each other, like the compare view on Google Trends, but for any number of keywords. 100 is the highest point of the most searched keyword. Best to answer "which keyword is searched more?". Google's Trends API compares at most 5 keywords per request (the website shows up to 8), so the scraper links groups of 5 through their most searched keyword.

### How to use it

1. Enter your **keywords**, one per line.
2. Pick the **scale**, **time range** and **location** (empty = worldwide).
3. Click **Start** and download the results as JSON, CSV or Excel, or use the API.

#### Input example

```json
{
    "keywords": ["python", "javascript", "rust", "go", "kotlin", "typescript"],
    "comparison": "shared",
    "timeRange": "today 5-y",
    "geo": "",
    "category": 0
}
```

#### Output example

```json
{
    "keyword": "matcha",
    "geo": "US",
    "location": "US",
    "timeRange": "today 12-m",
    "category": 0,
    "searchType": "web",
    "scale": "own",
    "averageInterest": 75.4,
    "latestInterest": 62,
    "latestDate": "2026-09-27",
    "peakInterest": 100,
    "peakDate": "2026-04-05",
    "trend": "rising",
    "trendChangePercent": 28.7,
    "busiestMonth": "April",
    "shareOfSearch": null,
    "interestOverTime": [
        { "date": "2025-10-05", "value": 58, "partial": false },
        { "date": "2025-10-12", "value": 61, "partial": false }
    ],
    "interestByRegion": [{ "code": "US-HI", "name": "Hawaii", "value": 100 }],
    "relatedQueriesTop": [{ "query": "matcha latte", "value": 100 }],
    "relatedQueriesRising": [{ "query": "kfc matcha", "change": "+750%", "increasePercent": 750, "breakout": false }],
    "googleTrendsUrl": "https://trends.google.com/trends/explore?q=matcha&date=today+12-m&hl=en&geo=US",
    "scrapedAt": "2026-10-10T18:18:12.000Z"
}
```

### Pricing

You pay per keyword result, plus a tiny fee per run start. There is no monthly rental, and keywords that fail cost nothing. The exact price for your Apify plan is on the **Pricing** tab. For example, 100 keywords cost well under one dollar.

To cap spending, set a **maximum cost per run** in the run options. The scraper stops cleanly when it reaches your limit.

### Tips

- **Ambiguous keywords:** "go", "swift" or "java" are also everyday words. Set a **category** (for example 31 = Programming, 71 = Food & Drink) to narrow them down.
- **Track trends over time:** schedule a weekly run and compare `latestInterest` and `trend` between runs.
- **Market research:** use the shared scale with a list of competitors or products and sort by `shareOfSearch`.
- **Content ideas:** `relatedQueriesRising` shows what people have started searching for recently.

### Use it as an API, from Python or from AI tools

Every run is also an API call. From Python, with the official [Apify client](https://docs.apify.com/api/client/python):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("ralfij/google-trends-scraper").call(
    run_input={"keywords": ["python", "rust", "go"], "comparison": "shared", "timeRange": "today 5-y"}
)
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["keyword"], row["averageInterest"], row["trend"], row["shareOfSearch"])
```

More Python examples, plus a tutorial on how Google Trends data works and how to compare more keywords than Google allows, are on GitHub: [RalfIJ/google-trends-api](https://github.com/RalfIJ/google-trends-api).

To let an AI assistant such as Claude, Cursor or VS Code look up Google Trends for you, add this MCP server URL in its settings: `https://mcp.apify.com?tools=ralfij/google-trends-scraper`

### FAQ

**Is there an official Google Trends API?**
Google announced one in July 2025, but it is an alpha with limited, application-based access. This actor works today for anyone and returns the same scaled interest values as the Google Trends website.

**Is this a pytrends alternative?**
Yes. pytrends was archived in April 2025 and often fails with "429 Too Many Requests" errors. This actor handles Google's session cookies and rotates IP addresses for you, and you can call it from Python with the snippet above.

**Is it free to try?**
Yes. Apify's free plan includes $5 of credit every month, with no credit card needed. That covers more than 2,000 keywords at the standard price.

**How accurate is the shared scale for many keywords?**
It uses the same numbers Google returns, linked through the most searched keyword of each group. Google rounds to whole numbers, so very small keywords next to very large ones can show as 0. Compare keywords of a similar size for the best precision.

**Why are related topics not included?**
Google does not return related topics to automated requests. Related queries (top and rising) are included.

**Why do rising queries include unrelated searches?**
Sometimes Google's own data does. In October 2026, the top rising searches for "coffee" in the US included "sports scores today" and "pet care tips", and the Google Trends website showed exactly the same list. The actor returns what Google shows, so filter out what you don't need.

**Which time zone are the dates in?**
UTC.

**Which locations work?**
Worldwide (leave the location empty), any country code (US, GB, DE, IN, NL...) and regions such as US-CA.

**Is scraping Google Trends legal?**
This actor reads publicly available, aggregated search interest. It does not log in anywhere and collects no personal data. You are responsible for how you use the data.

**Something broke. What should I do?**
Open an issue on the **Issues** tab with your input, and it will be looked at quickly.

**Did it save you time?**
A short review on the **Reviews** tab helps other people find it.

*This actor is not affiliated with, endorsed by or sponsored by Google. Google Trends is a trademark of Google LLC.*

# Actor input Schema

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

Search terms to look up, one per line. There is no limit of 8 like on the Google Trends website.

## `comparison` (type: `string`):

Own scale: every keyword gets its own 0-100 curve (best for spotting each keyword's trend). Shared scale: all keywords are compared with each other, like the Google Trends compare view but for any number of keywords (best for 'which is searched more').

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

Period to look at. Google picks the resolution: hourly for the past day, daily up to 3 months, weekly up to 5 years, monthly for all time.

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

Optional. Overrides the time range above. Format: "2024-01-01 2024-12-31".

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

Country code (US, GB, DE, NL...), region (US-CA) or empty for worldwide.

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

Which Google search to measure.

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

Google Trends category ID to narrow ambiguous keywords (for example 71 = Food & Drink). 0 = all categories.

## `includeRegions` (type: `boolean`):

Add the countries, states or regions where each keyword is most popular.

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

Add top and rising related searches, including breakout searches.

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

Google Trends limits requests per IP address. Residential proxies work best.

## Actor input object example

```json
{
  "keywords": [
    "coffee",
    "tea",
    "matcha"
  ],
  "comparison": "separate",
  "timeRange": "today 12-m",
  "geo": "US",
  "searchType": "web",
  "category": 0,
  "includeRegions": true,
  "includeRelatedQueries": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `keywords` (type: `string`):

One item per keyword with its time series, regions, related searches and trend metrics.

## `runSummary` (type: `string`):

Status of every keyword in this run.

# 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": [
        "coffee",
        "tea",
        "matcha"
    ],
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ralfij/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 = {
    "keywords": [
        "coffee",
        "tea",
        "matcha",
    ],
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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