# Google Trends Scraper - Reliable, Pay Only for Results (`tonyginkleheim/google-trends-scraper`) Actor

Interest over time, interest by region, related queries (top + rising) and Trending Now from Google Trends. Automatic 429 recovery, compare up to 5 terms, many countries per run. Failed lookups are never charged.

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

## Pricing

from $3.00 / 1,000 search terms

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

### What this Google Trends scraper does

This Actor pulls data from Google Trends and returns it as JSON, CSV or Excel. It has two modes.

Explore mode takes your keywords and returns interest over time (0 to 100), interest by region down to city or US metro level, and the top and rising related queries for each keyword.

Trending Now mode returns the searches that are spiking right now in any country or state, with search volume, growth percentage, start and end time, category, related searches and the news articles Google links to each trend.

You don't need an API key or a Google account, and you don't have to deal with 429 errors. You pay per keyword that returns data. If a lookup fails, you aren't charged for it.

### Who uses Google Trends data

- SEO and content teams use rising queries to find topics before they peak.
- Online stores check seasonality and which states search for a product before buying stock.
- Analysts and investors compare brand interest over five years or since 2004.
- Developers and AI agents use it as a clean JSON trend signal in n8n, Make, Zapier, LangChain or an MCP client.

### How to get data

#### From keywords

Add keywords to Search terms, one per line, and pick your countries. Every keyword runs for every country, so 20 keywords and 3 countries give you 60 results in one run.

To compare keywords on the same scale, put up to 5 on one line separated by commas, for example `nike, adidas, puma`. You can also switch on "Compare single keywords in groups of 5".

#### From Google Trends URLs

If you already built a comparison on trends.google.com, paste the URL. The Actor reads the keywords, country, time range, category and search type from it.

#### From a Google Sheet

Put keywords in the first column of a sheet (row 1 is the header), share it as "Anyone with the link can view" and paste the link. This works well for a few hundred keywords that change every week.

#### Options

| Option | Values |
|---|---|
| Time range | past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months, 5 years, 2004 to now, or a custom range |
| Search type | Web, Image, News, Google Shopping, YouTube |
| Category | any of Google's 25 top-level categories |
| Region detail | country, state, US metro (DMA) or city. If Google doesn't offer that level for a country, you get the closest one instead of an error. |
| Trending window | past 4 hours, 24 hours, 48 hours or 7 days |
| Trending filters | 19 categories, active or ended trends, max trends per country |

### Output example

Explore mode returns one item per keyword (or comparison) per country. The values below are illustrative.

```json
{
  "searchTerms": ["air fryer"],
  "geo": "US",
  "status": "ok",
  "averages": { "air fryer": 61 },
  "interestOverTime": [
    { "date": "2026-09-27T00:00:00+00:00", "formattedTime": "Sep 27 - Oct 3, 2026", "isPartial": false, "values": { "air fryer": 58 } }
  ],
  "interestByRegion": [
    { "geoCode": "US-WV", "geoName": "West Virginia", "values": { "air fryer": 100 } }
  ],
  "regionResolution": "REGION",
  "relatedQueries": {
    "air fryer": {
      "top": [{ "query": "air fryer recipes", "value": 100 }],
      "rising": [{ "query": "air fryer chicken thighs", "value": 250, "formattedValue": "+250%" }]
    }
  },
  "exploreUrl": "https://trends.google.com/trends/explore?q=air+fryer&geo=US&date=today+12-m"
}
```

Trending Now returns one row per trend, which makes it easy to sort and filter in a spreadsheet.

```json
{
  "rank": 1,
  "term": "hurricane season",
  "geo": "US",
  "searchVolume": 200000,
  "searchVolumeFormatted": "200K+",
  "increasePercent": 1000,
  "isActive": true,
  "startedAt": "2026-10-07T17:10:00+00:00",
  "endedAt": null,
  "categories": ["Climate"],
  "relatedTerms": ["hurricane tracker", "hurricane path"],
  "news": [{ "title": "...", "url": "https://...", "source": "...", "publishedAt": "2026-10-07T20:40:28+00:00" }],
  "exploreUrl": "https://trends.google.com/trends/explore?q=hurricane+season&geo=US&date=now+7-d"
}
```

### Pricing

You pay per result, and the price already covers proxies and compute.

| Event | Charged when |
|---|---|
| `search-term` | one keyword in one country returned data |
| `trending-search` | one Trending Now row was delivered |

Failed lookups are never charged. You can set a max results limit or a max charge per run, and the Actor stops cleanly when it reaches either one. There is no monthly minimum, so a run of 10 keywords costs a few cents.

### Moving from pytrends

pytrends was archived in April 2025 and usually hits 429 errors on the first request. This Actor returns the same data pytrends did (interest over time, interest by region, related queries, trending searches) without the rate-limit handling on your side. You can call it from Python with the `apify-client` package and get a list of dicts back.

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("tonyginkleheim/google-trends-scraper").call(run_input={
    "searchTerms": ["air fryer", "standing desk"],
    "geos": ["US"],
    "timeRange": "today 5-y",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["searchTerms"], item["averages"])
```

### FAQ

#### Are these real search volumes?

Explore mode values are Google's relative interest scores from 0 to 100, the same numbers you see on trends.google.com. Trending Now gives Google's approximate search volume buckets such as 50K+ or 1M+.

#### Doesn't Google have an official Trends API?

Google announced an alpha in 2025, but access is by application only. This Actor works today with no waitlist.

#### Why did a keyword come back as "partial"?

Google sometimes has data for the timeline but not for regions or related queries, usually for very small keywords. You still get everything Google returned, and the `warnings` field says what was missing.

#### Can I schedule it?

Yes. Use Apify schedules to run it daily or weekly and send results to Google Sheets, Slack, a webhook or your own API.

#### Something broke or a feature is missing

Open an issue on the Issues tab and describe what you ran and what you expected.

# Actor input Schema

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

Explore analyses your keywords. Trending Now lists breakout searches with search volume, growth and related terms.

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

One keyword per line. Put up to 5 keywords on one line separated by commas to compare them on the same scale (e.g. nike, adidas, puma).

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

Paste Google Trends Explore URLs. Keywords, geo, time range, category and search type are taken from each URL.

## `spreadsheetId` (type: `string`):

Sheet URL or ID. Keywords are read from the first column (row 1 is the header). Share the sheet as 'Anyone with the link can view'.

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

On: single keywords are batched 5 at a time on one relative scale. Off: every keyword gets its own 0-100 scale.

## `geos` (type: `array`):

Geo codes such as US, GB, DE, US-CA, or WORLDWIDE. Every keyword runs for every geo. Trending Now also accepts states and regions like US-CA or DE-BY.

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

Explore mode only.

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

Used when Time range is Custom. Format: YYYY-MM-DD YYYY-MM-DD

## `timezone` (type: `integer`):

Google's timezone offset for timeline dates, e.g. 0 = UTC, 300 = US Eastern standard time, -60 = Central Europe.

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

Limit Explore results to a Google Trends category.

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

Which Google search property to analyse.

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

Timeline of 0-100 interest values plus the average.

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

Breakdown by country, state, metro or city.

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

Top and rising related searches. Rising = breakout opportunities.

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

If a resolution is not available for a geo, the best available one is used instead of failing.

## `trendingTimeframe` (type: `string`):

Trending Now mode only.

## `trendingCategories` (type: `array`):

Only return trends in these categories. Empty = all.

## `trendStatus` (type: `string`):

Filter by whether the trend is still active.

## `includeNews` (type: `boolean`):

Adds the news stories Google links to each trend, where available.

## `maxTrendsPerGeo` (type: `integer`):

0 = all available.

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

Stop after this many results in total. 0 = no limit.

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

Interface language, e.g. en-US, de, fr, ja.

## `viewedFrom` (type: `string`):

Two-letter country code for the proxy location (e.g. US, DE). Leave empty for automatic.

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

Parallel sessions, each with its own IP.

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

Each retry uses a fresh IP and session.

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

Residential proxies give the lowest failure rate.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "ai agents",
    "chatgpt"
  ],
  "compareTerms": false,
  "geos": [
    "US"
  ],
  "timeRange": "today 12-m",
  "timezone": 0,
  "category": "0",
  "searchProperty": "web",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "regionResolution": "AUTO",
  "trendingTimeframe": "24",
  "trendingCategories": [],
  "trendStatus": "all",
  "includeNews": true,
  "maxTrendsPerGeo": 0,
  "maxItems": 0,
  "language": "en-US",
  "maxConcurrency": 10,
  "maxRetries": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

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

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

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

```

## MCP server setup

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