# Google Trends Scraper — Forecast, Seasonality & Countries (`angelrxdriguez/google-trends-scraper`) Actor

Google Trends for many keywords and countries on one comparable scale, plus what other scrapers don't give: seasonality (peak months), year-over-year growth, spike detection and a 12-month forecast with its measured error. Related queries, regions, trending now.

- **URL**: https://apify.com/angelrxdriguez/google-trends-scraper.md
- **Developed by:** [Ángel Panadero Rodríguez](https://apify.com/angelrxdriguez) (community)
- **Categories:** SEO tools, Marketing, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.25 / 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 — Forecast, Seasonality & Countries

Get **Google Trends data for many keywords and countries in one run**, and the answers the raw curve
doesn't give you: **when demand peaks every year, whether it is growing, if it is spiking right now,
and where it is heading in the next 12 months**, with the forecast's measured error so you know how
much to trust it.

- **Interest over time** for every keyword and location, all on **one comparable 0-100 scale**.
- **Forecast & seasonality analysis** for every keyword and location:
  - peak and low months, a month-by-month seasonality index and the next expected peak;
  - year-over-year and 3-year change, 4-week momentum and a spike flag;
  - a 12-month forecast with low/high range and the error measured on real data.
- **Interest by region**: states, regions, cities or metro areas.
- **Related queries**: top and rising, including **Breakout** searches.
- **Trending now** in any country, with news articles, and an *only new trends* mode for alerts.
- Web, YouTube, Google Shopping, News and Image search, with category filters.

### Why this scraper

- **Forecast and seasonality nobody else gives you.** Other Google Trends scrapers hand you the curve
  and leave the analysis to you. Here every keyword comes with its seasonal pattern and a forecast.
- **An honest forecast.** For every keyword we test three forecasting methods on one past year, keep
  the best, and then measure its error on the most recent year, which was *not* used to pick it. You
  get that error (`forecastErrorPercent`), a quality label and the error of the simple "same month last
  year" baseline, so you can see the forecast is earning its keep.
- **It spots glitches in Google's own data.** Google Trends sometimes shows sudden temporary jumps
  that are not real demand (in spring 2026 many US searches jumped 3-5x for three months). They are
  detected, reported in `dataWarnings` and left out of the seasonality, growth and forecast, so they
  don't fool you. The curve itself is returned untouched.
- **Compare everything on one scale.** Google compares at most 5 terms at a time. This scraper links
  any number of keywords and countries through a reference term, so "air fryer in the US" and "slow
  cooker in Germany" are directly comparable in the same run.
- **Pay per result, not per run.** No big start fee: analyzing one keyword costs a fraction of a cent,
  ideal for API and AI-agent calls.
- **Spreadsheet-ready.** Choose *Flat* output for one row per date, region, query and forecast month,
  ready for Excel or Google Sheets, at the same price.
- **Failures are free.** Anything that can't be fetched gets an `error` row that is never charged.
- **Reliable without proxies.** It uses the same public data the Google Trends website loads, at a
  polite pace, and slows down or stops by itself if Google asks it to.

### Use cases

- **E-commerce and Amazon sellers**: when to stock up, launch and run ads for each product and country.
- **Content and SEO planning**: publish before the seasonal peak; find rising and Breakout queries.
- **Market expansion**: which country shows the most and the fastest-growing interest.
- **Analysts and investors**: momentum, year-over-year growth and spikes as demand signals.
- **Newsrooms and social media**: scheduled *trending now* alerts with only the new trends.

### Input

| Field | Description |
|---|---|
| `mode` | `explore` (keywords, with forecast) or `trendingNow` |
| `keywords` | Search terms, e.g. `["air fryer", "slow cooker"]` |
| `countries` | Country codes (`US`, `GB`, `DE`…), regions (`US-CA`) or `worldwide` |
| `timeRange` | `past 7 days` … `past 12 months`, `past 5 years`, `since 2004`, or `startDate` + `endDate` |
| `dataTypes` | `interestOverTime`, `interestByRegion`, `relatedQueries`, `analysis` (all by default) |
| `compareMode` | `together` (one shared scale, default) or `separate` (own scale each) |
| `forecastMonths` | 0-12 (default 12) |
| `searchType`, `category` | Web, YouTube, Shopping, News or Images; a Google Trends category |
| `regionResolution` | Countries, regions, cities or US metro areas |
| `trendingCountries`, `onlyNewTrends`, `stateKey` | Trending now mode |
| `outputFormat` | `nested` (JSON) or `flat` (spreadsheets) |

Example: two products in four countries, with forecast:

```json
{
  "mode": "explore",
  "keywords": ["air fryer", "slow cooker"],
  "countries": ["US", "GB", "DE", "ES"],
  "timeRange": "past 12 months"
}
```

Example: daily alert with only the new trending searches in the US and the UK:

```json
{
  "mode": "trendingNow",
  "trendingCountries": ["US", "GB"],
  "onlyNewTrends": true,
  "stateKey": "daily-us-uk"
}
```

### Output

One result per keyword, location and data type. The **analysis** result for "air fryer" in the UK
(real data, November 2026, shortened):

```json
{
  "dataType": "analysis",
  "keyword": "air fryer",
  "geo": "GB",
  "basedOn": "weekly interest, past 5 years, own 0-100 scale",
  "latestValue": 36,
  "average": 40.02,
  "peakValue": 100,
  "peakDate": "2023-12-24T00:00:00Z",
  "dataQuality": "ok",
  "yoyChangePercent": -9.0,
  "change3yPercent": -33.9,
  "trend": "stable",
  "momentumPercent": 4.1,
  "isSpiking": false,
  "seasonality": {
    "strength": 0.6,
    "label": "strong",
    "index": {"Jan": 1.27, "Feb": 1.02, "Mar": 0.97, "Apr": 0.97, "May": 0.8, "Jun": 0.74,
              "Jul": 0.84, "Aug": 0.87, "Sep": 0.96, "Oct": 1.03, "Nov": 1.28, "Dec": 1.26},
    "peakMonths": ["Nov", "Jan", "Dec"],
    "lowMonths": ["Jun", "May", "Jul"],
    "nextPeakMonth": "2026-11"
  },
  "forecast": [
    {"month": "2026-11", "value": 38.7, "low": 36.0, "high": 41.3},
    {"month": "2026-12", "value": 41.6, "low": 38.7, "high": 44.4}
  ],
  "forecastMethod": "seasonal_naive_scaled",
  "forecastErrorPercent": 6.8,
  "forecastQuality": "good",
  "seasonalNaiveErrorPercent": 9.0,
  "trendsUrl": "https://trends.google.com/trends/explore?q=air+fryer&date=today+5-y&geo=GB"
}
```

Other results: `interestOverTime` (the curve, with `timeline` points and `scale`), `interestByRegion`
(`regions` with rank and value), `relatedQueries` (`top` and `rising`, with `isBreakout`) and
`trendingNow` (query, approximate searches, start time and news articles).

You can download the results as JSON, CSV, Excel or XML, or get them through the Apify API.

### How the forecast works

1. Five years of weekly interest are summarized by month (median, so one odd week doesn't move it).
   Unusual temporary surges or drops (more than twice, or less than half, the usual level for that
   month) are detected and replaced by the expected value; they are listed in `dataWarnings`.
2. A seasonality index is computed for every month (ratio to a centered 12-month moving average), with
   a strength from 0 (no seasonality) to 1 (purely seasonal).
3. Three methods are tested on the second-to-last year: seasonal index × damped trend, "same month
   last year" scaled to this year's level, and plain "same month last year". The best one is kept.
4. Its error is measured on the last year, which was not used to choose it: that is
   `forecastErrorPercent` (sMAPE, leaving out the months flagged in `dataWarnings`). Below 15 % is
   `good`, below 30 % `fair`, otherwise `poor`. `dataQuality` warns about keywords with too little
   search volume (`low_volume`, `low_resolution`): their analysis is less reliable.
5. The forecast for the next months comes with a low/high range based on that error.

Google Trends values are relative, so the forecast is in the same 0-100 scale as the keyword's own
5-year curve.

### FAQ

**Are these search volumes?** No. Google Trends gives relative interest from 0 to 100, where 100 is the
highest point for the selection. Trending-now searches include Google's approximate search counts.

**Why can numbers differ slightly from the website?** Google computes Trends from a sample of searches,
so values can change a little between requests or days.

**What is `dataWarnings`?** Periods where Google's data jumps or drops far away from the keyword's usual
pattern and then comes back. They often come from changes in how Google collects data, not from real
demand, so the analysis leaves them out and tells you.

**How fast is it?** About two requests per second at most, so a keyword in one country with all data
types takes about 10 seconds; 10 keywords in 5 countries take a few minutes.

**Is it legal?** It collects public, aggregated Google Trends data (no personal data) using only paths
that trends.google.com's `robots.txt` allows. This Actor is not affiliated with or endorsed by Google;
Google Trends is a trademark of Google LLC.

**Something is missing or broken?** Open an issue on the *Issues* tab. We read every issue and fix
problems as fast as we can.

# Actor input Schema

## `mode` (type: `string`):

<b>explore</b>: interest over time, by region, related queries and the forecast & seasonality analysis for your keywords. <b>trendingNow</b>: what people are searching for right now in one or more countries.

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

Search terms to analyze, e.g. air fryer, bitcoin, yoga mat. Every keyword is analyzed in every location.

## `countries` (type: `array`):

Two-letter country codes (US, GB, DE, ES, IN...), regions such as US-CA, or worldwide. Leave empty for the United States.

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

Period for interest over time, by region and related queries. The forecast & seasonality analysis always uses the past 5 years.

## `startDate` (type: `string`):

Optional (YYYY-MM-DD). With an end date, replaces the time range.

## `endDate` (type: `string`):

Optional (YYYY-MM-DD). Defaults to today when only a start date is set.

## `dataTypes` (type: `array`):

Each type is one result per keyword and location. <b>Analysis</b> adds seasonality (peak and low months), year-over-year growth, momentum, spike detection and a 12-month forecast with its measured error.

## `compareMode` (type: `string`):

<b>One shared scale</b>: every keyword and location on the same 0-100 scale, so you can compare them directly (more than 5 are linked through a reference term). <b>Own scale</b>: each keyword and location scaled 0-100 on its own.

## `forecastMonths` (type: `integer`):

How many months ahead to forecast (0 = no forecast, only seasonality and growth).

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

Google property, as in the Google Trends menu.

## `category` (type: `string`):

Limit results to a category, e.g. Shopping or Health.

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

Detail of interest by region: countries (for worldwide), regions or states, cities, or metro areas (US DMA).

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

Also return regions where search volume is low.

## `trendingCountries` (type: `array`):

Two-letter country codes, e.g. US, GB, IN, BR. Leave empty for the United States.

## `onlyNewTrends` (type: `boolean`):

Skip trends already returned in previous runs with the same State key. Ideal for scheduled alerts: you only pay for what is new.

## `stateKey` (type: `string`):

Name of the memory used by Only new trends. Use a different key for each scheduled task.

## `outputFormat` (type: `string`):

<b>Nested</b>: one row per keyword, location and data type, with arrays (best for JSON and APIs). <b>Flat</b>: one row per date, region, query and forecast month (best for Excel and Google Sheets). The price is the same.

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

Google Trends interface language for region names, e.g. en-US, es, de, fr.

## `secondsBetweenRequests` (type: `number`):

Pause between requests to Google Trends. The scraper slows down by itself if Google asks it to.

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

Not needed.

## Actor input object example

```json
{
  "mode": "explore",
  "keywords": [
    "air fryer",
    "slow cooker"
  ],
  "countries": [
    "US",
    "GB"
  ],
  "timeRange": "past 12 months",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "analysis"
  ],
  "compareMode": "together",
  "forecastMonths": 12,
  "searchType": "web",
  "category": "0",
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "trendingCountries": [
    "US"
  ],
  "onlyNewTrends": false,
  "stateKey": "default",
  "outputFormat": "nested",
  "language": "en-US",
  "secondsBetweenRequests": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Interest over time, by region, related queries, forecast & seasonality analysis and trending searches.

# 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": [
        "air fryer",
        "slow cooker"
    ],
    "countries": [
        "US",
        "GB"
    ],
    "trendingCountries": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("angelrxdriguez/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": [
        "air fryer",
        "slow cooker",
    ],
    "countries": [
        "US",
        "GB",
    ],
    "trendingCountries": ["US"],
}

# Run the Actor and wait for it to finish
run = client.actor("angelrxdriguez/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": [
    "air fryer",
    "slow cooker"
  ],
  "countries": [
    "US",
    "GB"
  ],
  "trendingCountries": [
    "US"
  ]
}' |
apify call angelrxdriguez/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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