# Google Trends Scraper (`elpatomaster/google-trends-api`) Actor

Google Trends as clean JSON: interest over time, interest by region and related queries (top and rising) for any keyword, country and time range. Fast JSON API, no browser, retried on residential IPs.

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

## Pricing

$3.00 / 1,000 keyword results

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

Google Trends data as clean JSON: **interest over time**, **interest by region** and **related queries** (top and rising) for any keyword, country and time range. It calls the same JSON endpoints the Trends site uses, with no browser, so runs are fast and cheap. Each keyword is retried on a fresh residential IP if Google rate-limits it.

### What you get

One record per keyword:

- `interestOverTime`: the 0-100 series with one point per day, week or month depending on the range.
- `interestByRegion`: every country or sub-region with data, scored 0-100.
- `relatedQueries`: `top` and `rising` lists. Rising queries with a huge jump are labelled `Breakout`.

### Input

| Field | Type | Description |
|---|---|---|
| `keywords` | string\[] | Terms to look up. Each one is queried on its own, so every series is scaled 0-100 by itself. |
| `geo` | string | Country or sub-region code (`US`, `GB`, `AR`, `US-CA`). Empty = worldwide. |
| `timeRange` | string | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m` (default), `today 5-y` or `all`. |
| `property` | string | Empty = web search, or `images`, `news`, `youtube`, `froogle` (Shopping). |
| `category` | integer | Google Trends category id. 0 = all (default). |
| `language` | string | Labels language, for example `en-US` (default) or `es-AR`. |

Example:

```json
{
    "keywords": ["bitcoin", "ethereum"],
    "geo": "US",
    "timeRange": "today 12-m"
}
```

### Output

Real excerpt from a run with `keywords: ["bitcoin"]`, `geo: "US"`, `timeRange: "today 12-m"` (lists shortened here):

```json
{
  "keyword": "bitcoin",
  "geo": "US",
  "timeRange": "today 12-m",
  "interestOverTime": [
    { "date": "2025-10-05", "label": "Oct 5 – 11, 2025", "value": 38, "hasData": true, "isPartial": false },
    { "date": "2025-10-12", "label": "Oct 12 – 18, 2025", "value": 39, "hasData": true, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "US-WY", "geoName": "Wyoming", "value": 100 },
    { "geoCode": "US-NV", "geoName": "Nevada", "value": 49 }
  ],
  "relatedQueries": {
    "top": [{ "query": "bitcoin price", "value": 100, "label": "100" }],
    "rising": [{ "query": "spcx stock", "value": 14150, "label": "Breakout" }]
  }
}
```

`isPartial` is `true` for the last, still-open period.

### Notes

- **Pricing is per keyword with data.** A keyword Google has no data for (very rare terms) returns nothing and is not charged. Keywords that fail after 5 attempts are not charged either.
- Values are Google's relative popularity index (0-100), not search volumes.
- Related topics are not included: Google returns them empty for plain search terms.
- Only data that Google Trends shows publicly is collected.

### Pricing

Pay per event: **USD 0.003 per keyword with data** (USD 3 per 1,000 keywords). The default input (2 keywords) costs about USD 0.006. Apify platform usage is included in the price, you only pay for delivered keywords.

### Use cases

- Keyword and SEO research: compare seasonality and rising queries before writing content.
- Market and product research: track interest by country or region over time.
- Trend monitoring: schedule the actor daily or weekly and send results to Google Sheets, a database or a webhook.
- Data for dashboards and reports: export the series as JSON, CSV or Excel.

### FAQ

**Do I need a Google account, API key or proxy?** No. Everything runs on Apify, you only provide keywords.

**Is this a pytrends alternative?** Yes, it returns the same kinds of data without you maintaining code or dealing with 429 errors.

**How many keywords per run?** There is no fixed limit. Each keyword is its own request, so very large lists simply take longer.

**Can I call it from my own code?** Yes, through the Apify API or the official Python and JavaScript clients, and with integrations such as Make, Zapier or n8n.

# Actor input Schema

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

Search terms to look up. One result row per keyword, each queried on its own so values are scaled 0-100 per keyword.

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

Country or sub-region code, for example US, GB, AR or US-CA. Leave empty for worldwide.

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

Period to analyze.

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

Google property to measure.

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

Google Trends category number, 0 for all categories (for example 7 = Finance, 5 = Computers & Electronics).

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

Language of the labels and related queries, for example en-US, es-AR, de-DE.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin",
    "ethereum"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "property": "",
  "category": 0,
  "language": "en-US"
}
```

# 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"
};

// Run the Actor and wait for it to finish
const run = await client.actor("elpatomaster/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 = {
    "keywords": [
        "bitcoin",
        "ethereum",
    ],
    "geo": "US",
}

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

```

## MCP server setup

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