# Google Trends Scraper & API with Trending Now (`mastertools/google-trends`) Actor

Reliable Google Trends API: interest over time, interest by country, state and city, top and rising related queries with Breakouts, plus Trending Now searches with search volume. Compare 5 keywords, Web or YouTube. Fast, no login.

- **URL**: https://apify.com/mastertools/google-trends.md
- **Developed by:** [Master Tools](https://apify.com/mastertools) (community)
- **Categories:** SEO tools, Marketing, News
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 keyword with data

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 & API

**The fast, reliable Google Trends API: turn any list of keywords into interest over time, interest by region, rising searches and Trending Now, in seconds, with no login and no API key.**

Add your keywords, press **Start** and get Google Trends data as clean rows, ready for Google Sheets, Excel, your database or an AI agent. Covers Web, YouTube, News, Images and Google Shopping search in any country or US state, from the past hour back to 2004.

### Why teams pick this Google Trends scraper

- **Complete results for long keyword lists**: when Google pushes back, the request is retried at once through a fresh IP and session, so big lists come back whole.
- **Results in seconds**: no browser, only fast requests. The example comparison is ready in a few seconds.
- **Compare up to 5 keywords on one scale**: works exactly like the Compare button on Google Trends. Longer lists are split into groups of 5 automatically.
- **Interest by region down to the city**: country, state, US metro area (DMA) or city, with coordinates for city maps.
- **Top and rising related queries**: spot Breakout searches (growth over 5000%) before your competitors, each with a link to Google Trends.
- **Trending Now with search volume**: hundreds of searches spiking in any country or US state over the past 4 hours to 7 days. Each comes with volume, growth, topic and the searches behind the trend.
- **YouTube, News, Images and Google Shopping trends**, not only web search.
- **Flat rows with a `type` column**: one fact per row, ready for Google Sheets, Excel, Looker Studio, BigQuery and AI agents.

### What you can do with it

- **Keyword research and SEO**: find rising queries and Breakouts, and check seasonality before you write or bid.
- **Content and newsjacking**: see what is trending now in your country and publish first.
- **Market and product research**: compare brands, products and categories over 5 years and across states and cities.
- **E-commerce demand**: follow Google Shopping interest and seasonal peaks before you stock up.
- **Trend tracking and alerts**: schedule a daily run and get the rising searches in Google Sheets or Slack.
- **AI agents**: give Claude, ChatGPT, Cursor or n8n live Google Trends data through MCP.

### How to use

1. Press **Start**. The example compares `chatgpt` and `gemini` worldwide over the past 12 months.
2. Put in your own keywords and pick a location (`US`, `GB`, `DE`, `US-CA`…), a time range and what to collect.
3. Download the results as JSON, CSV or Excel, call the Actor as an API, or schedule it to track trends every day.

### Input

| Field | What it does | Example |
|---|---|---|
| `keywords` | Search terms, one per line (or one string, comma separated) | `["chatgpt", "gemini"]` |
| `geo` | Country or region code, empty for worldwide | `US`, `GB`, `US-CA` |
| `timeframe` | Past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months, 5 years, or 2004 – present | `today 12-m` |
| `dataTypes` | What to collect: `timeline`, `region`, `related_query`, `trending` | `["timeline", "region", "related_query"]` |
| `compareKeywords` | Keywords share one 0–100 scale (groups of up to 5), or each gets its own | `true` |
| `searchType` | `web`, `youtube`, `news`, `images` or `shopping` | `youtube` |
| `customTimeRange` | Any period since 2004 | `2025-01-01 2025-12-31` |
| `category` | Narrow a keyword to one of 25 Google categories, for example "jaguar" in Autos & Vehicles | `"47"` |
| `regionLevel` | `auto`, `country`, `subregion`, `metro` (US) or `city` | `city` |
| `maxRegions` | Top regions per keyword, up to 250 (0 for all) | `25` |
| `maxRelatedQueries` | Top and rising related queries per keyword, up to 25 each | `25` |
| `trendingHours` | Trending Now period: 4, 24, 48 or 168 hours | `24` |
| `trendingCategory` | Trending Now topic, for example Sports or Technology | `all` |
| `maxTrendingItems` | How many trending searches, biggest first | `25` |

Compare phones across US states over the last 3 months:

```json
{
  "keywords": ["iphone 17", "galaxy s26", "pixel 10"],
  "geo": "US",
  "timeframe": "today 3-m",
  "dataTypes": ["timeline", "region", "related_query"],
  "regionLevel": "subregion"
}
```

What is trending in the UK today:

```json
{
  "dataTypes": ["trending"],
  "geo": "GB",
  "trendingHours": "24",
  "maxTrendingItems": 50
}
```

### Output

Every row has a `type`:

| `type` | One row is | Key fields |
|---|---|---|
| `timeline` | interest in a keyword at one date | `date`, `value` (0–100), `comparedWith` |
| `region` | interest in a keyword in one country, state, metro area or city | `regionCode`, `regionName`, `value` (0–100), `rank` |
| `related_query` | a related search | `kind` (`top` or `rising`), `query`, `value`, `formattedValue` (`+250%`, `Breakout`), `link` |
| `trending` | a search trending right now | `keyword`, `value` (approx. searches), `formattedValue` (`200K+`), `increasePercent`, `startedAt`, `isActive`, `categories`, `relatedQueries` |
| `no_data` | a keyword with too little search volume | `message` |

```json
[
  {
    "type": "timeline",
    "keyword": "chatgpt",
    "geo": "WORLDWIDE",
    "timeframe": "today 12-m",
    "date": "2025-11-09",
    "value": 100,
    "formattedValue": "100",
    "comparedWith": "gemini"
  },
  {
    "type": "region",
    "keyword": "chatgpt",
    "geo": "WORLDWIDE",
    "timeframe": "today 12-m",
    "regionCode": "RW",
    "regionName": "Rwanda",
    "value": 100,
    "formattedValue": "100",
    "rank": 1
  },
  {
    "type": "related_query",
    "keyword": "chatgpt",
    "geo": "WORLDWIDE",
    "timeframe": "today 12-m",
    "kind": "rising",
    "rank": 1,
    "query": "how to use chatgpt effectively",
    "value": 2450,
    "formattedValue": "+2,450%",
    "isBreakout": false,
    "link": "https://trends.google.com/trends/explore?q=how+to+use+chatgpt+effectively&date=today+12-m"
  },
  {
    "type": "trending",
    "keyword": "buccaneers vs bears",
    "geo": "US",
    "timeframe": "past 24 hours",
    "value": 1000000,
    "formattedValue": "1M+",
    "increasePercent": 1000,
    "startedAt": "2026-11-08T21:50:00Z",
    "endedAt": null,
    "isActive": true,
    "categories": "Sports",
    "relatedQueries": "bears, chicago bears, bears game, bears vs bucs, tampa bay buccaneers",
    "link": "https://trends.google.com/trends/explore?q=buccaneers+vs+bears&date=now+1-d&hl=en-US&geo=US",
    "rank": 1
  }
]
```

The Output tab has ready views: **All results**, **Interest over time**, **Interest by region**, **Related queries** and **Trending now**.

### What the numbers mean

- **Interest 0–100** is relative, the same as on Google Trends: 100 is the peak popularity for the chosen place and time, 50 is half as popular. With `compareKeywords` on, keywords in one group share the scale, so you can see which one is searched more.
- **Rising queries** show growth in %. **Breakout** means growth of more than 5000%.
- **Trending Now** shows approximate search volume, for example `200K+`, and growth in % since the trend started.

### Use it as a Google Trends API

Send keywords, get rows back in the same call, from any language or tool:

```bash
curl -X POST "https://api.apify.com/v2/acts/mastertools~google-trends/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "keywords": ["electric bike", "e-scooter"], "geo": "DE" }'
```

Your Apify token is on the Integrations page of Apify Console. Python and JavaScript clients, webhooks and scheduled runs work the same way.

### Use it with AI agents (MCP)

Connect the Actor as a tool in Claude, ChatGPT, Cursor or n8n through the Apify MCP server. One short input is enough:

```json
{ "keywords": ["electric bike", "e-scooter"], "geo": "DE" }
```

Ask your agent things like "Which of these products is growing in Germany, and in which states?" or "What is trending in the UK today?" and compact rows come back in seconds.

### Integrations

Works with Google Sheets, Make, Zapier, n8n, Slack, webhooks and the Apify API. Schedule the Actor every day or every hour to build your own trend tracker or alerts for rising searches.

### FAQ

**Do I need a Google account or an API key?** No. Just press Start.

**Is this a pytrends alternative?** Yes. You get the same Google Trends data that pytrends gave you (interest over time, interest by region, related queries) plus Trending Now. It runs as a hosted API, so there is nothing to install and no IPs to manage.

**Is there an official Google Trends API?** Google's own API is in limited alpha and available only by application. This Actor works today: send keywords and get Google Trends data back in seconds.

**How many keywords can I check?** As many as you need. Each keyword comes back in seconds, and long lists are processed in groups.

**How fresh is the data?** Live: every run collects it from Google Trends at that moment.

**Can I get YouTube or Google Shopping trends?** Yes. Set `searchType` to `youtube` or `shopping`.

**Can I get a specific period, like Black Friday last year?** Yes. Put it into `customTimeRange`, for example `2025-11-20 2025-12-05`.

### Need data at scale?

We can set up daily trend exports for thousands of keywords and countries, a pipeline straight into your warehouse, CRM or dashboard, or a custom tracker for your market. Open an issue on this page and tell us what you need.

# Actor input Schema

## `keywords` (type: `array`):

Search terms to check in Google Trends, one per line. Up to 5 keywords are compared on one 0–100 scale, like the Compare button on Google Trends; longer lists are split into groups of 5.

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

Two-letter country code (US, GB, DE, IN) or a region (US-CA, GB-ENG). Leave empty for worldwide.

## `timeframe` (type: `string`):

Period to look at. Short ranges give hourly points, up to 3 months give daily points, a year gives weekly points.

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

Interest over time, interest by region and related queries come for every keyword. Trending now is the list of searches that are spiking right now in the chosen country.

## `compareKeywords` (type: `boolean`):

On: keywords are compared in groups of up to 5, so their values are directly comparable. Off: every keyword gets its own 0–100 scale.

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

Which Google search to measure: Web search, YouTube search, Google News, Google Images or Google Shopping.

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

Any period since 2004 as "YYYY-MM-DD YYYY-MM-DD", for example "2025-01-01 2025-12-31". Replaces Time range when filled.

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

Narrow the meaning of a keyword to one topic, for example "jaguar" in Autos & Vehicles. All categories by default.

## `regionLevel` (type: `string`):

Detail of the interest by region: countries for worldwide and subregions (states) inside a country by default; or cities, or metro areas (US only).

## `maxRegions` (type: `integer`):

How many top regions to return for each keyword, up to 250. 0 returns every region with data (up to 250).

## `maxRelatedQueries` (type: `integer`):

How many top and how many rising related queries to return for each keyword (Google shows up to 25 of each).

## `trendingHours` (type: `string`):

Searches that started trending in the past 4 hours, 24 hours, 48 hours or 7 days. Trending now uses the country or region from Location (US, GB, US-CA), or the United States when Location is empty.

## `trendingCategory` (type: `string`):

Show trending searches of one topic only.

## `trendingActiveOnly` (type: `boolean`):

Return only searches that are still trending, without the ones that have already calmed down.

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

Maximum number of trending searches to return, biggest search volume first.

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

Every retry goes through a fresh IP, so Google rate limits do not stop the run. The default works for most runs; choose Residential for very large keyword lists.

## Actor input object example

```json
{
  "keywords": [
    "chatgpt",
    "gemini"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "dataTypes": [
    "timeline",
    "region",
    "related_query"
  ],
  "compareKeywords": true,
  "searchType": "web",
  "category": "0",
  "regionLevel": "auto",
  "maxRegions": 25,
  "maxRelatedQueries": 25,
  "trendingHours": "24",
  "trendingCategory": "all",
  "trendingActiveOnly": false,
  "maxTrendingItems": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Google Trends rows for all keywords: interest over time, interest by region, related queries and Trending now.

# 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 = {
    "keywords": [
        "chatgpt",
        "gemini"
    ],
    "geo": "",
    "timeframe": "today 12-m",
    "dataTypes": [
        "timeline",
        "region",
        "related_query"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mastertools/google-trends").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 = {
    "keywords": [
        "chatgpt",
        "gemini",
    ],
    "geo": "",
    "timeframe": "today 12-m",
    "dataTypes": [
        "timeline",
        "region",
        "related_query",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("mastertools/google-trends").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 '{
  "keywords": [
    "chatgpt",
    "gemini"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "dataTypes": [
    "timeline",
    "region",
    "related_query"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call mastertools/google-trends --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mastertools/google-trends"
        }
    }
}
```

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/pNlpJxi6Yk312Vg1w/builds/xWrweNak9Bn4CdYsw/openapi.json
