# Google Trends Scraper + Trend Insights (`onepierre/google-trends-insights`) Actor

Scrape Google Trends (interest over time, by region, related queries & topics) and get ready-made insights: trend direction, momentum, peaks, seasonality and breakout queries. Pay only for successful results.

- **URL**: https://apify.com/onepierre/google-trends-insights.md
- **Developed by:** [Pierre Clarou](https://apify.com/onepierre) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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 + Trend Insights

Scrape **Google Trends** data and get **ready-made insights** on top: is a keyword rising or falling, how fast, is it seasonal, when does it peak, which queries are breaking out, and where interest is strongest. All of it comes as clean JSON, without the manual analysis.

**You pay only for successful results.** Failed queries are never pushed to the dataset, so they cost you nothing.

### What you get

For each search term (or comparison of up to 5 terms):

| Data | Description |
|---|---|
| 📈 **Interest over time** | Full time series (0–100), with ISO dates and the partial last period flagged |
| 🌍 **Interest by region** | Countries, or states/regions when you pick a country, sorted by interest |
| 🔎 **Related queries** | Top and rising queries, with **Breakout** queries flagged |
| 🏷️ **Related topics** | Top and rising topics (entity ID, title, type) |
| 🧠 **Trend insights** | Direction, % change, momentum, peak, volatility, seasonality and a one-sentence summary |
| ⚔️ **Comparison** | For multi-term runs: who leads overall, who leads now, and whether the leader changed |

#### Trend insights, computed for you

```json
{
  "term": "sunscreen",
  "direction": "rising",
  "changePercent": 55.2,
  "changeBasis": "year-over-year",
  "momentumPercent": -28.0,
  "latest": 16,
  "peak": { "value": 100, "date": "2026-06-07T00:00:00+00:00" },
  "isNearPeak": false,
  "volatility": 0.71,
  "seasonality": {
    "peakMonth": "June",
    "lowMonth": "December",
    "isSeasonal": true,
    "strength": 1.46,
    "consistency": 1.0
  },
  "breakoutQueries": ["joseon sunscreen", "beauty of joseon sunscreen"],
  "topRegions": ["Wyoming", "Hawaii", "California"],
  "summary": "Interest in 'sunscreen' is rising (+55% year over year), currently 16/100, peak 100 on 2026-06-07, short-term momentum -28%, seasonal, peaking in June. Breakout queries: joseon sunscreen, beauty of joseon sunscreen, beauty of joseon. Strongest in Wyoming, Hawaii, California."
}
```

How the insights are computed:

- **Direction and change**: on 2 years of data or more, the last 12 months are compared with the 12 months before (year over year), so a seasonal keyword isn't misjudged because of the season the period ends in. On shorter ranges, the first quarter of the period is compared with the last quarter.
- **Seasonality**: the trend is removed first (each point is compared with its 12-month moving average), so a fast-growing keyword isn't reported as "seasonal". A peak month only counts if it repeats in most years. This needs at least 2 years of data, so use *Past 5 years*.
- **Partial periods** (the current week or month, still in progress) are excluded, so they don't bias the result downward.

### Use cases

- **SEO and content planning**: find keywords that are rising now, and publish before the seasonal peak.
- **E-commerce and product research**: spot breakout products and plan stock around seasonality.
- **Market research**: compare brands or competitors and see who is gaining momentum.
- **Investing and trend spotting**: monitor a watchlist of keywords on a schedule and catch breakouts early.
- **AI agents and LLM pipelines**: the `summary` field is ready to feed into an LLM or a report.

### Input

| Field | Description |
|---|---|
| `searchTerms` | List of terms. Each line is scraped separately. |
| `isMultiple` | Treat `chatgpt, claude, gemini` as one comparison (max 5 terms). |
| `startUrls` | Or paste Google Trends explore URLs directly. |
| `timeRange` | From *past hour* to *2004–present*, or custom `YYYY-MM-DD YYYY-MM-DD`. |
| `geo` | Country/region code (`US`, `FR`, `US-CA`…). Empty means worldwide. |
| `category` | Google Trends category ID (0 = all). |
| `property` | Web, Images, News, Google Shopping or YouTube search. |
| `includeInsights` | Add the computed insights (on by default). |
| `proxyConfiguration` | Apify Proxy is recommended. Use residential proxies for large batches. |

Example:

```json
{
  "searchTerms": ["chatgpt, claude, gemini", "sunscreen"],
  "isMultiple": true,
  "timeRange": "today 5-y",
  "geo": "US"
}
```

### Reliability

Google Trends rate-limits heavily. This Actor:

- retries with exponential backoff and jitter on rate limits (HTTP 429) and server errors;
- rotates to a fresh session (new cookies, new proxy IP) after repeated failures;
- isolates each query in its own session, so one blocked IP doesn't fail the whole run;
- lists any query that still fails in the `FAILED_QUERIES` record of the key-value store. Failed queries are never charged.

### Integrations

Schedule runs to monitor keywords daily or weekly, and send results to Google Sheets, Slack, Make, Zapier, n8n or your own API through Apify integrations and webhooks. You can also call the Actor from Python or JavaScript with the Apify API client.

### FAQ

**Why are values between 0 and 100?** Google Trends doesn't show absolute search volumes. Values are relative to the highest point in the selected time range and region (100 = peak popularity).

**Why does a small region show up at the top?** Regional values are normalized by the region's total search volume. A small region can therefore score high with few searches.

**Is it legal to scrape Google Trends?** This Actor only collects publicly available, aggregated and anonymized data, and no personal data. You are responsible for using the data in line with applicable laws and Google's terms.

# Actor input Schema

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

Terms to look up on Google Trends. Each line is scraped separately, unless 'Compare terms' is enabled.

## `isMultiple` (type: `boolean`):

If enabled, a line like 'chatgpt, claude, gemini' is scraped as one comparison (max 5 terms), exactly like the comparison view on Google Trends.

## `startUrls` (type: `array`):

Alternatively, paste Google Trends explore URLs (e.g. https://trends.google.com/trends/explore?q=coffee\&geo=US). Terms, region, time range, category and property are read from the URL.

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

Period to analyze. You can also enter a custom range as 'YYYY-MM-DD YYYY-MM-DD'.

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

Country or region code, e.g. US, FR, GB, DE, US-CA. Leave empty for worldwide.

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

Google Trends category ID (0 = all categories). Example: 5 = Computers & Electronics, 71 = Food & Drink.

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

Which Google search to analyze.

## `includeInsights` (type: `boolean`):

Add computed insights to each result: trend direction, % change, momentum, peak, volatility, seasonality, breakout queries, top regions and a one-sentence summary.

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

Language for topic names and region names, e.g. en-US, fr-FR, de-DE.

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

Google Trends rate-limits heavily. Apify Proxy is strongly recommended; switch to residential proxies if you run large batches.

## `maxConcurrency` (type: `integer`):

How many queries run in parallel. Higher is faster but triggers more rate limiting.

## Actor input object example

```json
{
  "searchTerms": [
    "sunscreen",
    "chatgpt"
  ],
  "isMultiple": false,
  "timeRange": "today 5-y",
  "geo": "US",
  "category": 0,
  "property": "",
  "includeInsights": true,
  "language": "en-US",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 2
}
```

# Actor output Schema

## `insights` (type: `string`):

No description

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

No description

## `failedQueries` (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": [
        "sunscreen",
        "chatgpt"
    ],
    "timeRange": "today 5-y",
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("onepierre/google-trends-insights").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": [
        "sunscreen",
        "chatgpt",
    ],
    "timeRange": "today 5-y",
    "geo": "US",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("onepierre/google-trends-insights").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": [
    "sunscreen",
    "chatgpt"
  ],
  "timeRange": "today 5-y",
  "geo": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call onepierre/google-trends-insights --silent --output-dataset

```

## MCP server setup

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

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/A8JSaotMZLGM6CJkp/builds/JJkroBzlQI7zPy9o1/openapi.json
