# Google Trends Scraper: Real Data, No Fake Spikes, Any Country (`trueline-data/google-trends-scraper`) Actor

Interest over time, interest by state or city, related queries and related topics from Google Trends, for any search term, place and time range. Pay only for terms that return data.

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

## Pricing

$3.00 / 1,000 search terms

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: Real Data, No Fake Spikes, Any Country

Get Google Trends data for any search term: interest over time, interest by state, region or city,
related queries and related topics. Any country, any time range, web, image, news, shopping or
YouTube search.

### Why this one

- **You pay only for terms that return data.** A term with too little search volume is listed with
  the reason and not charged.
- **Noise is filtered.** For very low-volume terms, Google Trends sometimes returns a single fake
  spike (we saw it on made-up words). Those answers are marked `no_data` instead of sold to you as real.
  Thin but real data is marked `lowVolume: true`.
- **Built to get through.** Each term runs on one IP from start to end (Google ties its cookie to
  the IP), and a blocked request is retried on a new IP.
- **Summary numbers ready to use:** average interest, peak (date and value) and latest value.
- **Compare mode:** up to 5 terms on one shared 0-100 scale, exactly like the Compare box on Google Trends.

### Input

| Field | What it does |
| --- | --- |
| `searchTerms` | One term per line. |
| `geo` | `US`, `GB`, `US-FL`… Empty = worldwide. |
| `timeRange` | Past hour up to 2004-now. Or `customTimeRange`: `2024-01-01 2024-12-31`. |
| `searchType` | `web`, `images`, `news`, `shopping`, `youtube`. |
| `category` | Google Trends category id (0 = all). |
| `compareTerms` | On = shared scale in groups of 5. Off = each term on its own scale. |
| `interestOverTime`, `interestByRegion`, `relatedQueries`, `relatedTopics` | Choose the sections you want. |
| `regionResolution` | Countries, states, US metro areas (DMA) or cities. Empty = automatic. |

```json
{ "searchTerms": ["heat pump", "tankless water heater"], "geo": "US", "timeRange": "today 12-m" }
```

### Output

```json
{
  "searchTerm": "heat pump",
  "status": "ok",
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "searchType": "web",
  "comparedWith": [],
  "averageInterest": 52.5,
  "peak": { "date": "2026-05-17T00:00:00Z", "value": 100 },
  "latest": { "date": "2026-10-04T00:00:00Z", "value": 32 },
  "lowVolume": false,
  "interestOverTime": [{ "date": "2025-10-12T00:00:00Z", "formattedTime": "Oct 12 – 18, 2025", "value": 33, "isPartial": false }],
  "interestByRegion": [{ "geoCode": "US-WY", "geoName": "Wyoming", "value": 100 }],
  "relatedQueries": {
    "top": [{ "query": "what is heat pump", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "ductless heat pump repair", "value": 350, "formattedValue": "+350%" }]
  }
}
```

### Pricing

Pay per search term returned with data. Nothing else is charged.

### Good uses

Market and product research, SEO and content planning, seasonality, picking the best state or city
to launch in, and tracking brands over time.

# Actor input Schema

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

One search term per line.

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

Country or region code: US, GB, DE, US-FL, US-TX. Leave empty for worldwide.

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

The period to look at. A custom range below overrides this.

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

Two dates, like 2024-01-01 2024-12-31. Overrides the time range above.

## `searchType` (type: `string`):

Which Google search to measure: web, images, news, Google Shopping or YouTube.

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

Google Trends category number. 0 means all categories.

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

On: terms are compared in groups of 5 on one shared 0-100 scale, like the Compare box on Google Trends. Off: each term gets its own 0-100 scale.

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

A 0-100 value for each day, week or month.

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

A 0-100 value for each state, region or city.

## `regionResolution` (type: `string`):

Leave empty to choose automatically: countries for worldwide, states for a country, cities for a state.

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

Top and rising searches people also make.

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

Top and rising topics people also search.

## `maxConcurrency` (type: `integer`):

Google Trends limits fast traffic. 3 is safe.

## `maxRetries` (type: `integer`):

Each retry uses a new IP address.

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

Residential IPs get clean answers. From datacenter IPs Google Trends sometimes returns noise for low-volume terms.

## Actor input object example

```json
{
  "searchTerms": [
    "solar panels",
    "heat pump"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "searchType": "web",
  "category": 0,
  "compareTerms": false,
  "interestOverTime": true,
  "interestByRegion": true,
  "relatedQueries": true,
  "relatedTopics": false,
  "maxConcurrency": 3,
  "maxRetries": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "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 = {
    "searchTerms": [
        "solar panels",
        "heat pump"
    ],
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("trueline-data/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": [
        "solar panels",
        "heat pump",
    ],
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("trueline-data/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": [
    "solar panels",
    "heat pump"
  ],
  "geo": "US",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call trueline-data/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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