# Google Trends API: Interest, Related Queries, Trending Now (`panix/google-trends-api`) Actor

Google Trends as a live API. Search interest over time and by region, related queries and topics, up to 5 keywords compared, trending searches and suggestions. No Google account or key. Call it over HTTP in about a second, or run it as a batch.

- **URL**: https://apify.com/panix/google-trends-api.md
- **Developed by:** [PANIX AI LAB](https://apify.com/panix) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 trends reports

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 API: interest over time, related queries, trending now

Get Google Trends data as a live API. Send one HTTP request and get back how much people search for a keyword, where, how it changed and what else they search for. No Google account, no API key, no browser. You can also run it as a normal batch Actor with an input form.

**What you get per call**

- **Interest over time**: Google's 0-100 search interest for 1-5 keywords on the same scale, from the last hour to 2004 until now.
- **Interest by region**: countries, or states and regions inside a country, with the leading keyword per region.
- **Related queries and related topics**: the top and the rising ones, with a `breakout` flag when Google shows "Breakout".
- **A summary per keyword**: average, peak and peak date, latest value and a `rising` / `steady` / `falling` direction, so you do not have to compute it.
- **Trending now**: what is trending in a country right now, with approximate search volume and news links.
- **Suggestions**: Google's topic suggestions for a typed term.

### Who uses it

- **SEO and content teams** checking if a topic is growing before they write about it.
- **E-commerce and product teams** comparing product names or brands per country and season.
- **Marketers and agencies** building trend dashboards and weekly reports.
- **AI agents and n8n / Make / Zapier workflows** that need a fast "is this trending?" answer inside a flow.
- **Researchers and analysts** collecting search-interest series for a list of terms.

### Two ways to use it

#### 1. Call it like an API (Server interface)

This Actor is a Server Actor: it stays ready, so a call answers in about 1 to 3 seconds and you pay only for the calls. No run to start and no run to wait for.

Server URL: `https://panix--google-trends-api.apify.actor`

Send your Apify API token in the `Authorization: Bearer <token>` header.

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://panix--google-trends-api.apify.actor/trends?keywords=chatgpt,gemini,claude&geo=US&timeRange=past_12_months"
```

| Endpoint | What it returns |
|---|---|
| `GET /trends` | Full report: over time, by region, related queries and topics, summary |
| `GET /interest-over-time` | Time series only |
| `GET /interest-by-region` | Regional split only |
| `GET /related-queries` | Top and rising queries |
| `GET /related-topics` | Top and rising topics (one keyword at a time) |
| `GET /trending-now?geo=US` | Trending searches for a country |
| `GET /suggestions?q=apify` | Topic suggestions |
| `GET /openapi.json` | OpenAPI description (also shown in the Server tab) |

Parameters (query string, or a JSON body with POST):

| Parameter | Meaning | Default |
|---|---|---|
| `keywords` | 1-5 keywords, comma separated. More than one = compared on one scale | required |
| `geo` | Country (`US`), region (`US-CA`) or empty for worldwide | worldwide |
| `timeRange` | `past_hour`, `past_4_hours`, `past_day`, `past_7_days`, `past_30_days`, `past_90_days`, `past_12_months`, `past_5_years`, `all_time`, or Google's own format such as `now 7-d` or `2024-01-01 2024-06-30` | `past_12_months` |
| `property` | `web`, `images`, `news`, `youtube`, `shopping` | `web` |
| `category` | Google Trends category ID, 0 = all | 0 |
| `sections` | Only for `/trends`: any of `overTime,byRegion,relatedQueries,relatedTopics` | all four |
| `language` | For example `en-US`, `de`, `fr` | `en-US` |

The same call from Python:

```python
import requests

r = requests.get(
    "https://panix--google-trends-api.apify.actor/trends",
    params={"keywords": "web scraping,data extraction", "geo": "US"},
    headers={"Authorization": "Bearer <YOUR_APIFY_TOKEN>"},
    timeout=120,
)
report = r.json()
print(report["summary"])
```

In n8n, Make or Zapier use an HTTP Request module with the same URL and the Bearer header.

#### AI agents (MCP)

The server also speaks MCP at `https://panix--google-trends-api.apify.actor/mcp` (Streamable HTTP, same Bearer token). Add that URL as a remote MCP server in your agent or in Apify's MCP client. It offers three tools: `google_trends_report`, `trending_now` and `topic_suggestions`. They are billed like the HTTP endpoints: one Trends report or one lookup per call, and empty answers are free.

#### 2. Run it as a batch

Open the Input tab, list your keywords (one per line), pick countries and a time range, and press Start. Every keyword (or every comparison) becomes one row in the dataset. Use it for a list of 50 or 500 keywords, for schedules and for exports to CSV, Excel or Google Sheets. In **Trending now** and **Suggestions** modes you get one row per country or term.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("panix/google-trends-api").call(run_input={
    "keywords": ["web scraping", "data extraction"],
    "compareKeywords": True,
    "geos": ["US", "GB"],
    "timeRange": "past_12_months",
})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["geo"], item["summary"])
```

### Sample output

A comparison of two keywords in the US, shortened. This is from a real run.

```json
{
  "keywords": ["web scraping", "data extraction"],
  "geo": "US",
  "timeRange": "today 12-m",
  "interestOverTime": [
    { "date": "2025-11-16T00:00:00Z", "label": "Nov 16 – 22, 2025", "values": { "web scraping": 39, "data extraction": 41 }, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "US-MD", "geoName": "Maryland", "values": { "web scraping": 85, "data extraction": 15 }, "leader": "web scraping" }
  ],
  "relatedQueries": {
    "web scraping": {
      "top": [{ "query": "ai web scraping", "value": 100, "breakout": false, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=ai+web+scraping&date=today+12-m&geo=US" }],
      "rising": [{ "query": "playwright web scraping", "value": 110, "breakout": false, "formattedValue": "+110%", "link": "https://trends.google.com/trends/explore?q=playwright+web+scraping&date=today+12-m&geo=US" }]
    }
  },
  "summary": {
    "web scraping": { "average": 32.8, "peak": 50, "peakDate": "2026-03-01T00:00:00Z", "latest": 8, "change": -58, "direction": "falling" }
  },
  "hasData": true
}
```

`summary.change` compares the most recent third of the period with the third before it, in percent. `isPartial` marks the newest, still incomplete period; it is left out of the summary.

### Why people pick this one

- **Answers in seconds over HTTP.** No waiting for a run to start.
- **Compare up to 5 keywords** on one scale, and get the ready-made summary and direction.
- **Empty and failed calls are free.** If Google has no data for a term, or the call fails, you are not charged. The response says `"hasData": false` or returns an error, and `meta.charged` tells you what was billed.
- **Repeat calls are fast.** The same search within 15 minutes is answered from a short cache (still billed as a normal call, since you get the answer).
- **Same data in both modes.** Use the server interface for live lookups and the batch run for long lists.
- **Public data only.** It reads what anyone sees on trends.google.com. No login, no cookies from you.

#### Coming from another Google Trends scraper?

| Common problem | How this one handles it |
|---|---|
| You wait for a run to start for every lookup | Server interface answers right away |
| One row per time point, so a year of data is 52 billed rows | One billed report per keyword or comparison, with every point inside it |
| Related topics and queries cost extra or are missing | Included in the report, with a breakout flag |
| Comparing keywords means several runs that you align yourself | Up to 5 keywords in one call, on one scale |
| Errors and empty answers are billed | They are free |
| Blocked by Google after a few dozen requests | Retries on a fresh connection and falls back to proxies automatically |

### Pricing

You pay per event. The price per event depends on your Apify plan (the Store page shows all tiers).

| Event | What it is | Price on Starter (Free plan pays a little more) |
|---|---|---|
| Trends report | One keyword or one comparison of up to 5 keywords, with every section you asked for | $0.005 |
| Lookup | One trending-now list or one suggestions call | $0.002 |
| Actor start | Batch runs only, once per run | $0.00005 |

Higher Apify plans pay less (down to $0.004 per report and $0.0015 per lookup). Server calls do not pay the start fee. Errors, invalid input and answers without data are free. Use your Apify max-cost setting to cap what a batch run can spend.

For 1,000 keyword reports that is about $5.

### Limits and good to know

- Google Trends shows **relative** interest from 0 to 100, not search counts. The values are for comparing keywords and time periods, as on trends.google.com. Trending-now volumes are Google's rounded estimates.
- **Related topics need a single keyword.** Google does not give topics for comparisons. Turn "Compare keywords" off (or call one keyword at a time) to get them.
- Google samples its data: the same search can change by a point or two between calls.
- Very new or very rare terms often have no data. You get `hasData: false` and no charge.
- Up to 5 keywords per comparison, keywords up to 100 characters.
- If Google blocks every route at that moment you get HTTP 503 (server) or an error row (batch). Both are free. Try again in a few seconds.
- Google Trends has no personal data. Results can differ by country, category and the `property` (web, image, news, YouTube, shopping search).

### FAQ

**Do I need a Google account or an API key?** No. Only your Apify token for the server interface.

**How is this different from the official Google Trends?** The website has no export API and limits how much you can click. This gives the same numbers in JSON.

**Can I use it in an AI agent?** Yes. Call the HTTP endpoints from your agent's tool, or use the OpenAPI description at `/openapi.json`.

**Is it legal?** It reads public pages that anyone can open. You are responsible for how you use the data. Respect Google's terms for your use case.

**Something does not work.** Open an issue in the Issues tab with the call you made and the response you got.

# Actor input Schema

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

Trends = a full report per keyword. Trending now = today's trending searches for a country. Suggestions = Google's topic suggestions for a typed term.

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

One search term per line. Each keyword gets its own report, or turn on 'Compare keywords' to put up to 5 on one chart.

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

Put all keywords (max 5) in ONE report so their interest is on the same 0-100 scale. Off = one separate report per keyword.

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

ISO country codes such as US, GB, DE or regions such as US-CA. Leave empty for worldwide. Several codes = one report per country. In 'Trending now' mode the default is US.

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

How far back to look.

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

Which Google search to measure.

## `sections` (type: `array`):

Pick only what you need. Fewer sections run faster. Leave all four for the full report.

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

Narrow the search to one Google Trends category (for example 5 = Computers & Electronics, 7 = Finance). 0 = all categories.

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

Language of topic names, for example en-US, de, fr, es.

## Actor input object example

```json
{
  "mode": "trends",
  "keywords": [
    "web scraping",
    "data extraction"
  ],
  "compareKeywords": true,
  "geos": [
    "US"
  ],
  "timeRange": "past_12_months",
  "property": "web",
  "sections": [
    "overTime",
    "byRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "category": 0,
  "language": "en-US"
}
```

# Actor output Schema

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

Trends reports, trending searches or suggestions, depending on the mode. Rows of type error are free.

# 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 = {
    "mode": "trends",
    "keywords": [
        "web scraping",
        "data extraction"
    ],
    "compareKeywords": true,
    "geos": [
        "US"
    ],
    "timeRange": "past_12_months",
    "property": "web",
    "sections": [
        "overTime",
        "byRegion",
        "relatedQueries",
        "relatedTopics"
    ],
    "category": 0,
    "language": "en-US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("panix/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 = {
    "mode": "trends",
    "keywords": [
        "web scraping",
        "data extraction",
    ],
    "compareKeywords": True,
    "geos": ["US"],
    "timeRange": "past_12_months",
    "property": "web",
    "sections": [
        "overTime",
        "byRegion",
        "relatedQueries",
        "relatedTopics",
    ],
    "category": 0,
    "language": "en-US",
}

# Run the Actor and wait for it to finish
run = client.actor("panix/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 '{
  "mode": "trends",
  "keywords": [
    "web scraping",
    "data extraction"
  ],
  "compareKeywords": true,
  "geos": [
    "US"
  ],
  "timeRange": "past_12_months",
  "property": "web",
  "sections": [
    "overTime",
    "byRegion",
    "relatedQueries",
    "relatedTopics"
  ],
  "category": 0,
  "language": "en-US"
}' |
apify call panix/google-trends-api --silent --output-dataset

```

## MCP server setup

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