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

Google Trends as clean JSON: interest over time, interest by region, top and rising related queries and topics, trend direction, plus Trending Now per country. Compare up to 5 terms. Automatic retries on fresh residential IPs.

- **URL**: https://apify.com/webify-lab/google-trends-scraper.md
- **Developed by:** [Batu T.](https://apify.com/webify-lab) (community)
- **Categories:** SEO tools, News
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 1,000 term analyzeds

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: Interest, Regions, Related Queries & Trending Now

Reliable Google Trends data as clean JSON. Built for retries: every request that Google rate-limits is repeated on a fresh residential IP with a fresh cookie, so runs finish instead of failing.

### What you get per search term (or comparison of up to 5 terms)

| field | meaning |
|---|---|
| `interestOverTime` | the full time series (0 to 100) per term, with date and partial-period flag |
| `averages` | average interest per term in the period |
| `trend` | direction (rising, stable, falling), change in percent last vs. first quarter, peak and peak date |
| `interestByRegion` | interest per country, state, city or metro area |
| `relatedQueries` | top and rising related searches per term, with breakout flag |
| `relatedTopics` | top and rising related topics per term |
| `trendsUrl` | the same view on trends.google.com |

### Trending now

Set `mode` to `trending` and list countries in `trendingGeos` (for example `US`, `DE`, `GB`). You get the current top 10 trending searches per country with approximate traffic, start time and linked news articles.

### Time ranges

`past-hour`, `past-4-hours`, `past-day`, `past-7-days`, `past-30-days`, `past-90-days`, `past-12-months` (default), `past-5-years`, `since-2004`, or a custom range like `2025-01-01 2025-12-31`.

### Pricing

You pay per analyzed term or comparison, and per trending list. Failed lookups are not charged.

### Tips

- Use `compare` to put up to 5 terms on the same 0 to 100 scale; that is the only way values are comparable.
- Google Trends limits automated requests. Keep the default residential proxy; datacenter IPs are blocked quickly.
- Values are relative (100 = peak in the selected period and region), not absolute search volumes.

Not affiliated with Google.

### FAQ

**What am I charged for?** One event per analyzed term or comparison group in explore mode, and one event per country list in trending mode. Terms or countries that fail are returned as items with `type: "error"` and are not charged. If only some parts fail (for example related topics), the item is still delivered and charged, and the failed parts are listed in `errors`.

**Are the numbers search volumes?** No. Google Trends values are relative: 100 is the peak in the selected period and region. Only terms compared in the same group (with `compare` on) share one scale.

**Do I need a proxy?** The default is the Apify residential proxy, and it is strongly recommended because Google blocks datacenter IPs quickly. When Google rate-limits a request, the Actor retries up to `maxRetries` times (default 6) with a new session, which means a new proxy IP and a new Google cookie.

**How many terms can one run handle?** Up to `maxItems` analyses per run (default 1,000). With `compare` on, terms are grouped in fives and each group counts as one analysis.

**What does trending mode return?** The current trending searches per country from the Google Trends RSS feed, up to `maxTrendingItems` per country (default and maximum 10), each with approximate traffic, start time, picture and linked news articles.

### Use with AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Add only this Actor:

```
https://mcp.apify.com?tools=webify-lab/google-trends-scraper
```

On first use the server signs you in with OAuth. Alternatively send the header `Authorization: Bearer <APIFY_TOKEN>`. Agents on the default Apify MCP setup can also find this Actor with `search-actors` and run it with `call-actor`. Pricing is the same as in Apify Console: you pay per result.

# Actor input Schema

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

Explore analyzes your search terms. Trending returns the current trending searches per country.

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

One analysis per term, or comparisons of up to 5 terms when Compare is on.

## `compare` (type: `boolean`):

Put up to 5 terms on the same 0 to 100 scale (groups of 5).

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

Country or region code like US, DE, GB, US-CA, DE-BY. Empty means worldwide.

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

past-hour, past-4-hours, past-day, past-7-days, past-30-days, past-90-days, past-12-months, past-5-years, since-2004, or YYYY-MM-DD YYYY-MM-DD.

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

Google Trends category ID, 0 means all categories.

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

Which Google search the interest is measured on.

## `interestOverTime` (type: `boolean`):

Include the time series.

## `interestByRegion` (type: `boolean`):

Include interest per region.

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

Level for interest by region.

## `relatedQueries` (type: `boolean`):

Include top and rising related queries.

## `relatedTopics` (type: `boolean`):

Include top and rising related topics.

## `trendingGeos` (type: `array`):

Countries for trending mode, e.g. US, DE, GB.

## `maxTrendingItems` (type: `integer`):

Google publishes the top 10 trending searches per country.

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

Language for labels and topic names, e.g. en, de.

## `timezoneOffset` (type: `integer`):

Minutes from UTC as Google expects it, e.g. -60 for Berlin in winter, 300 for New York.

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

Safety limit per run.

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

Retries on a fresh IP when Google rate-limits.

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

Residential proxy is strongly recommended.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "web scraping",
    "ai agents"
  ],
  "compare": false,
  "geo": "",
  "timeRange": "past-12-months",
  "category": 0,
  "property": "",
  "interestOverTime": true,
  "interestByRegion": true,
  "regionResolution": "",
  "relatedQueries": true,
  "relatedTopics": true,
  "trendingGeos": [
    "US"
  ],
  "maxTrendingItems": 10,
  "language": "en",
  "timezoneOffset": 0,
  "maxItems": 1000,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Explore mode: one item per term or comparison with interestOverTime, averages, trend, interestByRegion, relatedQueries, relatedTopics, trendsUrl. Trending mode: one item per trending search with rank, title, approxTraffic, startedAt, news.

# 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",
        "ai agents"
    ],
    "trendingGeos": [
        "US"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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