# Google Trends Scraper (`drydock/google-trends-scraper`) Actor

Interest over time, by region, and related queries from Google Trends. Rotates sessions so large runs do not stall on rate limits.

- **URL**: https://apify.com/drydock/google-trends-scraper.md
- **Developed by:** [Drydock Data](https://apify.com/drydock) (community)
- **Categories:** SEO tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 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?

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

Pulls Google Trends data as clean, flat rows: interest over time, interest by region, and related queries — for any keyword, location and date range.

### Why this one

Google Trends rate-limits hard. A request without a valid session cookie is refused immediately, and the usual response to that is a retry loop that eventually eats the whole run. If you have used a Trends scraper that hangs and then dies without returning anything, that is what happened.

This actor establishes a session before every request and rotates it — new cookie, new proxy address — the moment Google pushes back, with backoff between attempts. A failed keyword is logged and skipped rather than killing the run, so you keep the results for everything else.

Requests go straight to Google's data endpoints rather than driving a browser, so a run finishes in seconds instead of minutes: **395 rows across 3 keywords in 26 seconds**, no rate limits hit.

### What you get

One row per data point, ready for a spreadsheet or a database. Every row carries `keyword`, `geo`, `timeframe` and `type`, so results from several panels can share one dataset.

**Interest over time** — one row per time bucket

```json
{ "keyword": "bitcoin", "geo": "US", "timeframe": "today 12-m", "type": "timeseries",
  "date": "Aug 31 – Sep 6, 2025", "timestamp": 1756598400000, "value": 26, "isPartial": false }
```

**Interest by region** — one row per region that has data

```json
{ "keyword": "bitcoin", "geo": "US", "type": "geoMap",
  "regionCode": "US-WY", "regionName": "Wyoming", "value": 100 }
```

**Related queries** — top and rising, labelled

```json
{ "keyword": "bitcoin", "geo": "US", "type": "relatedQueries",
  "ranking": "top", "query": "bitcoin price", "value": 100 }
```

### Comparing terms

By default each term is fetched on its own, and Google scales each one from 0 to 100 independently — so a `100` for one term and a `100` for another say nothing about which is searched more.

Turn on **Compare terms** to send them in one request, the way the Compare view on trends.google.com works. Every row is then on a shared scale and carries `"compared": true`:

```json
{ "keyword": "bitcoin",  "date": "Sep 7 - 13", "value": 84, "compared": true }
{ "keyword": "ethereum", "date": "Sep 7 - 13", "value": 11, "compared": true }
{ "keyword": "solana",   "date": "Sep 7 - 13", "value": 11, "compared": true }
```

Google allows at most five terms per comparison. Ask for more with the switch on and the run stops with a clear message rather than silently returning numbers that cannot be compared.

### Input

| Field | Description |
|---|---|
| `searchTerms` | Keywords to look up. Each is fetched separately, so values are comparable across runs. |
| `compareTerms` | Put all terms on one shared 0-100 scale. Max 5 terms. Off by default. |
| `outputs` | Any of `timeseries`, `geoMap`, `relatedQueries`. Defaults to `timeseries`. |
| `geo` | `US`, `GB`, `DE`, or a sub-region like `US-CA`. Empty means worldwide. |
| `language` | Interface language for labels and related queries — `en-US`, `de-DE`, `es-ES`, `pt-BR`. |
| `timeframe` | Past hour through 2004-to-present, or a custom `2024-01-01 2024-06-30`. |
| `property` | Web, Images, News, Shopping or YouTube search. |
| `category` | Google Trends category ID. `0` is everything. |
| `maxItems` | Hard row cap, so a run cannot cost more than you expect. |
| `proxyConfiguration` | Leave proxy on. Google limits by IP, and rotation is what keeps large runs alive. |

```json
{
  "searchTerms": ["bitcoin", "ethereum"],
  "outputs": ["timeseries", "geoMap", "relatedQueries"],
  "geo": "US",
  "timeframe": "today 12-m"
}
```

### Notes and limits

**Values are relative, not absolute.** Google reports interest on a 0–100 scale normalised within each request. A `100` means "the peak of this query in this range", not a search count. Use **Compare terms** when you need values that are comparable between keywords; without it, compare only within a single term's rows.

**Related topics is not available.** Google returns that panel empty for automated clients. Rather than ship a switch that always yields nothing, it is left out.

**`maxItems` stops work, not just output.** Once the cap is hit the actor stops fetching, so you are not billed for data that gets discarded.

### Pricing

Pay per result — you are charged only for rows actually delivered. A keyword that fails returns nothing and costs nothing.

# Actor input Schema

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

Keywords to look up. Each term is fetched separately, so results are directly comparable across runs.

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

Fetch all terms in one request so Google normalises them on a shared 0-100 scale, the way the Compare view on trends.google.com does. Leave off to fetch each term independently — independent runs are each scaled on their own and are not comparable across terms. Maximum 5 terms when on.

## `outputs` (type: `array`):

Which Google Trends panels to return. Each selected panel produces its own rows, tagged with a 'type' field. Related topics is not offered: Google returns it empty for automated clients.

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

Two-letter country code such as US, GB or DE. Sub-regions work too, e.g. US-CA. Leave empty for worldwide.

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

Interface language for labels and related queries, e.g. en-US, de-DE, es-ES, pt-BR.

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

Google Trends time range. Presets cover the common cases; a custom range uses the format 2024-01-01 2024-06-30.

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

Restrict to a single Google surface. Web search is the default.

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

Google Trends category number. 0 is all categories; 7 is Finance, 71 is Food & Drink. Leave at 0 unless you know the ID you want.

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

Stop after this many rows. Useful as a hard cost ceiling. Leave empty for no limit.

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

Google rate-limits by IP. Rotating proxy addresses is what keeps a large run from stalling, so leaving this on is strongly recommended.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin"
  ],
  "compareTerms": false,
  "outputs": [
    "timeseries"
  ],
  "geo": "",
  "language": "en-US",
  "timeframe": "today 12-m",
  "property": "",
  "category": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchTerms": [
        "bitcoin"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("drydock/google-trends-scraper").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"] }

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

```

## MCP server setup

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

```

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/DltpTfzs6WN3nPonj/builds/mG3xVjXrWD19K1SQw/openapi.json
