# Google Trends Scraper - Reliable, Pay Only for Results (`myceworks/google-trends-reliable`) Actor

Google Trends interest over time, related queries (top and rising), interest by region and related topics for many keywords and countries. Hard time limit per keyword, automatic retry on rate limits, and you are not charged when Google returns nothing.

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

## Pricing

from $1.40 / 1,000 trends results

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 — Reliable, Pay Only for Results

Get Google Trends data for many keywords and countries in one run:

- **Interest over time** (0-100) with a ready summary: mean, max, first and last four points, change %
- **Related queries** — top and rising
- **Interest by region** (optional) — sub-regions sorted by interest
- **Related topics** (optional) — top and rising
- Web, YouTube, News, Images or Google Shopping search; any time range or a custom date range; any category

### Why another Google Trends scraper

Google rate-limits Trends hard. Scrapers that ignore this run for minutes, loop, or finish with nothing — and you still pay for the compute. This one is built the other way round:

| | This Actor |
|---|---|
| Time limit | Every keyword × location has a hard limit (default 90 s, including retries). The run never loops. |
| Rate limits | On HTTP 429 or "quota exceeded" it waits and retries with a different referer, then moves on. |
| Billing | You pay per result **only when Google returned data**. Failed results and below-threshold terms are listed with `charged: false` and cost nothing. |
| Transparency | Each result shows `status` (`ok`, `partial`, `lowVolume`, `failed`) and `sectionErrors` — nothing is silently dropped. |
| Run timeout | The run stops 60 s before its timeout and tells you how far it got, instead of being killed mid-result. |

### Input

```json
{
  "searchTerms": ["air fryer", "standing desk"],
  "geos": ["US", "GB"],
  "timeframe": "today 12-m",
  "property": "web",
  "interestOverTime": true,
  "relatedQueries": true,
  "interestByRegion": false,
  "relatedTopics": false
}
```

- `geos`: ISO country codes (`US`, `DE`, `JP`, `KR` …), sub-regions (`US-CA`), or an empty line for worldwide.
- `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 `2025-01-01 2025-06-30`.
- Each term is fetched on its own, so a term's values are comparable across its own dates and regions. Values of different terms are each scaled to their own peak (100) and are **not** comparable with each other.

### Output (one item per term × location)

| Field | Meaning |
|---|---|
| `searchTerm`, `geo`, `timeframe`, `property`, `category` | What was fetched |
| `status` | `ok` · `partial` (some sections failed) · `lowVolume` (Google reports no measurable interest) · `failed` |
| `summary` | `mean`, `max`, `first4`, `last4`, `changePct` of interest over time |
| `interestOverTime` | `[{date, value, isPartial}]` |
| `relatedQueries` | `{top: [{query, value}], rising: [{query, value}]}` — rising `value` is % growth |
| `interestByRegion` | `[{geoCode, geoName, value}]` |
| `relatedTopics` | `{top: [...], rising: [...]}` with `title`, `type`, `value`, `mid` |
| `sectionErrors` | Why a section failed, if it did |
| `charged` | Whether this result was billed |
| `source` | Google Trends attribution |

### Pricing

Pay per result: one **trends-result** event per term × location that returned data — **$2.00 per 1,000 results** on the free plan, $1.80 (Starter), $1.60 (Scale), $1.40 (Business). Each result already includes interest over time *and* related queries. Apify adds its standard actor-start fee of $0.00005 per run. Not charged for `failed` or `lowVolume` results. The run stops when your spending limit is reached.

Tested on 300 results (100 terms × US, GB, DE): interest over time 300/300, related queries 296/300.

### Limits — read before you rely on it

- Google Trends values are relative (0-100), not search volumes.
- Very low-interest terms return zeros; they are marked `lowVolume` and not charged.
- Related queries and topics are rate-limited more strictly than interest over time. When Google refuses them after all retries, the result is `partial` and shows why.
- Google can change Trends without notice.

Data source: Google Trends (https://www.google.com/trends).

Not affiliated with, endorsed or sponsored by Google LLC. "Google" and "Google Trends" are trademarks of Google LLC, used here only to describe the data source.

# Actor input Schema

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

Keywords to look up. Each term is fetched on its own (no cross-term normalisation), so values are comparable over time and across regions for the same term.

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

ISO country codes (US, GB, DE, JP, KR …) or sub-regions (US-CA). Leave one empty line for worldwide. One result per term × location.

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

One of: 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 'YYYY-MM-DD YYYY-MM-DD'.

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

Which Google search to measure.

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

Google Trends category ID. 0 = all categories.

## `interestOverTime` (type: `boolean`):

Weekly/daily interest (0-100) plus a summary: mean, max, first and last four points, change %.

## `relatedQueries` (type: `boolean`):

Top and rising search queries related to the term. Rising values are % growth.

## `interestByRegion` (type: `boolean`):

Sub-regions of the chosen location, sorted by interest.

## `relatedTopics` (type: `boolean`):

Top and rising topics (entities) related to the term.

## `maxSecondsPerTerm` (type: `integer`):

Hard limit for one term × location, including retries after Google rate limits. When reached, that section is marked as failed and the run moves on — it never loops.

## Actor input object example

```json
{
  "searchTerms": [
    "air fryer",
    "standing desk"
  ],
  "geos": [
    "US"
  ],
  "timeframe": "today 12-m",
  "property": "web",
  "category": 0,
  "interestOverTime": true,
  "relatedQueries": true,
  "interestByRegion": false,
  "relatedTopics": false,
  "maxSecondsPerTerm": 90
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `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 = {
    "searchTerms": [
        "air fryer",
        "standing desk"
    ],
    "geos": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("myceworks/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": [
        "air fryer",
        "standing desk",
    ],
    "geos": ["US"],
}

# Run the Actor and wait for it to finish
run = client.actor("myceworks/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": [
    "air fryer",
    "standing desk"
  ],
  "geos": [
    "US"
  ]
}' |
apify call myceworks/google-trends-reliable --silent --output-dataset

```

## MCP server setup

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