# Google Trends Scraper: Interest, Regions & Queries (`mertlabs/google-trends-scraper`) Actor

Scrape Google Trends for any keyword, country and time range: interest over time, interest by region and related queries, plus a ready-made summary (trend, peak, top region). Compare up to 5 terms, paste Trends URLs, get YouTube, News and Shopping trends. Pay only for results with data.

- **URL**: https://apify.com/mertlabs/google-trends-scraper.md
- **Developed by:** [Mert Mensah](https://apify.com/mertlabs) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 trend 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: reliable trends data, ready-made summaries

Get Google Trends data for any keyword, country and time range: **interest over time, interest by region and related queries (top and rising)**, plus related topics whenever Google shares them. Every result also comes with a **plain summary** (average interest, latest value, trend direction, peak date, top region, top rising search) so you can read the answer without opening a chart.

- ✅ **No browser, no blocking loops.** Data is fetched directly from Google Trends with rotating residential IPs and automatic retries; a term Google refuses is tried once more at the end of the run. A run never hangs: every request has a timeout.
- 💸 **You only pay for results with data.** Terms with no Google Trends data, failed terms and duplicate terms are not charged, and the run stops as soon as your *Maximum cost per run* is reached.
- 🔁 **Drop-in input format.** Uses the same input fields as the popular Google Trends Scraper (`searchTerms`, `isMultiple`, `timeRange`, `geo`, `category`, `customTimeRange`, `startUrls`, `maxItems`, `viewedFrom`) and the same output fields, so existing integrations keep working.
- 📺 **YouTube, News, Images and Shopping trends**, not just web search.
- 🌍 **All countries**, by code or by name (typos get a suggestion), plus regions (e.g. `US-CA`) via API.
- 🔗 **Every number can be checked:** each result links to the same search on Google Trends.

#### How to use it

1. Click **Try for free**.
2. Type one or more keywords (or keep the example `air fryer`).
3. Optionally pick a country, time range, category or search type.
4. Click **Start**. Results appear in the **Output** tab within seconds.

Example input:

```json
{
    "searchTerms": ["air fryer", "robot vacuum"],
    "geo": "US",
    "timeRange": "today 3-m"
}
```

**Compare terms:** tick *Compare terms* and write `iphone, samsung, xiaomi` in one line. Google puts up to 5 terms on the same 0-100 scale.

**Copy from Google Trends:** paste a link from trends.google.com into *Google Trends URLs*. The term, country, time range, category and search type are read from the link.

#### What you get

The **Overview** tab shows one row per search term:

| Search term | Country | Average interest | Latest | Trend | Change % | Peak | Top region | Top rising search |
|---|---|---|---|---|---|---|---|---|
| air fryer | US | 67 | 62 | falling | -11 | Apr 12 – 18, 2026 | Wyoming | laptop stand |

For compared terms the *Comparison* column ranks them by average interest and shows each trend, like `iphone 56 (stable) > samsung 31 (rising) > xiaomi 12 (falling)`.

The **Interest over time** tab has one row per keyword and week (or day/hour) with a plain date and number, ready for charts, pivot tables or Excel. The *Final value* column is unticked only for the current period, which Google is still counting. The same rows are in the `timeline` field of every result.

Full JSON for one term (shortened):

```json
{
    "inputUrlOrTerm": "air fryer",
    "searchTerm": "air fryer",
    "geo": "US",
    "timeRange": "today 12-m",
    "searchType": "web",
    "trendsUrl": "https://trends.google.com/trends/explore?q=air+fryer&geo=US",
    "averageInterest": 67,
    "latestInterest": 62,
    "peakInterest": 100,
    "peakDate": "Apr 12 – 18, 2026",
    "trendDirection": "falling",
    "trendChangePercent": -11,
    "topRegion": "Wyoming",
    "topQuery": "air fryer chicken",
    "topRisingQuery": "laptop stand",
    "topRisingQueryGrowth": "Breakout",
    "comparison": null,
    "timeline": [
        { "date": "2025-11-16", "period": "Nov 16 – 22, 2025", "keyword": "air fryer", "interest": 59, "isFinal": true }
    ],
    "interestOverTime_timelineData": [
        { "time": "1763251200", "formattedTime": "Nov 16 – 22, 2025", "value": [59], "hasData": [true] }
    ],
    "interestOverTime_averages": [],
    "interestBySubregion": [
        { "geoCode": "US-WY", "geoName": "Wyoming", "value": [100], "hasData": [true] }
    ],
    "relatedQueries_top": [
        { "query": "air fryer chicken", "value": 100, "formattedValue": "100", "link": "/trends/explore?q=air+fryer+chicken&date=today+12-m&geo=US" }
    ],
    "relatedQueries_rising": [
        { "query": "laptop stand", "value": 14950, "formattedValue": "Breakout" }
    ],
    "relatedTopics_top": [],
    "relatedTopics_rising": [],
    "scrapedAt": "2026-11-17T12:00:00.000Z"
}
```

#### How the summary is calculated

- **Average interest:** Google's own average when it provides one, otherwise the mean of the series.
- **Latest interest:** the most recent *finished* period. Google marks the current week (or day) as unfinished; that point is kept in the raw data (`isPartial: true`) but is not used for the summary, so a half-finished week never looks like a sudden drop.
- **Trend:** the average of the last quarter of the period compared with the first quarter. `rising` at +10% or more, `falling` at -10% or less, otherwise `stable`. It describes the whole period you picked, not last week's movement: with *Past 12 months* in November, `hot chocolate` shows `falling` because last winter was stronger than this autumn so far. Use a shorter time range for recent momentum.

#### How much does it cost?

You pay a fixed price per result: one result is one search term (or one comparison of up to 5 terms) with all the data you selected. There are no extra fees for proxies or compute, and terms without data, failed terms and duplicates cost nothing. The current price is on the **Pricing** tab. The monthly credit of the Apify free plan is enough to try it on your own keywords before paying anything.

#### Input options

| Field | What it does |
|---|---|
| Search terms | Keywords, one per line. Duplicates are skipped. |
| Country | Worldwide by default. Two-letter codes like `US`, `GB`, `TR`, country names like `Germany` or `UK`, and regions like `US-CA` via API. |
| Time range | Past hour up to 2004-present. Defaults to the past 12 months. |
| Category | Narrow results to one Google Trends category. Via API: any `cat` number from a Google Trends link (sub-categories too) or a name like `Health`. |
| Search type | Web, YouTube, News, Images or Google Shopping. |
| Data to include | Pick only what you need: fewer types means faster runs. |
| Google Trends URLs | Links copied from trends.google.com. |
| Compare terms | Commas in a term separate up to 5 terms to compare. A term listed twice is used once. |
| Custom time range | `YYYY-MM-DD YYYY-MM-DD`. Variations like `2025/1/1 to 2025/6/30` are understood too; a single date means "from that date until today". |
| Max results | Stop after this many results. You are never charged for more. |
| Proxy | Residential proxy by default. Change it only if you know you need to. |
| Debug log | Logs every request to Google Trends and its result. Turn on when reporting a problem. |

Small mistakes are fixed for you and explained in the log: dates in the wrong order are swapped, an end date in the future becomes today, a start before 2004 becomes 2004-01-01, duplicate terms are skipped. Mistakes that cannot be guessed stop the run immediately with a clear message, before anything is charged: an impossible date, a day-first date like `01.06.2026` (day and month could be mixed up), or an unknown country (with a suggestion for typos, e.g. *Did you mean "Türkiye (Turkey)" (TR)?*).

**Works with AI agents and no-code tools.** Countries and categories can be given by name (`"geo": "France"`, `"category": "Health"`), every field has a plain description that AI agents read through the Apify MCP server, and inputs copied from the official Google Trends Scraper keep working. If a term contains commas but *Compare terms* is off, the log tells you how to compare them instead.

**Every number can be checked.** Each result has a `trendsUrl` link that opens the same search on Google Trends.

#### Good to know

- **Values are relative, not search volumes.** Google Trends scales every series from 0 to 100 within your query. 100 is the peak, 50 is half as popular.
- **Numbers can differ by a few points from the website.** Google builds Trends from a random sample of searches, and the sample can differ depending on where a request comes from. In our checks the ranking and the shape of the curve were the same, and values differed by up to about 3 points (e.g. 49 vs 46). The `trendsUrl` in every result opens the same search on Google Trends.
- **Related topics are usually empty.** Google's website checks every visitor with an invisible reCAPTCHA and shows related topics only to visitors who pass it. Automated tools, including this one, get related topics only rarely, and never in compare mode. This Actor does not try to get around Google's checks; you are never charged for a term that returns nothing. Related queries are returned normally, though their order can differ slightly from the website.
- **Rising searches come from Google as-is.** Google sometimes lists rising searches that look unrelated to the term; they are passed through unchanged.
- **Small regions often top the region list.** Google scales region values by population, so places like Wyoming or the District of Columbia can come first.
- **City maps of small countries are often empty.** For some countries (Greece, for example) Google maps interest by city instead of by region, and it returns that city map empty to automated tools. Interest over time and related queries still work there, and region maps of larger countries (US states, UK nations, Turkish provinces) are complete.
- **Very rare terms with short time ranges are noisy.** For terms almost nobody searches, hourly and daily data can show random spikes. Prefer longer time ranges for such terms.

#### FAQ

**How do I get Google Trends data into Excel or Google Sheets?**
Open the **Interest over time** tab of the Output and click **Export**: CSV and Excel files have one row per keyword and date, ready for a pivot table or chart. You can also send results to Google Sheets automatically with the Apify Google Sheets integration.

**Can I compare more than 5 terms?**
Google Trends puts at most 5 terms on one 0-100 scale, so each comparison holds up to 5 (extra terms are left out with a warning in the log). To compare more, run several comparisons that share one common term and use that term to line up the scales.

**Why does a term return no data?**
Google shows no data when too few people search for a term in the chosen country and time range. Such terms are skipped and not charged. A longer time range or a wider country often helps.

**Does it work with AI agents?**
Yes. Through the Apify MCP server, assistants such as Claude or ChatGPT can call it directly. Every input field has a plain description, and countries and categories can be given by name.

#### Integrations

Run it from the Apify API, schedule it daily, or connect it to Make, Zapier, n8n, Google Sheets and AI agents through the Apify MCP server. Results can be exported as JSON, CSV, Excel or HTML.

#### Feedback

Found a problem or need a feature? Open an issue in the **Issues** tab. Issues are answered quickly.

This actor is not affiliated with or endorsed by Google.

# Actor input Schema

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

Keywords to look up on Google Trends, one per line. To compare keywords on one chart, write them on one line separated by commas (e.g. "chatgpt, gemini") and turn on "Compare terms" (isMultiple: true). You are only charged for terms that return data, and duplicates are skipped automatically.

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

Country to get results for, or Worldwide. Two-letter codes (US, GB, TR) and English country names both work. Via API you can also pass region codes like US-CA.

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

Predefined time range. Defaults to the past 12 months.

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

Narrow results to one Google Trends category. Via API you can also pass any category number from a Google Trends link (the "cat" value), or a category name like "Health".

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

Which Google search to measure. YouTube shows what people search for on YouTube.

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

Choose which data to fetch for each term. All types are selected by default; fewer types means faster runs. Note: Google returns related topics only rarely, and never when comparing terms.

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

Paste links copied from trends.google.com (classic or new Explore page). Search term, country, time range, category and search type are read from the link. Via API: \[{"url": "https://trends.google.com/trends/explore?q=coffee\&geo=US"}].

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

Turn on to compare keywords on one 0-100 scale: commas inside a search term then separate up to 5 keywords, e.g. "iphone, samsung". When off, each line is searched as one phrase.

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

Format: YYYY-MM-DD YYYY-MM-DD (start and end date). If set, it overrides the time range above.

## `maxItems` (type: `integer`):

Stop after this many results. 0 means no limit.

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

Residential proxy is used by default and works best. Change it only if you know you need to.

## `debugLog` (type: `boolean`):

Logs every request to Google Trends with its result. Turn on when reporting a problem.

## Actor input object example

```json
{
  "searchTerms": [
    "air fryer"
  ],
  "geo": "WORLDWIDE",
  "timeRange": "",
  "category": "0",
  "searchType": "web",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "isMultiple": false,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "debugLog": false
}
```

# Actor output Schema

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

Summary table: trend direction, average and peak interest, top region and a link to the same search on Google Trends.

## `timeline` (type: `string`):

Interest over time as one row per date and keyword, ready for Excel, Google Sheets or charts.

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

Every field, including region maps and related queries, as JSON.

# 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": [
        "air fryer"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mertlabs/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": ["air fryer"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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