# Google Trends Scraper: Interest, Related Queries, Trending (`quietcrawl/google-trends`) Actor

Get Google Trends interest over time, interest by region and related queries (top and rising) for up to 5 compared keywords per group, plus the daily trending searches per country with their news links. Plain HTTP, no browser.

- **URL**: https://apify.com/quietcrawl/google-trends.md
- **Developed by:** [Quiet Crawl](https://apify.com/quietcrawl) (community)
- **Categories:** SEO tools, Marketing
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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: Interest, Related Queries, Trending

Get Google Trends data with one result per keyword. Each keyword's result holds all of this:

- **Interest over time** for the keyword, alone or compared with up to 4 others (0-100 scale, as in the Trends UI)
- **Interest by region** (states/regions for a country, countries for worldwide)
- **Related queries**, both **top** and **rising** (including "Breakout")

It can also list **trending now**: Google's current trending searches per country, with approximate traffic, picture and news links, one result per search.

It reads Google Trends' own JSON and RSS endpoints over plain HTTP. There is no browser, so runs are light and quick.

### Input

| Field | Description |
|---|---|
| `keywords` | Search terms. Every 5 keywords form one comparison group (like adding terms in the Trends UI), so values in a group are relative to each other. |
| `geo` | Country or region code (`US`, `GB`, `US-CA`). Empty = worldwide. Default `US`. |
| `timeframe` | `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 `YYYY-MM-DD YYYY-MM-DD`. Default `today 12-m`. |
| `category` | Google Trends category ID. `0` = all. |
| `property` | `""` web, `news`, `images`, `youtube`, `froogle` (Shopping). |
| `dataTypes` | Any of `interestOverTime`, `interestByRegion`, `relatedQueries`. Default all three. |
| `trendingNowGeos` | Optional country codes for trending searches, e.g. `["US", "GB"]`. |
| `maxItems` | Cap on charged results (one per keyword, one per trending search). Keyword results come first. |

You can run only trending searches by leaving `keywords` empty and setting `trendingNowGeos`.

### Output

One row per keyword, plus one row per trending search. `type` is `keyword` or `trendingNow`.

**keyword**

```json
{"type": "keyword", "keyword": "bitcoin", "comparedWith": ["ethereum"], "geo": "US", "timeframe": "today 12-m",
 "category": 0, "property": "",
 "interestOverTime": [{"date": "2025-11-02T00:00:00+00:00", "timestamp": 1762041600, "value": 31, "isPartial": false}, ...],
 "interestByRegion": [{"geoName": "Wyoming", "geoCode": "US-WY", "value": 81}, ...],
 "relatedQueries": {"top": [{"query": "bitcoin price", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/..."}, ...],
                    "rising": [...]},
 "missing": [], "scrapedAt": "2026-11-01T06:27:07+00:00"}
```

- Keywords in one group of up to 5 are compared, as in the Trends UI. `interestOverTime` values are on one 0-100 scale across the group. `comparedWith` lists the other keywords.
- In a compared group, `interestByRegion` values are each keyword's share of the group's searches in that region, so they add up to 100 across the group (Wyoming: bitcoin 81, ethereum 19). For a single keyword they are the usual 0-100 interest score.
- Regions Google has no data for are left out. `isPartial` is true for the latest, still incomplete period.
- `missing` lists data types Google didn't return after retries.
- A keyword with no data at all (nobody searches it, or every request failed) comes back with an `error` and is not charged.

**trendingNow**: `geo`, `title`, `approxTraffic` (e.g. `2000+`), `pubDate`, `picture`, `pictureSource`, `newsItems` (list of `title`, `url`, `source`, `picture`).

Fields Google doesn't send are `null`.

### Reliability

- The Actor first loads trends.google.com to get the session cookie Google expects.
- On HTTP 429/403 it waits 2, 4, then 8 seconds, refreshes the cookie once and retries.
- Keyword groups are requested about a second apart.
- The log ends with the count of HTTP 200 and 403/429 responses.
- If every keyword request fails, the run fails instead of returning only trending rows.
- A failed related-queries or region request is retried, and if it still fails the keyword's `missing` field says so.

Related topics are not included: Google returns them empty to this kind of request.

### Pricing

Pay per result: one result is one keyword's full report, or one trending search. Keywords with no data are free.

# Actor input Schema

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

Search terms. Every 5 keywords form one comparison group, as in the Trends UI, so their values are relative to each other.

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

Country or region code, e.g. US, GB, US-CA. Leave empty for worldwide.

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

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.

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

Google Trends category ID. 0 = all categories.

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

Which Google search to measure.

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

Which keyword data to return.

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

Optional country codes (e.g. US, GB, DE) to also get Google's current trending searches for.

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

Cap on charged results: one per keyword report, one per trending search. Keyword reports come first. Empty = no cap.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin",
    "ethereum"
  ],
  "geo": "US",
  "timeframe": "today 12-m",
  "category": 0,
  "property": "",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "trendingNowGeos": [
    "US"
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `results` (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 = {
    "keywords": [
        "bitcoin",
        "ethereum"
    ],
    "geo": "US",
    "timeframe": "today 12-m",
    "dataTypes": [
        "interestOverTime",
        "interestByRegion",
        "relatedQueries"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("quietcrawl/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": [
        "bitcoin",
        "ethereum",
    ],
    "geo": "US",
    "timeframe": "today 12-m",
    "dataTypes": [
        "interestOverTime",
        "interestByRegion",
        "relatedQueries",
    ],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("quietcrawl/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": [
    "bitcoin",
    "ethereum"
  ],
  "geo": "US",
  "timeframe": "today 12-m",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "maxItems": 20
}' |
apify call quietcrawl/google-trends --silent --output-dataset

```

## MCP server setup

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