# Google Trends Scraper – Fast, Reliable, No Timeouts (`refillflows/google-trends`) Actor

Scrape Google Trends interest over time, interest by region and related queries for any keyword, country and time range. No official API key. Retries automatically and falls back to residential proxies if Google rate-limits. Export CSV or call from Python.

- **URL**: https://apify.com/refillflows/google-trends.md
- **Developed by:** [Refill Flows](https://apify.com/refillflows) (community)
- **Categories:** SEO tools, Automation, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 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

Scrape **Google Trends** interest over time, interest by region and related queries for any keyword, country and time range. The **Google Trends Scraper** talks to Google's public Trends endpoints directly: **no official API key, no browser, no login**. It retries automatically with backoff, and in the default **auto** mode it falls back to residential proxies if Google rate-limits the request.

Try it with the prefilled input (`coffee` in the US, past 12 months), or call it from Python, JavaScript, Make, Zapier, n8n or the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### What can this Google Trends Scraper do?

- 📈 **Interest over time** on Google's 0–100 scale, for windows from the past hour to 2004–present.
- 🌍 **Interest by region** — US states, countries worldwide, or the sub-regions Google returns for your geo.
- 🔎 **Related queries**, both top and rising (including Breakout).
- 📺 **Web, YouTube, News, Images or Shopping** search.
- 🗺️ **Any country or sub-region** (`US`, `GB`, `IN`, `US-CA`) or worldwide.
- 🛡️ **Retries with backoff** and a **platform-IP-first / residential fallback**, so a 429 does not fail the whole run.
- 📦 **One clean row per keyword**, ready to export as JSON, CSV or Excel.

**Related topics are not available.** Google does not return them to automated (logged-out) sessions. Interest over time, regions and related queries come back as they do on the website.

### How to scrape Google Trends

1. Open the [Google Trends Scraper](https://apify.com/refillflows/google-trends) and click **Try for free**.
2. Enter one or more **Search terms** (for example `coffee` or `chatgpt`). Leave **Region** as `US` and **Time range** as Past 12 months, or change them.
3. Click **Start**. When the run finishes, open the **Dataset** tab and export **CSV**, Excel or JSON, or pull the results through the Apify API.

The prefilled run (`coffee`, US, past 12 months) typically finishes in under 15 seconds.

### How much does it cost?

You only pay for keyword reports you actually get. Failed queries are not charged. Apify platform usage is included in the price. There is no start fee.

| Event | Price |
|---|---|
| Keyword result | **$1.50 per 1,000 results** |

So 1,000 keywords cost $1.50, and a single term costs $0.0015. Apify's free plan includes $5 of monthly credit, which covers about 3,300 keyword reports. Set a run cost limit in the run options if you want a hard cap.

### Input

| Field | What it does |
|---|---|
| `searchTerms` | Keywords to look up. Each term gets its own 0–100 scale. |
| `geo` | Country code (`US`, `GB`, `IN`) or sub-region (`US-CA`). Empty for worldwide. |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, or `all`. You can also pass a custom `YYYY-MM-DD YYYY-MM-DD` window. |
| `property` | `web` (default), `youtube`, `news`, `images`, or `shopping`. |
| `includeRegions` | Regional breakdown (on by default). |
| `includeRelated` | Top and rising related queries (on by default). |
| `queries` | Optional advanced mode: a list of `{ keyword, geo, time, property }` so each term can have its own region and window. If set, it replaces `searchTerms`. |
| `proxyMode` | `auto` (default), `none`, or `residential`. |
| `delayMs`, `maxRetries` | Pacing and retry limits. The defaults work for most batches. |

Example: compare a few terms in the United States over the past year:

```json
{
  "searchTerms": ["coffee", "tea", "matcha"],
  "geo": "US",
  "timeRange": "today 12-m"
}
```

Advanced example, one term per country:

```json
{
  "queries": [
    { "keyword": "cricket", "geo": "IN", "time": "today 12-m" },
    { "keyword": "football", "geo": "GB", "time": "today 12-m" },
    { "keyword": "futebol", "geo": "BR", "time": "today 5-y" }
  ]
}
```

### Output

Each search term is one dataset row. A real example, shortened:

```json
{
  "keyword": "coffee",
  "geo": "US",
  "time": "today 12-m",
  "property": "web",
  "category": 0,
  "ok": true,
  "noData": false,
  "interestOverTime": [
    { "time": "1762646400", "formattedTime": "Nov 9–15, 2025", "value": 73, "hasData": true }
  ],
  "interestByRegion": [
    { "geoCode": "US-WY", "geoName": "Wyoming", "value": 100 }
  ],
  "relatedQueries": {
    "top": [{ "query": "coffee near me", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "turkish coffee", "value": 150, "formattedValue": "+150%" }]
  },
  "pointCount": 53,
  "regionCount": 51,
  "relatedTopCount": 25,
  "relatedRisingCount": 25,
  "scrapedAt": "2026-11-12T10:00:00.000Z",
  "attempts": 1,
  "usedProxy": "platform",
  "error": null,
  "errorCode": null
}
```

Run-level totals are saved to the key-value store as `STATS` (success count, failures, whether residential fallback was used). Failed queries still appear as a row with `ok: false` and a clear `error` message, and are not billed.

### How to scrape Google Trends with Python or the API

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("refillflows/google-trends").call(run_input={
    "searchTerms": ["coffee", "chatgpt"],
    "geo": "US",
    "timeRange": "today 12-m",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    latest = (row.get("interestOverTime") or [None])[-1]
    print(row["keyword"], "latest interest:", None if not latest else latest["value"])
```

Or, with `curl`, start a run and then download the dataset as CSV from `https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=csv`. You can also schedule the Actor daily in Apify Console and send new rows to Google Sheets, Slack or a webhook.

### Tips

- Google Trends values are **relative**, not search volumes. A score of 100 is the peak of that term (or comparison) in that window, not an absolute count.
- Very rare terms often return `ok: true` and `noData: true`, with an empty time series. You are still charged, because the request completed and the row is useful.
- For large batches (hundreds of terms), keep `delayMs` at the default or raise it slightly. The Actor already retries 429s and will switch to residential proxies in `auto` mode.
- Related topics are intentionally omitted. Signing in to a Google account to fetch them is out of scope for this Actor.

### FAQ

#### Is there an official Google Trends API?

Google has announced a Trends API, but it is still invite-only. This Actor is a public alternative: it reads the same charts the Trends website shows, with no API key or waitlist.

#### Why not 100% of runs on Google's own Actors?

Google rate-limits aggressively, especially from datacenter IPs. This Actor starts from the Apify platform IP (fast and cheap) and, if a request is rate-limited or times out, retries automatically and falls back to residential proxies for the rest of the run.

#### Can I export Google Trends data to CSV?

Yes. After a run, open the **Dataset** tab and click **Export** → **CSV** (or Excel). From code, request the dataset with `?format=csv`. Each keyword is one row. Time series, regions and related queries are JSON columns in the CSV.

#### Do you return related topics?

No. Google labels automated sessions as scrapers and withholds related topics. Related **queries**, interest over time and interest by region are returned. If you only need topics, a logged-in browser session is currently the only way, and this Actor does not sign in to Google.

#### Who is this for?

SEO and content teams tracking keyword seasonality, market researchers comparing interest by country, journalists watching a story week to week, and developers or AI agents that need a structured Trends feed without managing proxies.

### Other tools by Refill Flows

- [Luma Events Scraper](https://apify.com/refillflows/luma-events-scraper) — public Luma events by city, category or calendar.
- [Shopify App Store Scraper](https://apify.com/refillflows/shopify-app-store-scraper) — app rankings, pricing plans and merchant reviews.
- [Bulk Lighthouse Audit](https://apify.com/refillflows/bulk-lighthouse-audit) — Lighthouse and Core Web Vitals for many URLs, no API key.

### Want this run for you every week?

If you'd rather not run it yourself, Refill Flows can run it on a schedule and deliver trend data for your keyword list to a Google Sheet or CSV every week, cleaned and de-duplicated. Done-for-you plans start at $150/month. Open an issue on the **Issues** tab titled "Done-for-you", or email g55g6npm@mail.grokbot.com with what you need.

### Support

Found a bug or missing field? Open an issue on the Actor's **Issues** tab and we'll fix it quickly. Maintained by [Refill Flows](https://apify.com/refillflows).

# Actor input Schema

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

Keywords to look up on Google Trends. Each term is queried on its own 0–100 scale. Use Advanced queries instead if you need a different country or time range per term.

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

ISO country code (US, GB, IN) or a sub-region such as US-CA. Leave empty for worldwide.

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

Google Trends window. Use a preset, or a custom range such as "2024-01-01 2024-12-31".

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

Which Google property to read. Shopping is Google's froogle property.

## `includeRegions` (type: `boolean`):

Add a regional breakdown (US states, countries, or the sub-regions Google returns for the selected geo).

## `includeRelated` (type: `boolean`):

Add Google's top and rising related queries for each term. Related topics are not available (Google does not return them to automated sessions).

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

If you set this, it is used instead of Search terms. Each item can have its own keyword, geo, time and property. Example: \[{"keyword": "coffee", "geo": "US", "time": "today 12-m"}].

## `proxyMode` (type: `string`):

auto (recommended): use the Apify platform IP first, and fall back to residential proxies if Google rate-limits. none: platform IP only. residential: always use residential proxies.

## `delayMs` (type: `integer`):

Pause between successful queries on the same session. Increase this if you hit rate limits on very large batches.

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

On HTTP 429, timeouts or network errors, rotate the session and retry this many times (with backoff). In auto mode, retries after the first failure use a residential proxy.

## Actor input object example

```json
{
  "searchTerms": [
    "coffee"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "property": "",
  "includeRegions": true,
  "includeRelated": true,
  "proxyMode": "auto",
  "delayMs": 400,
  "maxRetries": 3
}
```

# Actor output Schema

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

One dataset item per search term.

## `stats` (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": [
        "coffee"
    ],
    "geo": "US",
    "timeRange": "today 12-m",
    "property": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("refillflows/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 = {
    "searchTerms": ["coffee"],
    "geo": "US",
    "timeRange": "today 12-m",
    "property": "",
}

# Run the Actor and wait for it to finish
run = client.actor("refillflows/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 '{
  "searchTerms": [
    "coffee"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "property": ""
}' |
apify call refillflows/google-trends --silent --output-dataset

```

## MCP server setup

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