# Google Trends All-in-One API (`romy/google-trends-all-in-one-api`) Actor

Unofficial always-on REST API for Google Trends: trending searches, daily trending list with filters, and keyword explore data (interest over time, by region, related topics/queries). No account or API key needed.

- **URL**: https://apify.com/romy/google-trends-all-in-one-api.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.90 / 1,000 explores

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

### What does Google Trends All-in-One API do?

**Google Trends All-in-One API** is a REST endpoint for live Google Trends data — today's top trending searches, the full daily trending list with filters, and keyword explore data (interest over time, interest by region, related topics and queries). All from a single always-on API powered by [Apify Standby](https://docs.apify.com/platform/actors/development/programming-interface/standby).

Google Trends has **no official public API and no mobile app** — this Actor wraps the same data sources the [Google Trends](https://trends.google.com/) web app itself uses: a dedicated RSS feed, the same internal JSON RPC the Trending Now page calls client-side (no HTML/SSR scraping involved), and the Explore API. Confirmed live via real browser traffic capture. No account, API key, or signing needed for any of it.

### Why use Google Trends All-in-One API?

- **No auth of any kind** — every endpoint works fully anonymously, confirmed live
- **Two ways to get trending data** — a lightweight RSS-backed endpoint safe for frequent polling, and a fuller filterable endpoint (period/category/status/sort) for when you need more than the top 10
- **Full keyword explore in one call** — interest over time, interest by region, and related topics/queries for a keyword in a single request, mirroring exactly how the real Trends UI drives one search (one token-issuing call + four widget calls)
- **Always-on** — Standby mode means no cold start, responds in milliseconds
- **Use cases:** trend/news monitoring dashboards, content and SEO research, market/consumer-interest research, social listening

### Endpoints

| Method | Path                 | Description                                                      |
| ------ | -------------------- | ---------------------------------------------------------------- |
| `GET`  | `/trending`          | Top-10 current trending searches + related news (RSS-backed)     |
| `GET`  | `/trending/detailed` | Full daily trending list (~450 items), with filters              |
| `GET`  | `/explore`           | Interest over time/region + related topics/queries for a keyword |

### How to use Google Trends All-in-One API

1. Open this Actor's Standby API URL (shown on the Actor's page, under the API tab, once linked/deployed on the Apify platform).
2. Call any endpoint — for example:
   ```bash
   curl "https://<your-actor-standby-url>/trending?geo=US"
   curl "https://<your-actor-standby-url>/trending/detailed?geo=US&hours=24&sort=search-volume"
   curl "https://<your-actor-standby-url>/explore?q=bitcoin&geo=US"
   ```
   Every call needs your Apify API token, either as `Authorization: Bearer <token>` or `?token=<token>` — the Actor's page API tab has a ready-to-copy version with your token filled in.
3. Read the JSON response — no setup required.

### Parameters

**`GET /trending`** — `geo` required (ISO 3166-1 alpha-2 country code, e.g. `US`). No other parameters have any effect — confirmed live: the upstream RSS feed silently ignores period/category/sort filters and always returns the current top-10 for the given `geo`.

**`GET /trending/detailed`** — `geo` required.

| Param        | Type                                                          | Example         | Meaning                                                                                      |
| ------------ | ------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------- |
| `hours`      | int, enum `4`|`24`|`48`|`168`                              | `24`            | Period filter (168 = 7 days) — real upstream server-side filter, all 4 values confirmed live |
| `category`   | int, enum (see table below)                                   | `17`            | Filters on each item's `categoryIds` field                                                   |
| `activeOnly` | boolean                                                       | `true`          | Keeps only items whose `endTime` field is `null`                                             |
| `sort`       | string, enum `title`|`search-volume`|`recency`|`relevance` | `search-volume` | Omit for `relevance` (the order Google's own response returns)                               |

`geo` and `hours` are the only parameters Google's endpoint actually filters on server-side. `category`/`activeOnly`/`sort` are applied by this Actor itself, locally, on top of one full fetch — this mirrors exactly what the live Trends UI does (confirmed: changing those filters in the UI does not trigger any new network request, only `hours` does). The `category` id space is the Trending Now UI's own category picker — confirmed (not assumed) by clicking every one of the UI's 19 category filters live and cross-checking the items each one showed against those same items' `categoryIds` field: every category with a meaningful sample size matched exactly (e.g. selecting "Business and Finance" in the UI showed 25 items, and all 25 had `categoryIds` containing `3` — the same id the UI's own URL uses for that category). This is a fixed taxonomy (id 12 is skipped — never appeared in the live dropdown):

| id  | Category             | id  | Category                  |
| --- | -------------------- | --- | ------------------------- |
| 1   | Autos and Vehicles   | 11  | Other                     |
| 2   | Beauty and Fashion   | 13  | Pets and Animals          |
| 3   | Business and Finance | 14  | Politics                  |
| 4   | Entertainment        | 15  | Science                   |
| 5   | Food and Drink       | 16  | Shopping                  |
| 6   | Games                | 17  | Sports                    |
| 7   | Health               | 18  | Technology                |
| 8   | Hobbies and Leisure  | 19  | Travel and Transportation |
| 9   | Jobs and Education   | 20  | Climate                   |
| 10  | Law and Government   |     |                           |

**`GET /explore`** — `q` required.

| Param      | Type   | Default      | Example      | Meaning                                                                                                                           |
| ---------- | ------ | ------------ | ------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| `q`        | string | —            | `bitcoin`    | The keyword to explore                                                                                                            |
| `geo`      | string | worldwide    | `US`         | ISO 3166-1 alpha-2 country code                                                                                                   |
| `time`     | string | `today 12-m` | `today 12-m` | Google Trends time-range syntax — `now 1-H`, `now 7-d`, `today 1-m`, `today 12-m`, `today 5-y`, `all`, or `YYYY-MM-DD YYYY-MM-DD` |
| `category` | int    | `0` (all)    | `0`          | Explore category id — a separate id space from `/trending/detailed`'s `category`                                                  |

### Output

Every response is returned directly over HTTP — this Actor does not write to an Apify dataset. Real responses (trimmed for readability):

`GET /trending?geo=US` (trimmed to one item, one news item):

```json
{
    "success": true,
    "trending": [
        {
            "title": "dolly parton",
            "approxTraffic": "10000000+",
            "pubDate": "Tue, 25 Aug 2026 17:00:00 -0700",
            "picture": "https://encrypted-tbn0.gstatic.com/images?q=...",
            "pictureSource": "AP News",
            "newsItems": [
                { "title": "Dolly Parton's cause of death revealed", "url": "https://...", "source": "AP News" }
            ]
        }
    ]
}
```

`GET /trending/detailed?geo=US` (one item, trimmed):

```json
{
    "success": true,
    "trending": [
        {
            "query": "dolly parton",
            "geo": "US",
            "startTime": 1787680200,
            "endTime": null,
            "searchVolumeBucket": 10000000,
            "growthPercent": 1000,
            "relatedQueries": ["dolly parton", "..."],
            "categoryIds": [4],
            "newsArticles": [{ "storyId": 4797548791, "language": "en", "geo": "US" }],
            "displayQuery": "dolly parton"
        }
    ]
}
```

`GET /explore?q=bitcoin&geo=US` (interestOverTime, trimmed to two points):

```json
{
    "success": true,
    "interestOverTime": {
        "default": {
            "timelineData": [
                { "time": "1755993600", "formattedTime": "Aug 24 – 30, 2025", "value": [29], "formattedValue": ["29"] },
                {
                    "time": "1756598400",
                    "formattedTime": "Aug 31 – Sep 6, 2025",
                    "value": [26],
                    "formattedValue": ["26"]
                }
            ]
        }
    },
    "interestByRegion": { "...": "..." },
    "relatedTopics": { "...": "..." },
    "relatedQueries": { "...": "..." }
}
```

### Data notes

- **No auth of any kind, confirmed live for all three endpoints** — no signature, token exchange with credentials, or session cookie. `/explore` does use a short-lived per-widget `token`, but it's issued freely by an unauthenticated `POST /trends/api/explore` call, not a proof of identity.
- **`/trending/detailed` uses no HTML/SSR scraping at all** — it calls the same internal JSON RPC (`i0OFE` via `/_/TrendsUi/data/batchexecute`) the live Trending Now page itself fires client-side when its period filter changes. Found by watching that request rather than guessing an endpoint, then confirmed via direct `curl` with **no prior page load and an arbitrary/random session id** — the endpoint doesn't validate the session id at all for this read. This replaced an earlier version of this Actor that parsed the trending page's raw HTML instead; the data is identical (byte-for-byte matching item count against the HTML version), just reached without any HTML parsing.
- **`/trending` and `/trending/detailed` genuinely differ in capability, not just size.** The RSS feed backing `/trending` was confirmed (by diffing responses with and without each query param) to silently ignore `hours`/`category`/`sort` entirely — it's a fixed top-10 snapshot. `/trending/detailed` calls the upstream RPC with real `hours` filtering, then applies `category`/`activeOnly`/`sort` itself afterward (see Parameters above) — Google's own frontend does the exact same thing on the exact same response, it doesn't ask its server to filter those either.
- **`/trending/detailed`'s upstream item shape is positional, not named JSON** — Google serializes it using its own JSPB (protobuf-over-JSON) convention: real internal `.proto`-defined fields, but written to the wire as an array where index position, not a key name, identifies each field. This Actor maps that raw array into the named `TrendingSearchItem` shape shown under Output before returning it — see the `RawTrendingItem`/`toTrendingSearchItem` code in `src/google-trends-client.ts` for the field-by-field mapping, with fields marked either fully confirmed (cross-checked against the rendered UI, e.g. the "10M+" / "1,000%" badges) or best-effort/unconfirmed. Three raw fields that were always observed `null` with no known purpose are dropped in the named output rather than exposed as meaningless `null` properties.
- **The array *position* of each field is grounded in JSPB's actual implementation** (confirmed by reading `protobuf-javascript`'s own `message.js`: array index N maps to protobuf field number N+1). **The field *names* used in this README and in the code are not Google's real internal names, though** — no public `.proto` source exists for this internal-only service, and the page's own JS is Closure-Advanced-Compiled, which strips every real identifier (confirmed by downloading and inspecting the actual compiled bundle). No public prior art publishes real names either. Treat field names here as this Actor's own descriptive labels for the data, not as official Google terminology.
- **The old `dailytrends`/`realtimetrends` REST endpoints documented by third-party libraries (e.g. pytrends) are dead** — confirmed a real HTTP 404 on both. Google fully migrated this feature to the two `/trending` surfaces this Actor uses instead.
- **`/trending/detailed`'s `category` id space is confirmed identical to the Trending Now UI's own category picker, not a separate/unmapped taxonomy** — verified by clicking every one of the UI's 19 category filters live, recording which items each one showed, and cross-referencing those items' `categoryIds` field: the match was exact for every category with enough items to check meaningfully (e.g. "Other" showed 25 items, all 25 tagged `categoryIds: [11]`, no exceptions). An earlier version of this Actor incorrectly documented these as two separate, unmapped id spaces before this was checked.
- **`/explore`'s HTTP 429 is (mostly) a session-cookie gate, not an IP-based rate limit** — confirmed with a controlled test: a cookieless request to Google's `/trends/api/explore` reliably gets a 429 (even from a fresh proxy IP that had never hit Google before), but that same 429 response comes with a `Set-Cookie: NID=...`, and replaying the identical request with that cookie attached succeeds immediately. This Actor captures and reuses that cookie automatically (in-memory, for the life of the running Standby container, up to 4 retry attempts) — see `fetchWithCookieRetry` in `src/google-trends-client.ts`.
- **`RELATED_TOPICS` and `RELATED_QUERIES` hit the same upstream endpoint path and throttle each other independently of the cookie gate above** — confirmed live: calling the second one soon after the first 429s it even with an already-valid session cookie (a manually-replayed call with a fresh, unused cookie succeeds immediately, so it isn't a cookie problem). This Actor retries the second call with increasing backoff (1.5s/3s/6s) rather than trusting a single fixed delay.
- **This Actor's own dev/test IP got progressively more rate-limited across ~2 days of heavy manual testing during development** — by the end, even the initial `/explore` token call started failing with what looks like a harder/different block (a non-Google-styled error page), beyond what the cookie-retry logic is designed to route around. This is expected to not apply to a fresh Standby container running from Apify's infrastructure with no such history — but if `/explore` starts erroring persistently in production despite the retry logic, that's the likely explanation, and routing it through a proxy (not built in by default) would be the next mitigation to reach for.

### Pricing

Pay-per-event, billed only on a successful call — one event per request, tiered by your Apify plan (Free/Bronze/Silver/Gold/Platinum/Diamond get progressively cheaper rates). See the Actor's Pricing tab for the exact current rate per tier.

| Event               | What it charges for                                |
| ------------------- | -------------------------------------------------- |
| `trending-rss`      | Top-10 trending searches                           |
| `trending-detailed` | Full daily trending list                           |
| `explore`           | Interest over time/region + related topics/queries |

### Known limitations

- **`/trending` cannot be filtered** — this is a real, confirmed limitation of Google's own RSS feed, not something this Actor can work around while keeping the lightweight/low-rate-limit-risk path. Use `/trending/detailed` when filters are needed.
- **Some `/trending/detailed` field semantics are best-effort, not fully confirmed** — see the `RawTrendingItem` type's inline comments in `src/google-trends-client.ts` for exactly which fields (`endTime` in the non-null case, `displayQuery`'s exact purpose) are cross-checked against the live UI vs. inferred from value patterns alone. (`categoryIds` itself, and its id-to-name mapping, ARE fully confirmed — see the category table under Parameters above.)
- **`/explore`'s first-ever call in a freshly-started container may still take one extra round-trip** to capture the session cookie described in Data notes above — every call after that within the same running container reuses the cached cookie. If Google ever changes this behavior, this Actor still passes the upstream error through as-is rather than silently masking it.
- **`/trending/detailed`'s `category` param uses a different id space than `/explore`'s `category` param** — `/trending/detailed`'s is confirmed and listed in the category table under Parameters above; `/explore`'s is Google's separate Ads-style category taxonomy for that feature, not independently catalogued by this Actor.
- This is an unofficial, reverse-engineered integration, not affiliated with or endorsed by Google. Behavior may change if Google changes its Trends web app.

Found a bug or have a feature request? Use the Issues tab on this Actor's page.

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `api` (type: `string`):

This Actor doesn't write to a dataset — every response is returned directly over HTTP by its Standby web server. See the README / web server OpenAPI schema (webServerSchema) for the full endpoint list and response shapes (GET /trending).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/google-trends-all-in-one-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("romy/google-trends-all-in-one-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 '{}' |
apify call romy/google-trends-all-in-one-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,romy/google-trends-all-in-one-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/xqqcKAr4vdeNRyWNs/builds/ur44GxDEdowPdoCbS/openapi.json
