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

Get Google Trends data for up to 5 compared keywords: interest over time, interest by region, related queries and topics, plus daily trending searches by country. Pay only for results returned.

- **URL**: https://apify.com/muhammad_noman_riaz/google-trends-scraper.md
- **Developed by:** [Muhammad Noman Riaz](https://apify.com/muhammad_noman_riaz) (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 $1.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.
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 as clean JSON without opening the Trends website. Look up one keyword or compare up to 5 keywords on the same scale, for any country or worldwide, and get interest over time, interest by region and related queries (top and rising). Optionally add the current trending searches for a country.

**You only pay for results that are returned.** A term with too little search volume, a request Google rejects, or a request still failing after all retries is skipped and not charged. Skipped requests are listed in `FAILED_ITEMS` in the run's key-value store with the reason.

### What you can use it for

- Keyword research and SEO: compare keywords and see which one people search for more
- Seasonality: see when interest in a product or topic peaks during the year
- Local targeting: find the countries or states where a keyword is most popular
- Content ideas: collect related and rising queries around a topic
- News and social monitoring: pull the daily trending searches for a country

### Features

- **Interest over time:** relative interest from 0 to 100 per date, with the last, still incomplete period flagged as `isPartial`
- **Interest by region:** per country (worldwide) or per subregion such as US states (when a country is set)
- **Related queries:** top and rising queries for every term, with Google's "Breakout" label kept
- **Compare up to 5 terms** on one scale, exactly like the Trends website, or look up each term separately
- **Every Trends filter:** country or region, time range from the past hour to 2004 onwards, custom date ranges, category, and search type (web, images, news, Google Shopping, YouTube)
- **Trending searches** for a country, with approximate search volume and linked news articles
- **Retries on a fresh proxy IP** when Google rate-limits (HTTP 429)

### Input

```json
{
  "searchTerms": ["coffee", "tea"],
  "compareTerms": true,
  "geo": "US",
  "timeRange": "today 12-m",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeTrendingNow": false
}
```

| Field | Description |
| --- | --- |
| `searchTerms` | Keywords to look up |
| `compareTerms` | On (default): up to 5 terms in one comparison. Off: each term on its own |
| `geo` | Country code (US, GB, DE) or region code (US-CA). Empty means worldwide |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m` (default), `today 5-y` or `all` |
| `customTimeRange` | Exact dates like `2024-01-01 2024-06-30`. Overrides `timeRange` |
| `category` | Google Trends category ID, 0 (default) for all categories |
| `property` | Empty for web search, or `images`, `news`, `froogle` (Google Shopping), `youtube` |
| `includeInterestOverTime` | Add the timeline (default on) |
| `includeInterestByRegion` | Add interest by region (default on) |
| `includeRelatedQueries` | Add top and rising related queries (default on) |
| `includeRelatedTopics` | Experimental, single terms only (default off). See limits below |
| `includeTrendingNow` | Add trending searches for the country in `geo` (default off) |
| `maxRequestRetries` | Attempts per request, each on a new IP (default 6) |
| `proxy` | Proxy settings, residential recommended |

### Output

One result per term, or one per comparison. A single term:

```json
{
  "type": "term",
  "searchTerm": "coffee",
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "interestOverTime": [
    { "date": "2026-10-04T00:00:00.000Z", "value": 71, "isPartial": false },
    { "date": "2026-10-11T00:00:00.000Z", "value": 66, "isPartial": true }
  ],
  "interestByRegion": [
    { "geoCode": "US-WY", "geoName": "Wyoming", "value": 100 },
    { "geoCode": "US-HI", "geoName": "Hawaii", "value": 47 }
  ],
  "relatedQueries": {
    "top": [{ "query": "coffee near me", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "how to brew pour over coffee", "value": 3200, "formattedValue": "+3,200%" }]
  }
}
```

A comparison (`type: "comparison"`) has `searchTerms` instead of `searchTerm`, a `values` object keyed by term instead of `value`, and `relatedQueries` keyed by term:

```json
{
  "type": "comparison",
  "searchTerms": ["coffee", "tea"],
  "interestOverTime": [
    { "date": "2026-10-11T00:00:00.000Z", "values": { "coffee": 66, "tea": 30 }, "isPartial": true }
  ],
  "interestByRegion": [
    { "geoCode": "US-WY", "geoName": "Wyoming", "values": { "coffee": 71, "tea": 29 } }
  ],
  "relatedQueries": {
    "coffee": { "top": [], "rising": [] },
    "tea": { "top": [], "rising": [] }
  }
}
```

In a comparison, `interestByRegion` shows how the search interest in each region splits between the terms, in percent, the same as the "Compared breakdown by region" map on the website.

A trending search (one result each):

```json
{
  "type": "trending",
  "geo": "US",
  "title": "ann li",
  "approxTraffic": "2000+",
  "publishedAt": "2026-10-16T11:20:00.000Z",
  "picture": "https://encrypted-tbn2.gstatic.com/images?q=...",
  "pictureSource": "The New York Times",
  "news": [{ "title": "...", "url": "https://www.nytimes.com/...", "source": "The New York Times" }]
}
```

### How values work

Google Trends values are relative, not search counts. 100 is the peak of interest within the chosen terms, place and time range, and every other value is scaled to it. Values are only comparable within one result. Rising query values are percent growth; "Breakout" means growth above 5000%.

### Pricing

Pay per result. One result is one term, one comparison, or one trending search. Skipped requests are free.

### Known limits

- **Related queries may differ slightly from the website.** Google marks automated requests and leaves some entries out of the related query lists. Values of the entries that are returned match the website. Interest over time and interest by region matched the website exactly in our checks.
- **Related topics are experimental.** Google only offers them for single terms, and in our tests it returned an empty topics list to automated requests even when the website showed topics. Leave this off unless you have checked it works for you.
- **Rising queries include Google's own generic entries** (for example "home workout routines" for "coffee"). The website shows the same entries; they are not added by this scraper.
- **Trending searches come from Google's public trending feed** for one country, which lists about 10 current trending searches. There is no worldwide feed, so `geo` must be set.
- **At most 5 terms per comparison.** More terms are split into groups of 5, and values are only comparable inside each group.
- **Low-volume terms** have no Trends data. They are skipped and not charged.
- **Google rate-limits quickly.** The scraper waits between requests and retries on a new IP, but very large runs on datacenter proxies may still fail. Residential proxies work best.

# Actor input Schema

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

Keywords to look up on Google Trends. With Compare terms on, up to 5 terms are compared in one request, like the Trends website. More than 5 are split into groups of 5.

## `compareTerms` (type: `boolean`):

On: all terms (up to 5) share one scale and come back as one comparison result. Off: each term is looked up on its own and returns its own result.

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

Two-letter country code such as US, GB or DE, or a region code such as US-CA. Leave empty for worldwide. Trending searches need a country.

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

Period to analyze. Ignored when Custom time range is filled in.

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

Optional exact dates as "YYYY-MM-DD YYYY-MM-DD", for example "2024-01-01 2024-06-30". Overrides Time range.

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

Google Trends category ID. 0 means all categories. The ID is the cat= value in a Google Trends URL.

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

Which Google search to analyze.

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

Adds the timeline of relative interest (0 to 100).

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

Adds interest per country (worldwide) or per subregion (when a country is set).

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

Adds top and rising related queries for each term.

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

Adds top and rising related topics. Google only offers these for single terms, so they are skipped in comparisons. In our tests Google returned an empty topics list to automated requests, so expect it to often be empty.

## `includeTrendingNow` (type: `boolean`):

Also returns the current trending searches for the chosen country, with approximate search volume and news links. Each trending search is one result.

## `maxRequestRetries` (type: `integer`):

How many times a request is tried, each time on a new proxy IP, before it is skipped.

## `proxy` (type: `object`):

Proxy used for requests. Residential proxies are recommended because Google Trends rate-limits quickly.

## Actor input object example

```json
{
  "searchTerms": [
    "coffee",
    "tea"
  ],
  "compareTerms": true,
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "includeRelatedTopics": false,
  "includeTrendingNow": false,
  "maxRequestRetries": 6,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One item per term or comparison with interest over time, by region and related queries, plus one item per trending search

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

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

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

```

## MCP server setup

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