# Google Trends Scraper: interest over time, related queries (`steadydata/google-trends-batch`) Actor

Google Trends per search term with a transparent success rate: interest over time, the average value over the period and the related queries, with geo, timeframe and language control. Strict output schema for AI agents and pipelines; terms without data are never charged.

- **URL**: https://apify.com/steadydata/google-trends-batch.md
- **Developed by:** [Steadydata Team](https://apify.com/steadydata) (community)
- **Categories:** SEO tools, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 search term delivereds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Trends Scraper (reliable, batch)

Fetch Google Trends data for up to **200 search terms in one run**: interest-over-time
plus top and rising related queries, with geo, timeframe and language control. Built
for SEO pipelines, market research and AI agents — strict output schema, explicit
error codes, and **you only pay for terms that are actually delivered**.

### Why this scraper

- **Only successful results are charged.** A term that Google returns no data for, or
  that gets temporarily blocked, shows up as a clear error record at no cost.
- **Anti-blocking built in.** Warm session management with automatic cookie refresh,
  paced requests and retries on fresh connections — the failure modes that plague
  Trends scrapers are handled inside the actor, not left to you.
- **Honest partial results.** When the interest data succeeds but related queries are
  briefly unavailable, you get the interest data plus a note saying exactly why the
  related part is missing — never a silently incomplete record.
- **Batch and agent-ready.** Up to 200 terms per run, stable machine-readable schema.

### Who this is for

SEO and content teams sizing up topics before they commit, market researchers tracking
interest over time, and AI agents that need a demand signal rather than a guess.

If you check one keyword occasionally, the Google Trends website is free and fine. This
actor is for pulling dozens or hundreds of terms on a schedule, in a stable format.

### Who this is not for

**Read this before you buy.** Every term is fetched on its own, so its values are scaled
to that term alone (its own peak is 100). That is what you want for tracking one topic
over time, and exactly wrong for comparing two terms with each other: for that, use the
Google Trends Compare Scraper from the same publisher, which puts up to five terms on
one scale. Values are Google's relative index, never search volumes. For what is
trending right now per country, use the Trending Now Scraper; for one term's map by
country or region, the Interest by Region Scraper.

### Input example

```json
{
    "queries": ["chatgpt", "bitcoin"],
    "geo": "NL",
    "timeframe": "today 3-m",
    "includeRelatedQueries": true,
    "language": "en-US"
}
```

Timeframes: `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`,
`today 5-y`, `all`. Geo: country (`US`, `NL`, `DE`), region (`US-CA`), or empty for
worldwide.

### Output example

```json
{
    "query": "bitcoin",
    "status": "ok",
    "geo": "NL",
    "timeframe": "today 3-m",
    "averageValue": 56.2,
    "interestOverTime": [
        {"time": "Jun 10, 2026", "timestamp": 1781049600, "value": 90, "isPartial": false}
    ],
    "relatedQueries": {
        "top": [{"query": "koers bitcoin", "value": 100, "formattedValue": "100"}],
        "rising": [{"query": "spacex koers", "value": 950, "formattedValue": "+950%"}]
    }
}
```

A failed term produces an error record instead (and is **not** charged):

```json
{"input": "someterm", "status": "error", "errorCode": "NO_DATA", "error": "Empty timeline"}
```

Error codes: `BAD_QUERY`, `NO_DATA`, `BLOCKED`. `INPUT_TRUNCATED` appears once when your input is longer than this actor accepts.

### Related actors from steadydata

- [google-trends-compare](https://apify.com/steadydata/google-trends-compare): up to five keywords on one scale
- [google-trends-regions](https://apify.com/steadydata/google-trends-regions): where in the world the interest sits
- [google-trending-searches](https://apify.com/steadydata/google-trending-searches): what is trending right now per country

### Pricing

Pay per event: one `trend-fetched` event per delivered term - a flat price that
includes the full interest-over-time series and related queries. No charge for
failed terms, no separate platform-usage surcharge, and no per-row billing
surprises: one term is one price, whatever the timeframe.

### FAQ

**Are values absolute search volumes?**
No — Google Trends values are relative (0-100) within your query's timeframe and
region, exactly as Google reports them.

**Can I compare terms?**
Not with this actor: each term is scaled to its own peak, so two series from this actor
are not on one scale. The Google Trends Compare Scraper from the same publisher does the
comparison the way the Trends Compare page does, up to five terms on one scale.

**Is personal data collected?**
No. Trends data is aggregated by Google and contains no personal data.

**Why is your price flat per term instead of per row?**
Because per-row billing punishes you for asking a sensible question. A twelve-month
series has far more rows than a one-week series but is not worth more to you, so it
costs the same here: one term, one price.

**What if Google blocks a request?**
The actor retries on a fresh connection before giving up. If a term still fails you get
a clear `BLOCKED` record and are not charged for it.

# Actor input Schema

## `queries` (type: `array`):

Search terms to fetch trends for. Max 200 per run.

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

Geo code such as US, NL, DE, or empty for worldwide. Region codes like US-CA also work.

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

Trends timeframe: 'now 1-d', 'now 7-d', 'today 1-m', 'today 3-m', 'today 12-m', 'today 5-y', or 'all'.

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

Adds top and rising related queries per term.

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

hl parameter, e.g. en-US or nl-NL. Affects formatted labels only.

## Actor input object example

```json
{
  "queries": [
    "chatgpt"
  ],
  "geo": "",
  "timeframe": "today 12-m",
  "includeRelatedQueries": true,
  "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 = {
    "queries": [
        "chatgpt"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadydata/google-trends-batch").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 = { "queries": ["chatgpt"] }

# Run the Actor and wait for it to finish
run = client.actor("steadydata/google-trends-batch").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 '{
  "queries": [
    "chatgpt"
  ]
}' |
apify call steadydata/google-trends-batch --silent --output-dataset

```

## MCP server setup

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

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/UIxOSWixWYDvDhVkZ/builds/8AF3CdZs4cRvnUEy7/openapi.json
