# Google Trends Scraper — Reliable, No Charge for Failures (`fjordlabs/google-trends`) Actor

Google Trends interest over time, interest by region, and related queries/topics for many keywords and countries. Automatic IP rotation on rate limits; failed keywords are never charged.

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

## Pricing

from $2.00 / 1,000 keyword results

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 — Reliable, No Charge for Failures

Get **Google Trends** data for as many keywords and countries as you like, in one run:

- 📈 **Interest over time:** the full 0–100 timeline, plus the average and peak, ready for charts.
- 🗺️ **Interest by region:** states, regions or countries, sorted by interest.
- 🔍 **Related queries and topics:** both "top" and "rising" (breakout) lists.
- ⚖️ **Comparison mode:** up to 5 keywords on one shared scale, exactly like the comparison view on trends.google.com.
- 🎬 **Search types:** web, YouTube, News, Images or Google Shopping.

### Why this one?

Google Trends rate-limits scrapers aggressively, and that's why many Trends Actors fail a large share of their runs. This Actor:

1. **Rotates to a fresh IP and session automatically** when Google returns a rate limit (HTTP 429), with exponential backoff.
2. **Never charges you for failed keywords.** If a keyword still fails after all retries, you get an `error` row for free and are not billed.
3. **Is cheap and predictable:** a flat price per keyword result, whatever the timeline length or number of regions.

### Input example

```json
{
  "keywords": ["electric car", "heat pump", "solar panels"],
  "geos": ["US", "GB", "DE"],
  "timeframe": "past_12_months",
  "compareKeywords": false,
  "property": "web"
}
```

This gives 9 results (3 keywords × 3 countries).

### Output example (shortened)

```json
{
  "keyword": "heat pump",
  "geo": "GB",
  "timeframe": "today 12-m",
  "averageInterest": 61.4,
  "peak": {"date": "Jan 12 – 18, 2026", "value": 100},
  "interestOverTime": [{"time": 1729987200, "date": "Oct 27 – Nov 2, 2025", "value": 48, "isPartial": false}],
  "interestByRegion": [{"geoCode": "GB-SCT", "geoName": "Scotland", "value": 100}],
  "relatedQueries": {
    "top": [{"query": "heat pump grant", "value": 100}],
    "rising": [{"query": "heat pump grant 2026", "value": 450, "formattedValue": "+450%"}]
  },
  "relatedTopics": {"top": [], "rising": []},
  "comparedWith": []
}
```

### Pricing

| Event | Price |
|---|---|
| Actor start | $0.00005 |
| Keyword result (one keyword × one region, all sections included) | **$0.002** |
| Failed keyword | **free** |

100 keywords × 1 country costs **$0.20**.

### Tips

- **Market research:** run the same keywords across 10 countries to see where demand is growing.
- **Content and SEO:** the "rising" related queries are early signals for new topics.
- **Monitoring:** schedule the Actor weekly with `past_7_days` and export to Google Sheets.
- **AI agents:** works via the Apify MCP server, so your agent can call it directly.
- Values are relative (0–100) *within each result*. Turn on `compareKeywords` to put keywords on the same scale.

# Actor input Schema

## `keywords` (type: `array`):

Keywords or phrases to analyse. One result per keyword per region.

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

Country or region codes like US, GB, DK, DE, US-CA. Leave empty or use WORLDWIDE for global.

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

Period to analyse. Ignored when a custom start date is set.

## `startDate` (type: `string`):

YYYY-MM-DD. Overrides the time range.

## `endDate` (type: `string`):

YYYY-MM-DD. Defaults to today.

## `compareKeywords` (type: `boolean`):

On: keywords are queried in groups of up to 5 on a shared 0–100 scale, like the comparison view on trends.google.com. Off: each keyword gets its own 0–100 scale.

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

Which Google search product to analyse.

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

Google Trends category ID (0 = all categories). Example: 5 = Computers & Electronics.

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

0–100 timeline for each keyword.

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

Interest broken down by sub-region (or country for worldwide).

## `relatedQueriesAndTopics` (type: `boolean`):

Top and rising related searches and topics.

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

Language for region and topic names, e.g. en-US, da-DK, de-DE.

## `delaySeconds` (type: `number`):

Delay between requests (seconds).

## `proxy` (type: `object`):

Apify Proxy rotates IPs automatically when Google rate-limits a request.

## Actor input object example

```json
{
  "keywords": [
    "electric car",
    "heat pump"
  ],
  "geos": [
    "WORLDWIDE"
  ],
  "timeframe": "past_12_months",
  "compareKeywords": false,
  "property": "web",
  "category": 0,
  "interestOverTime": true,
  "interestByRegion": true,
  "relatedQueriesAndTopics": true,
  "language": "en-US",
  "delaySeconds": 1.5,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "keywords": [
        "electric car",
        "heat pump"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fjordlabs/google-trends").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 = {
    "keywords": [
        "electric car",
        "heat pump",
    ],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("fjordlabs/google-trends").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 '{
  "keywords": [
    "electric car",
    "heat pump"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call fjordlabs/google-trends --silent --output-dataset

```

## MCP server setup

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

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/JnIecZzBLOyRHQQLw/builds/CSVjRePxpxhz2fSWt/openapi.json
