# Google Trends API: Fast Google Trends Scraper (`best_apis/google-trends-api`) Actor

Google Trends API: interest over time, by country/region/city, related queries and topics (top + rising), compare 5 terms, YouTube/News/Shopping search, Trending Now. Never hangs. $1.50 per 1,000.

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

## Pricing

Pay per event

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 API: Fast Google Trends Scraper

**Google Trends API** is a fast **Google Trends scraper** for **interest over time**, **interest by country, state, city or US metro**, **related queries and related topics (top and rising/breakout)**, **comparisons of up to 5 keywords**, for **Web, YouTube, News, Google Shopping and Image search**, plus Google's **Trending Now** searches. It costs **$1.50 per 1,000 search terms**, failed terms are free, and runs **never hang**.

### What can this Google Trends scraper do?

- ⏱️ **It finishes**: every term has a hard timeout (default 120 s). A failed term is reported with a reason and not charged.
- 📈 **All data in one row per term**: timeline, regions, related queries and topics, average interest and a link to the same chart on Google Trends.
- ⚖️ **Compare up to 5 terms** on one scale: write `"ethereum, solana, cardano"` in one row.
- 🔍 **Any search type**: Web, YouTube, News, Google Shopping and Images, with any category, location and time range, including custom dates.
- 🔥 **Trending Now**: what's trending in any country, with approximate search volume and news links.
- 🤖 **Simple flat input** that works well with Zapier, Make and AI agents through MCP.

### Why use a Google Trends API?

- **SEO and content**: find rising queries and breakout topics early.
- **Market research and e-commerce**: compare brands and spot seasonality with Shopping search.
- **Investing and crypto**: use search interest as a sentiment signal.
- **YouTube creators**: see what people search for on YouTube.

### How to scrape Google Trends data

1. Add **Search terms**, one per row (comma-separate up to 5 to compare).
2. Pick **Location**, **Time range** and **Search type**.
3. Choose the data to **include** and, optionally, **Trending now countries**.
4. Click **Start** and download, or call the API.

### Input

```json
{
  "searchTerms": ["bitcoin", "ethereum, solana, cardano"],
  "geo": "US",
  "timeframe": "today 12-m",
  "include": ["interestOverTime", "interestByRegion", "relatedQueries", "relatedTopics"],
  "trendingNowGeos": ["US"]
}
```

Time ranges: `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all`, or a custom range like `2025-01-01 2025-06-30`. Search types (`property`): `""` web, `youtube`, `news`, `froogle` (Shopping), `images`.

### Output example

Real output for "nba" in the US (arrays shortened to 3 items):

```json
{
  "searchTerms": [
    "nba"
  ],
  "searchTerm": "nba",
  "geo": "US",
  "timeframe": "today 12-m",
  "category": 0,
  "property": "web",
  "status": "ok",
  "interestOverTime": [
    {
      "date": "2025-10-05",
      "formattedTime": "Oct 5 – 11, 2025",
      "nba": 15,
      "isPartial": false
    },
    {
      "date": "2025-10-12",
      "formattedTime": "Oct 12 – 18, 2025",
      "nba": 16,
      "isPartial": false
    },
    {
      "date": "2025-10-19",
      "formattedTime": "Oct 19 – 25, 2025",
      "nba": 46,
      "isPartial": false
    }
  ],
  "interestByRegion": [
    {
      "geoCode": "US-DC",
      "geoName": "District of Columbia",
      "nba": 100
    },
    {
      "geoCode": "US-OK",
      "geoName": "Oklahoma",
      "nba": 97
    },
    {
      "geoCode": "US-NY",
      "geoName": "New York",
      "nba": 96
    }
  ],
  "relatedQueries": [
    {
      "keyword": "nba",
      "top": [
        {
          "query": "nba games",
          "value": 100,
          "formattedValue": "100",
          "link": "https://trends.google.com/trends/explore?q=nba+games&date=today+12-m&geo=US"
        },
        {
          "query": "nba scores",
          "value": 82,
          "formattedValue": "82",
          "link": "https://trends.google.com/trends/explore?q=nba+scores&date=today+12-m&geo=US"
        },
        {
          "query": "playoffs nba",
          "value": 80,
          "formattedValue": "80",
          "link": "https://trends.google.com/trends/explore?q=playoffs+nba&date=today+12-m&geo=US"
        }
      ],
      "rising": [
        {
          "query": "nba 2k27",
          "value": 13550,
          "formattedValue": "Breakout",
          "link": "https://trends.google.com/trends/explore?q=nba+2k27&date=today+12-m&geo=US"
        },
        {
          "query": "who won the nba finals 2026",
          "value": 7350,
          "formattedValue": "Breakout",
          "link": "https://trends.google.com/trends/explore?q=who+won+the+nba+finals+2026&date=today+12-m&geo=US"
        },
        {
          "query": "nba finals 2026",
          "value": 6400,
          "formattedValue": "Breakout",
          "link": "https://trends.google.com/trends/explore?q=nba+finals+2026&date=today+12-m&geo=US"
        }
      ]
    }
  ],
  "relatedTopics": [
    {
      "keyword": "nba",
      "top": [],
      "rising": []
    }
  ],
  "averages": {
    "nba": 36
  },
  "exploreUrl": "https://trends.google.com/trends/explore?q=nba&date=today+12-m&geo=US",
  "scrapedAt": "2026-10-09T22:51:57.821Z"
}
```

Dataset views: **Overview**, **Interest over time** (one row per date, ready for charts), **Interest by region**, **Related queries & topics** and **Trending now**.

### How much does the Google Trends API cost?

| | This Actor | apify/google-trends-scraper |
|---|---|---|
| Per 1,000 search terms (all data types) | **$1.50** | $3.00 |
| Trending Now searches | $0.50 / 1,000 | not available |
| Failed or no-data terms | **Free** | charged |
| Run start | $0.005 | n/a |

Examples: 100 keywords ≈ $0.16, 10,000 keywords ≈ $15. Set a **maximum cost per run** and the Actor stops at that limit.

### How to use the API (Python, JavaScript, cURL)

Every run is available through the [Apify API](https://docs.apify.com/api/v2). Get your API token in **Apify Console → Settings → API & Integrations**.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("best_apis/google-trends-api").call(run_input={"searchTerms": ["coffee, tea"], "geo": "GB", "timeframe": "today 5-y"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript / Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('best_apis/google-trends-api').call({"searchTerms": ["coffee, tea"], "geo": "GB", "timeframe": "today 5-y"});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### cURL (run and get results in one request)

```bash
curl -X POST "https://api.apify.com/v2/acts/best_apis~google-trends-api/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["coffee, tea"], "geo": "GB", "timeframe": "today 5-y"}'
```

#### Integrations

Connect results to **Google Sheets, Slack, email, Zapier, Make, n8n, Airbyte, webhooks** or AI agents through the **Apify MCP server**. Use **Schedules** in Apify Console to run it hourly, daily or weekly. Export any dataset as **JSON, CSV, Excel, XML or HTML**.

### FAQ

**Is there an official Google Trends API?** Google has announced a limited alpha API with restricted access. This Actor gives you Google Trends data over a simple HTTP API today, with no approval needed.

**Is there a free Google Trends API for Python?** Libraries like pytrends often hit 429 errors and break. This Actor handles retries and IP rotation, and the Apify free plan includes monthly credits.

**Why are values 0 to 100 and not search volumes?** Google Trends publishes relative interest only. Compare a keyword of known size in the same row to estimate volume.

**Why `no_data`?** Google shows no data for very low-volume terms or tiny regions. You aren't charged.

**Do I need a residential proxy?** No. The default Apify datacenter proxy works.

**Is it legal to scrape Google Trends?** This Actor only collects publicly available data, does not log in and does not bypass paywalls. Scraping public data is generally legal, but personal data is protected by laws such as GDPR and CCPA, and you are responsible for how you use the results. If unsure, ask a lawyer. Read more in Apify's [guide to the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Related Actors

- [App Store & Google Play Reviews Scraper](https://apify.com/best_apis/app-store-play-reviews): reviews, ratings and app details from both app stores
- [US Retail Price Scraper](https://apify.com/best_apis/us-retail-price-scraper): prices and stock from Walmart, Target, Best Buy, Home Depot and Lowe's
- [Walmart Scraper](https://apify.com/best_apis/walmart-product-price-scraper): Walmart products, prices, UPCs and a price tracker
- [Government Tenders Scraper](https://apify.com/best_apis/government-tenders-scraper): UK, EU TED and SAM.gov tenders with daily alerts
- [YouTube Transcript Scraper](https://apify.com/best_apis/youtube-transcript-scraper): bulk YouTube transcripts, subtitles and captions

Questions, bugs or feature requests? Open an issue on the **Issues** tab. We usually reply within 24 hours.

# Actor input Schema

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

One row per query. To compare terms on the same scale, put up to 5 in one row separated by commas, e.g. "ethereum, solana". Empty rows are ignored.

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

Country or region code such as US, GB, DE, US-CA. Leave empty for Worldwide.

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

Any Google Trends range. You can also type a custom range like "2024-01-01 2024-06-30".

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

Which Google property to measure.

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

Google Trends category (0 = all). E.g. 7 Finance, 71 Food & Drink, 174 Sports.

## `include` (type: `array`):

Turn off what you don't need for faster runs. Price is the same.

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

Granularity for interest by region.

## `trendingNowGeos` (type: `array`):

Also fetch Google's currently trending searches (with traffic and news links) for these countries, e.g. US, GB, IN.

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

Language for topic names and dates (hl).

## `timezoneOffsetMinutes` (type: `integer`):

Minutes behind UTC as Google expects it (0 = UTC, 300 = US Eastern, -240 = Dubai).

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

How many term rows are processed at once.

## `timeoutSecsPerTerm` (type: `integer`):

A row that takes longer is reported as failed (free) so the run never hangs.

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

Apify datacenter proxy works well. Each retry uses a fresh IP and cookie.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum, solana"
  ],
  "geo": "US",
  "timeframe": "today 12-m",
  "property": "",
  "category": 0,
  "include": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "regionResolution": "",
  "trendingNowGeos": [
    "US"
  ],
  "language": "en-US",
  "timezoneOffsetMinutes": 0,
  "maxConcurrency": 5,
  "timeoutSecsPerTerm": 120,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

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

No description

## `trending` (type: `string`):

No description

## `stats` (type: `string`):

No description

# 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": [
        "bitcoin",
        "ethereum, solana"
    ],
    "geo": "US",
    "trendingNowGeos": [
        "US"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("best_apis/google-trends-api").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": [
        "bitcoin",
        "ethereum, solana",
    ],
    "geo": "US",
    "trendingNowGeos": ["US"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("best_apis/google-trends-api").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": [
    "bitcoin",
    "ethereum, solana"
  ],
  "geo": "US",
  "trendingNowGeos": [
    "US"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call best_apis/google-trends-api --silent --output-dataset

```

## MCP server setup

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

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/Hycgh373UIXWZh7e5/builds/iTT9zUtUcdZieajXl/openapi.json
