# Google Trends Scraper: Interest Over Time & Related Queries (`mosaicked_sponge/google-trends-scraper-reliable`) Actor

Google Trends scraper and API. Get interest over time, interest by region and city, top and rising related queries and topics, up to 5-keyword comparisons and Trending Now searches for any country and time range. Failed keywords are free.

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

## Pricing

from $2.25 / 1,000 trends 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: Interest Over Time & Related Queries

Get **Google Trends data as clean JSON, CSV or Excel**: interest over time, interest by country / state / city / metro, **top and rising related queries** (incl. Breakout), related topics, **comparisons of up to 5 keywords** on one scale, any **country, time range, category** and **Web / News / Images / YouTube / Shopping** search, plus **Trending Now** (daily trending searches with search volume and news links).

![Google Trends Scraper: Interest Over Time & Related Queries - sample output](https://api.apify.com/v2/key-value-stores/QpfrAb6wndEDB0tDd/records/output-roVItXJ47vFJGgr7C.png)

Built for one thing above all: **it finishes, every time.** No endless runs, no 20-minute waits with an empty dataset. If Google rate-limits a keyword, the scraper slows down, rests the connection, retries from a fresh IP, and if it still can't get the data in time you get a **free row that says why**, never a hung run or a charge for nothing.

### Why switch

| | **This scraper** | apify/google-trends-scraper |
|---|---|---|
| Price | **$2.25 per 1,000 results** (one keyword = one result) | $3.00 per 1,000 results (Free plan) |
| Platform usage (compute, proxy) | **Included in the price** | Paid by you on top |
| Failed / no-data keywords | **Free** row with the reason | Runs often time out or abort |
| Hard time limit per keyword | **Yes** (default 120 s, then a free error row) | Recent reviews: "ran for 20 minutes didn't return anything" |
| Interest over time + summary stats | Yes, plus **average, peak, peak date, latest value, change %** | Timeline + averages |
| Interest by region | Country, region/state, **city, US metro (DMA)**, low-volume regions | Subregion, city |
| Related queries (top + rising) | Yes, with **Breakout flag** and a **"contains your keyword" flag** to filter spam | Yes |
| Related topics (top + rising) | Yes (when Google provides them) | Yes |
| Compare up to 5 keywords on one scale | **Yes** ("coffee, tea, matcha") | Yes ("Multiple terms" option) |
| Search type | **Web, News, Images, YouTube, Shopping** as a simple dropdown | Only via pasted URLs |
| Trending Now (daily trends) | **Yes**, any country | No (separate actor) |
| Paste Google Trends URLs | Yes | Yes |
| Spreadsheet-friendly flat layout | **Yes** (one row per date / region / query) | Nested only |
| Respects your max cost per run | **Yes**, and tells you if the cap is below one result | Yes |

Last 30 days on the Apify Store, the leading Trends scraper finished successfully in only about 56% of runs (thousands timed out or were aborted). This one is designed so a run **always ends** with data or an honest explanation.

### Pricing

Pay per result: **$0.00225 per keyword result** ($2.25 per 1,000), plus a tiny $0.00005 start fee per run.

- One keyword = one result, with **all** its data: the full timeline, regions, related queries and topics.
- A 5-keyword comparison = 5 results.
- One Trending Now search = one result.
- **Free:** keywords with no data, invalid input, rate-limited or timed-out keywords, and every detail row in the flat layout.
- Platform usage is included. You pay only the price above.

Example: tracking 200 keywords every week costs about **$1.80 a month**.

### How to use

1. Type your keywords, one per line. Put several on one line separated by commas to compare them.
2. Pick a location (empty = worldwide), time range, category and search type.
3. Click **Start**. A single keyword usually takes 5 to 15 seconds.

#### Input examples

One keyword, US, last 12 months (the default):

```json
{ "searchTerms": ["web scraping"], "geo": "US" }
```

Compare 3 drinks worldwide over 5 years, YouTube searches, flat rows for Excel:

```json
{
  "searchTerms": ["coffee, tea, matcha"],
  "timeRange": "today 5-y",
  "searchProperty": "youtube",
  "outputLayout": "flat"
}
```

City-level interest in a custom date range, category Food & Drink (71):

```json
{
  "searchTerms": ["pizza", "tacos"],
  "geo": "US-NY",
  "customTimeRange": "2024-01-01 2025-12-31",
  "category": 71,
  "regionResolution": "CITY"
}
```

What is trending right now in the US, UK and India:

```json
{ "searchTerms": [], "trendingNowGeos": ["US", "GB", "IN"] }
```

Google Trends URLs work too (their own geo, date, category and search type are used):

```json
{ "startUrls": [{ "url": "https://trends.google.com/trends/explore?q=bitcoin&geo=GB&date=today%205-y&gprop=youtube" }] }
```

#### Time ranges

`now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all` (2004 to now), or a custom range `YYYY-MM-DD YYYY-MM-DD`.

### Output

One row per keyword (default layout):

```json
{
  "searchTerm": "air fryer",
  "status": "ok",
  "geo": "US",
  "timeRange": "today 12-m",
  "timeRangeResolved": "2025-10-20 2026-10-20",
  "resolution": "WEEK",
  "averageInterest": 64.92,
  "peakInterest": 100,
  "peakDate": "2026-04-12",
  "latestInterest": 53,
  "latestDate": "2026-10-11",
  "interestChangePercent": -5.1,
  "interestOverTime": [ { "date": "2025-10-19", "value": 52, "isPartial": false }, "..." ],
  "interestByRegion": [ { "geoCode": "US-WV", "geoName": "West Virginia", "value": 100 }, "..." ],
  "relatedQueriesTop": [ { "query": "air fryer chicken", "value": 100, "containsSearchTerm": true, "relevance": "term" }, "..." ],
  "relatedQueriesRising": [ { "query": "ninja crispi pro air fryer", "value": 4250, "formattedValue": "Breakout", "isBreakout": true, "relevance": "term" }, "..." ],
  "relatedQueriesRemovedCount": 7,
  "relatedQueriesRemoved": [ { "query": "noise cancelling headphones", "list": "rising", "value": 5000, "formattedValue": "Breakout" }, "..." ],
  "relatedTopicsTop": [], "relatedTopicsRising": [],
  "trendsUrl": "https://trends.google.com/trends/explore?q=air+fryer&date=today+12-m&geo=US"
}
```

Free explanation row (not charged):

```json
{ "searchTerm": "qzxvplmkq wwtrbbn", "status": "no_data",
  "error": "Google Trends has not enough search volume for this term with these settings (all zeros). Free row. ..." }
```

Trending Now row:

```json
{ "recordType": "trendingNow", "geo": "US", "rank": 1, "title": "lebron james", "approxTraffic": "5000+",
  "approxTrafficNumber": 5000, "startedAt": "2026-10-20T23:00:00Z",
  "newsItems": [ { "title": "...", "url": "https://...", "source": "Yahoo Sports" } ] }
```

The **flat layout** writes one `summary` row per keyword (charged) followed by free detail rows with `recordType` = `interestOverTime`, `interestByRegion`, `relatedQueryTop`, `relatedQueryRising`, `relatedTopicTop` or `relatedTopicRising`, ready for Excel, Google Sheets, Looker Studio or a database.

A run summary (counts, retries, settings) is saved in the key-value store as `OUTPUT`.

### Good to know

- **Values are relative (0-100)**, exactly like trends.google.com. 100 is the peak for the chosen keyword(s), place and time. Compare keywords on one line to put them on the same scale.
- Google samples its data, so a value can differ by about one point between two requests. That is normal and happens on the website too.
- **Related topics:** Google currently returns an empty topics list for many searches (also on its own website) and never shows topics for comparisons. When that happens, the topics fields are empty lists and you are still charged only once for the keyword.
- **Spam filter for related queries (on by default).** Google Trends itself, also on trends.google.com, mixes a shared pool of unrelated "Breakout" queries (for example "how to cook pasta" or "learn golang" under "electric cars") into many keywords' related queries. By default we remove queries with no connection to your keyword and list them in `relatedQueriesRemoved` (with `relatedQueriesRemovedCount`), so nothing is hidden. Each kept query has `relevance`: `term` (contains your keyword), `topic` (shares a word with your keyword's related searches, e.g. "toyota" for "electric cars") or `popular` (strong volume in Google's top list). Set `relatedQueriesMode` to `raw` to get Google's lists unchanged, with every query labelled, including `off_topic`. The filter is a heuristic: a few genuine but unusual rising queries (for example a person's name) can land in `relatedQueriesRemoved`.
- **Rate limits:** Google limits how fast anyone can query Trends. This scraper paces its requests, backs off when Google says "too many requests", rests that connection and retries from a fresh Apify datacenter IP, and retries rate-limited keywords once more at the end of the run. It does not solve CAPTCHAs or disguise itself. For very large batches, schedule several smaller runs.
- **Location codes:** `US`, `GB`, `DE`, states like `US-CA`, metros like `US-NY-501`. Empty = worldwide.
- **Time zone:** `timezoneOffsetMinutes` works like Google's `tz` parameter: minutes behind UTC (300 = New York in winter).

### FAQ

**Is scraping Google Trends legal?** This actor reads publicly available, aggregated, non-personal Trends statistics through Google's normal public endpoints, at a polite pace. You are responsible for how you use the data and for complying with Google's terms in your jurisdiction.

**Can I use it through the API, Make, Zapier or n8n?** Yes. Any Apify integration works, and the input is plain JSON.

**Something looks wrong?** Open an issue on the Issues tab with the run link. We answer fast.

# Actor input Schema

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

One search per line. Put up to 5 terms on one line separated by commas (e.g. "coffee, tea, matcha") to COMPARE them on one 0-100 scale, exactly like Compare on trends.google.com. Topic IDs like /m/07ykbs work too. You can also paste Google Trends explore URLs here.

## `startUrls` (type: `array`):

Paste trends.google.com/trends/explore links. Their own q, geo, date, cat and gprop settings are used.

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

Google Trends location code: US, GB, DE, US-CA (state), US-NY-501 (metro). Leave empty for Worldwide.

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

Same presets as trends.google.com.

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

Overrides Time range. Format "YYYY-MM-DD YYYY-MM-DD" (e.g. "2020-01-01 2024-12-31"), or hourly "YYYY-MM-DDTHH YYYY-MM-DDTHH" for up to 7 days.

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

Google Trends category id. 0 = All categories. Examples: 71 Food & Drink, 5 Computers & Electronics, 7 Finance, 18 Shopping, 3 Arts & Entertainment, 174 Sports, 47 Autos, 45 Health.

## `searchProperty` (type: `string`):

Which Google search to measure.

## `includeInterestOverTime` (type: `boolean`):

Full timeline (0-100) plus average, peak, latest and change %. Summary numbers are always included.

## `includeInterestByRegion` (type: `boolean`):

Countries (worldwide), states/regions (in a country) or cities, see Region resolution.

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

Level of detail for Interest by region.

## `includeLowVolumeRegions` (type: `boolean`):

Same as the "Include low search volume regions" box on trends.google.com.

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

Top and rising (incl. Breakout) related searches.

## `relatedQueriesMode` (type: `string`):

Google Trends (also on trends.google.com) mixes unrelated 'Breakout' queries such as 'how to cook pasta' or 'learn golang' into many keywords' related queries. 'Relevant only' removes queries with no connection to your keyword and lists them in relatedQueriesRemoved, so nothing is hidden. 'Raw' keeps Google's lists unchanged and labels every query with relevance (term / topic / popular / off_topic).

## `includeRelatedTopics` (type: `boolean`):

Top and rising related topics, when Google provides them (Google does not show topics for comparisons).

## `trendingNowGeos` (type: `array`):

Also fetch what is trending right now (daily search trends with approximate search volume and news links) for these country codes, e.g. US, GB, IN. One result per trending search.

## `outputLayout` (type: `string`):

Flat layout writes a summary row per keyword plus one row per date / region / related query, ideal for Excel, Sheets and BI tools. Billing is identical: one result per keyword.

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

Interface language for region and topic names, e.g. en-US, de, es, pt-BR.

## `timezoneOffsetMinutes` (type: `integer`):

Same as Google's tz parameter: minutes BEHIND UTC. 0 = UTC, 300 = New York (EST), 240 = New York (EDT), -60 = Berlin (CET).

## `maxSecondsPerKeyword` (type: `integer`):

If Google keeps rate-limiting a search, we slow down and retry up to this long (plus one shorter retry at the end of the run), then return a free error row instead of hanging.

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

Apify datacenter proxy is used to retry from a fresh IP when Google says "too many requests". Residential is not needed.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "coffee, tea, matcha"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "searchProperty": "web",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "relatedQueriesMode": "relevant",
  "includeRelatedTopics": true,
  "outputLayout": "keyword",
  "language": "en-US",
  "timezoneOffsetMinutes": 0,
  "maxSecondsPerKeyword": 120,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per keyword (or per Trending Now search), plus free rows explaining any keyword that had no data or failed.

## `summary` (type: `string`):

OUTPUT record: counts, status per type, network retries.

# 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": [
        "web scraping"
    ],
    "geo": "US",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mosaicked_sponge/google-trends-scraper-reliable").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": ["web scraping"],
    "geo": "US",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("mosaicked_sponge/google-trends-scraper-reliable").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": [
    "web scraping"
  ],
  "geo": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call mosaicked_sponge/google-trends-scraper-reliable --silent --output-dataset

```

## MCP server setup

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

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/roVItXJ47vFJGgr7C/builds/CeWdoeGAbVAXiQTIe/openapi.json
