# Google Trends Scraper — Compare Unlimited Keywords (`slaty_jute/google-trends-scraper`) Actor

Reliable Google Trends data without a browser: interest over time, interest by region, related queries and topics, Trending Now, and unlimited keywords compared on one common scale. Failed keywords never crash the run.

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

## Pricing

from $0.28 / 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.
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 — Compare Unlimited Keywords

Get Google Trends data through a simple API, without a browser. **One result per keyword** with everything in it: **interest over time, interest by region and related queries (top & rising)**, plus **Trending Now** searches. Compare **any number of keywords on one common 0–100 scale**.

Fast, reliable and fairly priced: a keyword that Google refuses never crashes your run, **you are never charged for empty or failed keywords**, and the price per keyword is **all-inclusive — no extra platform usage fees**.

### Why this Actor

- **One keyword = one result = one charge.** Time series, regions and related queries for a keyword come together in a single dataset item. You don't pay per data point or per data type.
- **All-inclusive price.** Compute and proxy costs are included. No start fee per run, no platform usage added to your bill.
- **Unlimited comparison.** Google Trends compares at most 5 terms at once. This Actor chains as many terms as you want through a shared anchor term, so `commonScaleAverage` and `valueOnCommonScale` are directly comparable across all of them.
- **Fast and light.** Pure HTTP calls to the same endpoints the Google Trends website uses — no browser. 7 keywords with all data took 48 seconds in our tests.
- **Reliable by design.** Short timeouts, automatic retries with a fresh session and a new proxy IP, and per-keyword isolation: one failure produces a free `error` item, the rest of the run continues.
- **Insights, not just raw numbers.** Average, peak value and date, latest value, trend direction (`rising` / `stable` / `falling`), top region, top and top rising related query — ready for a spreadsheet.

### What you get

| Item `type` | Content | Charged |
|---|---|---|
| `keyword` | All selected data for one keyword: summary columns + `interestOverTime` (time series), `interestByRegion`, `relatedQueries`, `relatedTopics` | 1 result |
| `trendingNow` | One of today's trending searches for a country, with approximate traffic and news articles | 1 result |
| `noData` | The keyword has too little search volume for this location and period | Free |
| `error` | The keyword failed after all retries | Free |

### Input example

```json
{
  "searchTerms": ["python", "javascript", "rust", "golang", "java", "kotlin", "typescript"],
  "geo": "FR",
  "timeRange": "today 12-m",
  "compareOnCommonScale": true,
  "trendingNowCountries": ["FR", "US"]
}
```

- **Location:** ISO country code (`US`, `FR`), or region (`US-CA`, `FR-J`). Leave empty for worldwide.
- **Time range:** from the past hour to 2004–present, or a custom range such as `2024-01-01 2024-12-31`.
- **Search type:** web, images, news, Google Shopping or YouTube.
- **Category:** any Google Trends category ID (0 = all).
- **Data types:** turn off the ones you don't need to make runs faster — the price per keyword stays the same.

### Output example

A real result (location France, past 12 months, compared with 6 other languages — `python` is the anchor):

```json
{
  "type": "keyword",
  "keyword": "kotlin",
  "geo": "FR",
  "timeRange": "today 12-m",
  "average": 60.1,
  "peakValue": 100,
  "peakDate": "2026-03-29T00:00:00Z",
  "latestValue": 29,
  "trendDirection": "falling",
  "trendChangePercent": -46.7,
  "commonScaleAverage": 1.87,
  "topRegion": "Île-de-France",
  "topRelatedQuery": "kotlin android",
  "topRisingQuery": "kotlin 2.3",
  "interestOverTime": {
    "average": 60.1,
    "peakValue": 100,
    "commonScale": {
      "comparedWith": ["python", "javascript", "rust", "golang", "java", "typescript"],
      "anchorKeyword": "python",
      "average": 1.87,
      "peakValue": 3
    },
    "timeline": [
      { "date": "2025-10-12T00:00:00Z", "formattedDate": "Oct 12 – 18, 2025", "value": 65, "valueOnCommonScale": 2, "hasData": true, "isPartial": false }
    ]
  },
  "interestByRegion": {
    "resolution": "REGION",
    "regions": [
      { "geoCode": "FR-J", "geoName": "Île-de-France", "value": 100, "hasData": true },
      { "geoCode": "FR-R", "geoName": "Pays de la Loire", "value": 86, "hasData": true }
    ]
  },
  "relatedQueries": {
    "top": [{ "query": "kotlin android", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=kotlin+android&date=today+12-m&geo=FR" }],
    "rising": [{ "query": "kotlin 2.3", "value": 38150, "formattedValue": "Breakout" }]
  },
  "relatedTopics": null
}
```

`average` is on the keyword's own 0–100 scale; `commonScaleAverage` is on the scale shared by all compared keywords (here, kotlin is searched about 37× less than python in France).

Use the **Overview** view in the dataset to see one line per keyword, or export to JSON, CSV or Excel.

### How the common scale works

Google normalizes each request so that its highest point equals 100. The Actor sends the first 5 terms together, picks the most searched one as the **anchor**, then sends the remaining terms in groups of 4 plus the anchor. The ratio between the anchor's average in the first group and in each later group converts every value to the first group's scale; the result is renormalized so the global maximum is 100.

Very rare terms compared with very popular ones may show values close to 0: Google only returns whole numbers, so precision is limited for small terms.

### Pricing

Pay per result: **one result = one keyword** (with all the data types you selected) or **one Trending Now search**. `noData` and `error` items are free. The price is all-inclusive: no start fee, no platform usage charges. It gets lower on higher Apify plans — see the *Pricing* tab.

Your maximum cost per run is respected: the Actor stops cleanly when it is reached and keeps everything already collected.

### Tips

- **Proxy:** the default Apify Proxy works well. If you see many retries in the log, select **residential** IPs in *Proxy configuration*. Google Trends rate-limits by IP; the Actor rotates to a new IP on every retry.
- **Faster runs:** turn off the data types you don't need.
- **Monitoring:** schedule the Actor and use `trendDirection` / `latestValue` to get alerted when a keyword starts rising.

### FAQ

**Is there an official Google Trends API?** Google offers a Trends API only to a small number of approved testers. This Actor uses the public endpoints of the Google Trends website.

**Is it legal?** The Actor collects public, aggregated and anonymized search-interest statistics; it does not collect personal data. You are responsible for using the data in line with Google's terms and the laws that apply to you.

**Why does a keyword return `noData`?** Google has too little search volume for that term, location and time range. Try a wider location or a longer period. You are not charged for it.

**Values differ slightly from the website?** Google Trends works on a sample of searches, so values can vary a little between two requests.

# Actor input Schema

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

Keywords to analyze. One result per keyword, with all the data types you select. No limit: with 2 or more terms, all of them are also compared on one common 0-100 scale.

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

ISO country code (US, FR, DE…) or region code (US-CA, FR-J). Leave empty for worldwide.

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

Period to analyze. Ignored when a custom time range is set.

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

Overrides the time range above. Format: YYYY-MM-DD YYYY-MM-DD (e.g. 2024-01-01 2024-12-31).

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

Google Trends category ID (0 = all categories). Example: 71 = Food & Drink, 958 = Jobs.

## `searchProperty` (type: `string`):

Which Google search to analyze: web, images, news, Google Shopping or YouTube.

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

Time series with average, peak, latest value and trend direction.

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

Interest by country, region, city or metro area for each keyword.

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

Level of detail for interest by region. Leave on automatic to let Google choose based on the location.

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

Top and rising queries ("Breakout" = growth over 5000%). Included in the same result as the other data: no extra charge.

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

Google currently returns empty related topics for most searches. Included in the same result: no extra charge.

## `compareOnCommonScale` (type: `boolean`):

Google compares at most 5 terms at once. With this option, any number of terms is chained through a shared anchor term so every value is comparable.

## `trendingNowCountries` (type: `array`):

Also return today's trending searches (with approximate traffic and news articles) for these country codes, e.g. US, FR.

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

Interface language for names of regions and topics (e.g. en-US, fr, de).

## `maxRetries` (type: `integer`):

How many times a request is retried (each time with a new session and proxy IP) before the keyword is reported as failed.

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

Google Trends rate-limits by IP. Apify Proxy (residential recommended for large runs) rotates IPs automatically on every retry.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "data extraction"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "searchProperty": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "",
  "includeRelatedQueries": true,
  "includeRelatedTopics": false,
  "compareOnCommonScale": true,
  "trendingNowCountries": [],
  "language": "en-US",
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

One line per result: interest over time, interest by region, related queries and topics, Trending Now.

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

All items with full time series, regions and related searches.

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

Keywords succeeded and failed, number of results, HTTP requests.

# 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",
        "data extraction"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("slaty_jute/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",
        "data extraction",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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