# Google Trends Scraper — Pay Only for Delivered Keywords (`blainer28/google-trends-reliable`) Actor

Interest over time, interest by region and related queries from Google Trends. Automatic session rotation on rate limits. Failed keywords are reported and never charged.

- **URL**: https://apify.com/blainer28/google-trends-reliable.md
- **Developed by:** [Blainer28](https://apify.com/blainer28) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 keyword delivereds

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 Scraper: Pay Only for Delivered Keywords

Get **interest over time**, **interest by region** and **related queries (top and rising)** from Google Trends, for up to thousands of keywords per run.

### Why this one

Google Trends limits automated traffic hard. When a scraper hits that limit, the run fails and you often pay anyway.

This Actor is built around that problem:

- **Automatic recovery.** On a rate limit it opens a fresh session with a new proxy IP and retries with backoff (8 attempts by default, configurable).
- **You pay only for delivered keywords.** A keyword that still fails after all retries is written to the dataset with `status: "failed"` and the reason, and it is **not charged**.
- **Nothing hidden.** Every run writes a summary to the `OUTPUT` record: terms requested, delivered and failed, rate limits hit, sessions rotated.

### Input

```json
{
  "searchTerms": ["bitcoin", "ethereum"],
  "compareTerms": false,
  "geo": "US",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "includeRegions": true,
  "includeRelatedQueries": true
}
```

- `compareTerms: true` compares up to 5 terms on one shared 0-100 scale, like the Compare view on Google Trends. With `false`, each term has its own scale.
- `timeRange`: past hour to 2004-present, or `customTimeRange` as `YYYY-MM-DD YYYY-MM-DD`.
- `geo`: country or region code (`US`, `CA`, `CA-QC`, `FR`…). Empty means worldwide.

### Output (one item per term)

```json
{
  "searchTerm": "bitcoin",
  "comparedWith": [],
  "geo": "CA",
  "timeRange": "today 3-m",
  "status": "ok",
  "interestOverTime": [{"date": "2026-09-20T00:00:00Z", "label": "Sep 20, 2026", "value": 25, "isPartial": true}],
  "interestByRegion": [{"geoCode": "CA-SK", "geoName": "Saskatchewan", "value": 100}],
  "relatedQueries": {
    "top": [{"query": "bitcoin price", "value": 100, "formattedValue": "100"}],
    "rising": [{"query": "…", "value": 46850, "formattedValue": "Breakout"}]
  },
  "fetchedAt": "2026-09-23T04:32:23+00:00"
}
```

### Limits (read before you buy)

- **Values are relative, not search volumes.** Google Trends scales each series from 0 to 100. This is how Google publishes the data, not a limit of this Actor.
- **Related topics are not included.** Google withholds them from non-browser clients: the request comes back empty. We leave the field out so an empty list is never mistaken for "no topics".
- **Sub-regions may be sparse.** For a region such as `CA-QC`, Google often returns little or no regional breakdown.
- **Google can change its private endpoints at any time.** When that happens, affected keywords come back as `failed` (not charged) until the Actor is updated.
- **Use residential proxies** (the default). Google rate-limits datacenter IPs much more.

# Actor input Schema

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

Keywords to look up. Duplicates are removed.

## `compareTerms` (type: `boolean`):

If on, terms are compared in groups of up to 5, like the Google Trends compare view (values share one scale). If off, each term is fetched alone (each has its own 0-100 scale).

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

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

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

Period to look up. Ignored if Custom time range is set.

## `customTimeRange` (type: `string`):

Overrides Time range. Format: YYYY-MM-DD YYYY-MM-DD

## `searchProperty` (type: `string`):

Which Google search the interest comes from.

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

Google Trends category ID. 0 = all categories.

## `includeRegions` (type: `boolean`):

Add interest by country or sub-region for each term.

## `includeRelatedQueries` (type: `boolean`):

Add the top and rising related queries for each term.

## `maxAttempts` (type: `integer`):

Retries with a fresh session on rate limits. Higher = more reliable, slower.

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

Residential proxies are strongly recommended: Google rate-limits datacenter IPs.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compareTerms": false,
  "geo": "",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "category": 0,
  "includeRegions": true,
  "includeRelatedQueries": true,
  "maxAttempts": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Delivered terms have status "ok"; failed terms have status "failed" with the reason and are not charged.

## `summary` (type: `string`):

Terms requested, delivered and failed, rate limits hit and sessions rotated.

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("blainer28/google-trends-reliable").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",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("blainer28/google-trends-reliable").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"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call blainer28/google-trends-reliable --silent --output-dataset

```

## MCP server setup

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

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/AB8yJbCdIvHwgbOhn/builds/jzfdk98CuQKtphTKv/openapi.json
