# Google Trends API & Scraper — pytrends alternative (`insanedev/google-trends-scraper`) Actor

Google Trends API & pytrends alternative: bulk Google Trends data for any keyword list — interest over time, regions, related queries & topics, CSV or JSON. 50 terms on one scale, daily historical data for years. Works from AI agents via MCP.

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

## Pricing

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

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 API & Scraper** gets [Google Trends](https://trends.google.com/trends/explore) data for **any list of search terms in seconds**: interest over time, interest by country, state, metro area and city, related queries and related topics. Compare **any number of terms on one scale** (Google stops at 5), get **daily data for years**, fetch many regions in one run, and export to JSON, CSV or Excel — or call it from your code, Make, Zapier, n8n or an AI agent.

- ✅ **Reliable** — **99.9–100%** of queries returned complete data in our latest 1,000-query tests (200 terms × 5 countries); no browser, no timeouts.
- ⚡ **Fast** — 1,000 queries with timeline, regions and related queries in about 16 minutes with 3 samples each (about 10 minutes with 1 sample), on 256 MB of memory.
- 💸 **You only pay for data you get** — failed requests and terms without data are free.
- 🎯 **More accurate** — every timeline is the median of 3 independent samples, **3× closer** to Google's consensus value than a single request (see below).
- 📊 **Beyond Google's limits** — **up to 50 terms on one 0–100 scale** and **daily data for any period**, both checked against Google's own numbers (see below).
- 🧹 **Cleaner data** — we flag the generic filler queries Google mixes into anonymous results (see below).
- 🔁 **Drop-in replacement** for Apify's *Google Trends Scraper*: same input fields, same output fields, plus more.

### What data can you get from Google Trends?

| Data type | What you get | Billed as |
|---|---|---|
| Interest over time | 0–100 index per week/day/hour, averages, peak, trend direction, seasonality | 1 result |
| Daily data for long periods (optional) | One daily series for any period (e.g. 5 years), stitched from ≤ 269-day windows | 1 result per window (5 years ≈ 7) |
| Interest by subregion | States/provinces of a country, or countries for Worldwide (metro areas for a US state) | 1 result |
| Interest by metro area (US) | 210 US metro areas (DMA) | 1 result |
| Interest by city | Cities Google has data for (popular terms only) | 1 result |
| Related queries | Top and rising queries, with Breakout flags and filler flags | 1 result |
| Related topics | Top and rising topics (best effort — see FAQ) | 1 result, only when returned |

Every row also has a plain-text `summaryText`, `metrics` (average, peak, change, direction, seasonality) and `dataBreaks` (dates where Google changed how it collects data).

### Why use this Google Trends API?

| | This Actor | Typical Google Trends scraper |
|---|---|---|
| Success rate | 99.9–100% of queries complete in our latest 1,000-query tests | often 60–90%; runs that time out |
| Accuracy | median of 3 independent samples per timeline | single request (1 in 5 differs from Google's consensus) |
| Speed | seconds per term, 256 MB | minutes per run, 4 GB browser |
| Many terms per run | ✅ any list, many regions per run | often 1 term per run |
| More than 5 terms on one scale | ✅ up to 50 per comparison | ❌ Google's limit is 5 |
| Daily data for years | ✅ stitched and calibrated | ❌ weekly or monthly only |
| Related queries | ✅ with Breakout and filler flags | often empty or unfiltered |
| Related topics | ✅ best effort, only billed when returned | usually empty |
| Metro areas (DMA) & cities | ✅ | often missing or zeros |
| Trend direction, seasonality, data breaks | ✅ | ❌ |
| Topic search (`/m/…` ids) | ✅ | rarely |
| You pay for failures | ❌ never | often yes |

### How to use Google Trends API & Scraper

1. Enter your **search terms** (one per line) or paste **Google Trends URLs** from your browser.
2. Choose a **region**, a **time range** and the **data to collect**. Add more regions under *More regions* if you want each term for several countries.
3. Click **Start** and download the results as JSON, CSV or Excel — or get them via the API.

#### Input examples

Bulk keywords, default data, United States, past 12 months:

```json
{ "searchTerms": ["air fryer", "standing desk", "electric bike"], "geo": "US" }
```

Compare terms on one scale (like the *Compare* button on Google Trends), 5 years, several countries:

```json
{
    "searchTerms": ["python, javascript, rust"],
    "isMultiple": true,
    "timeRange": "today 5-y",
    "geo": "US",
    "geos": ["DE", "IN"]
}
```

Compare **12 terms on one scale** — more than Google allows (see *How can you compare more than 5 terms on one scale?*):

```json
{
    "searchTerms": ["google, weather, coffee, yoga, pickleball, kubernetes, sourdough starter, matcha latte, rust programming, python, netflix, tiktok"],
    "isMultiple": true,
    "timeRange": "today 5-y",
    "geo": "US"
}
```

**Daily** interest over the past 5 years (Google itself gives weekly points for this period):

```json
{
    "searchTerms": ["coffee, bitcoin"],
    "isMultiple": true,
    "timeRange": "today 5-y",
    "geo": "US",
    "dailyData": true,
    "includeInterestBySubregion": false,
    "includeRelatedQueries": false
}
```

Paste Google Trends URLs, get flat rows for Excel, only the timeline:

```json
{
    "startUrls": [{ "url": "https://trends.google.com/trends/explore?date=today%203-m&geo=GB&q=sourdough" }],
    "includeInterestBySubregion": false,
    "includeRelatedQueries": false,
    "outputFormat": "flat"
}
```

Search a **topic** instead of a word (language-independent and unambiguous — `/m/05z1_` is Python the programming language, not the snake):

```json
{ "searchTerms": ["/m/05z1_"], "geo": "US", "timeRange": "today 5-y" }
```

### Output example

One row per term and region (`outputFormat: "nested"`, trimmed):

```json
{
    "searchTerm": "stock market",
    "geo": "US",
    "timeRange": "today 5-y",
    "status": "ok",
    "summaryText": "\"stock market\" (US, today 5-y): average interest 16.5/100, peak 100 on 2025-04-06; trend rising (+25.4%); seasonal peak in March, low in September; rising: yahoo finance stock market live, quotes, business & finance news (Breakout), meta stock (Breakout).",
    "metrics": {
        "average": 16.5,
        "peakValue": 100,
        "peakDate": "2025-04-06T00:00:00.000Z",
        "changePercent": 25.4,
        "direction": "rising",
        "seasonality": { "peakMonth": "March", "lowMonth": "September", "strengthPercent": 55.6 },
        "hasDataRatio": 1
    },
    "interestOverTime_timelineData": [
        { "time": "1632614400", "formattedTime": "Sep 26 – Oct 2, 2021", "value": [15], "hasData": [true] }
    ],
    "interestBySubregion": [{ "geoCode": "US-WY", "geoName": "Wyoming", "value": [100] }],
    "relatedQueries_rising": [
        { "query": "meta stock", "formattedValue": "Breakout", "isBreakout": true, "likelyNoise": false },
        { "query": "best laptops 2025", "formattedValue": "Breakout", "isBreakout": true, "likelyNoise": true }
    ],
    "relatedQueriesNoiseShare": 0.2,
    "dataBreaks": [{ "date": "2021-12-26T00:00:00.000Z", "note": "An improvement to our data collection system was applied from 1/1/22." }],
    "billedResults": 3
}
```

Besides the full `metrics` object, every row has flat copies for tables and spreadsheets — `term`, `average`, `peakValue`, `peakDate`, `latestValue`, `changePercent`, `direction`, `seasonalPeakMonth` — and `regions` (subregions, or countries for Worldwide). In a comparison, each term's data is in `byTerm`, and the **Output** tables show one row per compared term.

With `outputFormat: "flat"` you get one row per data point — `term`, `geo`, `dataType`, `date`, `value`, `geoName`, `query`, `topicTitle`, `rank` — ready for a spreadsheet or a pivot table. The **Output** tab also has ready-made tables: overview, interest over time, rising and top queries, regions and topics.

### Why are our numbers more accurate?

Google Trends is computed from a **random sample** of searches, so the same request can return slightly different numbers. In our test of 20 popular terms × 5 independent requests, **13 terms came back in 2–3 different versions**, and 1 in 5 single requests did not match the most common version — by up to 8 points. In a 1,000-query run, the 3 samples disagreed somewhere on **36% of timelines**.

Every other tool we tested makes a single request. We fetch each timeline from **3 independent IP addresses** and return the per-point median, plus a `samplingSpread` field that tells you how noisy Google's data is for that term:

| Compared with the median of 5 samples | Single request | This Actor (median of 3) |
|---|---|---|
| Average error per point | 0.25 | **0.08** |
| Timelines with at least one wrong point | 24% | **9%** |

You can set *Samples per term* from 1 (fastest) to 10 (research-grade). The price per result stays the same.

### How can you compare more than 5 terms on one scale?

Google Trends compares at most 5 terms at once, and every comparison has its own 0–100 scale — so "coffee" in one comparison and "tiktok" in another can't be compared. With **Compare terms** on, you can enter up to 50 terms in one line. The Actor then:

1. fetches the first 5 terms and picks the one with **medium popularity as the anchor**;
2. fetches the other terms in groups of 4 together with the anchor, and rescales each group through the anchor;
3. re-measures terms that came out too small to be precise (Google rounds to whole numbers, so a term at 0–2 next to "google" is mostly rounding) **next to a term of similar popularity** — a "ladder", like the G-TAB method used by researchers.

Values keep 3 significant digits, so a tiny term shows as `0.0633` instead of `0`. The row's `normalization` field names the anchor, the number of comparisons used and any term that is still imprecise.

We checked it against Google's own 2-term comparisons (12 terms, US, 5 years, 28 September 2026):

| Pair (from different groups) | Google, compared directly | This Actor, one 12-term scale | Difference |
|---|---|---|---|
| pickleball / sourdough starter | 4.33 | 4.34 | +0.1% |
| coffee / python | 3.63 | 3.59 | −0.8% |
| google / netflix | 5.54 | 5.61 | +1.3% |
| weather / tiktok | 10.8 | 10.2 | −5.3%\* |
| kubernetes / python | 0.063 | 0.058 | −6.8%\* |

\* Google's direct numbers are themselves rounded: tiktok = 5 and kubernetes = 4 carry ±10% rounding error. Terms shared between comparisons are billed once: a 12-term comparison is 12 results per data type.

### Google Trends historical data: daily data for years

Google Trends historical data goes back to 2004, but Google gives daily points only for periods of up to about 9 months (269 days); longer periods come as weekly or monthly points. With **Daily data for long periods** on, the Actor also fetches the period in daily windows of up to 269 days and scales every window so that its weekly means match Google's weekly series for the whole period. Each window is calibrated on its own, so errors don't add up over the years. The row's `stitching` field lists the windows.

We checked the seams against Google's own daily data (coffee and bitcoin, US, 5 years stitched from 7 windows, compared with direct 269-day requests across two seams):

| | Result |
|---|---|
| Correlation with Google's direct daily data | 0.987 – 1.000 |
| Average difference per day | 0.14 – 0.93 points (on 0–100) |
| Level change across a seam, stitched vs. direct | within 0.5% |

Every window is a separate Google request, so daily interest over time is billed as **one result per window and term** (5 years ≈ 7 results per term).

### How does it compare with other Google Trends Actors?

We ran the same job — 8 terms, United States, past 12 months, timeline + regions + related queries — through the most popular Google Trends Actors on Apify Store on 28 September 2026:

| | This Actor | Other Actors tested |
|---|---|---|
| Time | **12 seconds** (3 samples per term) | 30 seconds – 21 minutes (one did not finish 8 terms in 21 min) |
| Price paid for the job | **$0.07** | $0.17 – $1.54 (one charged $1.54 for a single term) |
| All 8 terms in one run | ✅ | one needed 8 separate runs; one stops at 5 terms |
| Related topics | best effort | none returned any |
| Filler queries flagged | ✅ | ❌ (e.g. "gardening ideas" returned as a Breakout for "stock market") |
| Memory | 69 MB | 70 MB – 2 GB |

### What are "filler" queries and why do we flag them?

Google Trends shows anonymous visitors (every scraper and every logged-out browser) related queries that sometimes include **generic queries unrelated to your term**. In our tests, 20–76% of the rising queries for terms like "stock market", "coffee" or "yoga" were fillers such as *"pet care tips"*, *"gardening ideas"* or *"top songs this week"*. Other tools pass them on as real data.

Some fillers even show up as "Breakout" — for "stock market" we saw *"best laptops 2025"* marked as a Breakout. We keep Google's lists exactly as returned, but mark each known filler with `likelyNoise: true` and report the share in `relatedQueriesNoiseShare`. Filter them out in one line — or keep them, your choice. A query that shares a word with your term is never flagged.

### How much does Google Trends data cost?

You pay **per result**: one search term × one data type that Google returned data for. Errors and empty results are free, there is no subscription and no minimum.

| Your Apify plan | Price per 1,000 results | Default data (3 types) per 1,000 terms |
|---|---|---|
| Free / Starter | $3.00 | $9.00 |
| Scale | $2.50 | $7.50 |
| Business, Enterprise | $2.00 | $6.00 |

Examples on the Free plan: 1 term, timeline only = **$0.003**; 20 terms with default data = **$0.18**; 100 terms × 3 countries, timeline only = **$0.90**; 12 terms on one scale, timeline only = **$0.036**; 1 term, daily data for 5 years = **$0.021**. There is no start fee and no platform usage on top — the price per result is all you pay. New Apify accounts get free monthly platform credit you can use to try it.

### Migrating from Apify's Google Trends Scraper

Keep your integration and change only the Actor ID to `insanedev/google-trends-scraper`. These input fields work the same: `searchTerms`, `isMultiple`, `timeRange`, `customTimeRange`, `geo`, `category`, `startUrls`, `maxItems`, `viewedFrom`. The output keeps the same field names (`searchTerm`, `inputUrlOrTerm`, `interestOverTime_timelineData`, `interestOverTime_averages`, `interestBySubregion`, `interestBy`, `interestByCity`, `relatedQueries_top`, `relatedQueries_rising`, `relatedTopics_top`, `relatedTopics_rising`) and adds new ones next to them.

### Google Trends Python API — pytrends alternative

A Google Trends Python API without pytrends: `pytrends` is archived and blocked by Google's rate limits (HTTP 429). This Actor handles proxies, retries and parsing for you:

| pytrends | This Actor |
|---|---|
| `build_payload(kw_list, timeframe, geo, cat, gprop)` | `searchTerms` (+ `isMultiple` for a comparison), `timeRange` / `customTimeRange`, `geo`, `category`, `property` |
| `interest_over_time()` | `interestOverTime_timelineData` (or `outputFormat: "flat"`) |
| `interest_by_region(resolution=...)` | `interestBySubregion`, `interestByMetro`, `interestByCity` |
| `related_queries()` / `related_topics()` | `relatedQueries_top/rising`, `relatedTopics_top/rising` |

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("insanedev/google-trends-scraper").call(
    run_input={"searchTerms": ["python", "javascript"], "geo": "US", "timeRange": "today 5-y"},
)
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["searchTerm"], row["metrics"]["direction"], row["metrics"]["seasonality"])
```

### Google Trends CSV export

Every run is a dataset you can download as **CSV, Excel, JSON or HTML** from the *Output* tab or the API (`…/items?format=csv`). For a Google Trends bulk download — hundreds of keywords into one sheet — set `outputFormat: "flat"`: one row per date, region or query with the columns `term`, `geo`, `dataType`, `date`, `value`, ready for Excel, Google Sheets or a pivot table.

### Integrations and API

- **API** — run the Actor and fetch results from any language ([Apify API](https://docs.apify.com/api/v2)), or use the *API* tab above for ready-made code.
- **Schedules** — track your terms daily or weekly; combine with webhooks to get notified when a run finishes.
- **Make, Zapier, n8n, Google Sheets, Slack** — via Apify integrations.
- **AI agents (MCP)** — use it as a tool through the [Apify MCP server](https://mcp.apify.com); `summaryText` gives agents a compact answer.

#### Google Trends MCP server for AI agents

Add `https://mcp.apify.com?tools=insanedev/google-trends-scraper` to Claude, Cursor or any MCP client and your agent can call Google Trends as a tool: it sends search terms and gets back interest over time, regions and related queries with a one-line `summaryText`.

### FAQ

#### Why do other tools get HTTP 429 from Google Trends?

Google limits how many requests one IP address can send. This Actor spreads requests over a pool of residential IP addresses, keeps a steady pace and retries on a new address when Google blocks one — so you don't have to manage proxies.

#### Why are related topics sometimes missing?

Google serves related topics to anonymous visitors only through its public embed widget, which has a quota that is often used up. When that happens, `relatedTopicsStatus` is `unavailable` and **you are not billed** for topics. Related topics are off by default.

#### Why don't the numbers match exactly what I see on Google Trends?

Google Trends is based on a random sample of searches, so the website and every API can show slightly different values from one request to the next — especially for less popular terms. This Actor combines 3 independent samples by default, which brings the values much closer to Google's most common answer (see *Why are our numbers more accurate?*). Logged-in users may also see slightly different data. Values are relative (0–100), not search counts.

#### Where can I get today's trending searches (Trending Now)?

Use our [Google Trends Trending Now API](https://apify.com/insanedev/google-trends-trending-now): every trending search for 125 countries and US states in one run, with search volume, growth, related searches and news, plus an "only new trends" mode for hourly alerts. Found a trend worth a closer look? Paste it here for its history, regions and related queries.

#### What is `dataBreaks`?

Google occasionally improves how it collects data (for example on 1 January 2022). Values before and after such a date are not fully comparable; `dataBreaks` tells you where that happens in your time range.

#### Is it legal to scrape Google Trends?

The Actor collects publicly available, aggregated and anonymous statistics from Google Trends without logging in. You are responsible for how you use the data; check the laws that apply to you and Google's terms. If you are unsure, consult a lawyer.

### Limitations

- Up to 50 terms per comparison line. Comparisons of more than 5 terms put interest over time on one scale; the combined region map (`interestBySubregion` of the whole comparison) is only available for up to 5 terms — each term still gets its own regions in `byTerm`.
- City data exists only for popular terms; metro areas are available for the United States.
- Google gives daily data for periods up to about 9 months and hourly for up to 7 days; longer daily series are stitched (*Daily data for long periods*, up to 5 terms per comparison).
- Related topics are best effort (see FAQ).

### Support

Found a bug or missing a feature? Open an issue on the **Issues** tab — we usually answer within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/insanedev/google-trends-scraper/changelog.md

# Actor input Schema

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

Words or phrases to look up in Google Trends, one per line. Each line is one result row per region. With **Compare terms** checked, separate terms with commas (for example `python, javascript`) to get them on one shared 0–100 scale, like the Compare button on Google Trends — and unlike Google, not limited to 5 terms (up to 50 per line).

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

Alternatively, paste Google Trends Explore URLs copied from your browser (for example `https://trends.google.com/trends/explore?q=python&geo=US`). The terms, region, time range, category and search type are read from the URL.

## `isMultiple` (type: `boolean`):

If checked, a comma inside a search term separates terms that are compared on one scale. Up to 5 terms are one Google comparison; for 6–50 terms the Actor chains several comparisons through a shared anchor term and puts all terms on one 0–100 scale (see `normalization` in the output). If unchecked, commas are part of the term.

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

Period to fetch (past 12 months by default). Pick a preset or type any Google Trends time expression, e.g. `today 2-y`, `now 4-H` or `2024-01-01 2024-06-30`. Google chooses the data frequency by the length of the period. Ignored when a custom time range is set.

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

Optional exact period in the format `YYYY-MM-DD YYYY-MM-DD`. Takes precedence over Time range. Periods shorter than about 9 months return daily data.

## `dailyData` (type: `boolean`):

Google Trends gives daily points only for periods up to about 9 months (269 days); longer periods come weekly or monthly. With this on, the Actor also fetches the period in daily windows of up to 269 days and stitches them into one daily series on a common 0–100 scale, calibrated on the weekly (or monthly) series of the whole period so errors don't add up. Applies to interest over time for up to 5 terms. **Billing:** interest over time counts as one result per window and term (5 years ≈ 7 windows) — every window is a separate Google request. Has no effect on periods that already are daily or hourly.

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

Country to get data for (Worldwide by default). You can also type a region code such as a US state (`US-CA`) or a subdivision like `GB-SCT`.

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

Optional extra regions to fetch in the same run, as country codes (`DE`), US state codes (`US-CA`) or `worldwide`. Every term is fetched for every region; each region is a separate result row.

## `category` (type: `string`):

Limit the data to searches in one Google Trends category.

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

Which Google search to analyze, same as the search-type menu on Google Trends.

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

Timeline of search interest on a 0–100 scale, plus average, peak and change for the period.

## `includeInterestBySubregion` (type: `boolean`):

Interest for each state/province of the selected country (or each country for Worldwide).

## `includeInterestByCity` (type: `boolean`):

Interest for individual cities — best effort. Google shares city data for anonymous access only for popular terms (for example "coffee" returns dozens of US cities, niche terms none); only cities with data are returned and billed.

## `includeInterestByMetro` (type: `boolean`):

Interest for US metro areas (DMA), for Region = United States. For a US state, Interest by subregion already returns its metro areas.

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

Top and rising queries that people also searched for, as returned by Google.

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

Top and rising related topics — best effort. Google serves topics to anonymous visitors only while its public embed quota lasts, which is often used up, so many runs return none. You are billed only for topics that are returned (`relatedTopicsStatus` shows what happened).

## `includeLowSearchVolumeRegions` (type: `boolean`):

Same as the checkbox on Google Trends: adds regions with little search volume to Interest by subregion/country (for example 183 instead of 34 countries for "pickleball"). Note that Google then rescales the map, so a tiny region can become 100.

## `samples` (type: `integer`):

Google Trends is computed from a random sample of searches, so the same request can return slightly different numbers (in our tests 1 in 5 single requests differed from the most common result). We fetch the interest-over-time series this many times from independent IP addresses and return the per-point median, plus `samplingSpread`. 1 = fastest; 3 (default) gives stable, reproducible values; up to 10 for research. The price is the same.

## `outputFormat` (type: `string`):

`nested` keeps all data for a term in one row and uses the same field names as the Google Trends Scraper by Apify, so existing integrations keep working. `flat` produces one row per date of the timeline.

## `viewedFrom` (type: `string`):

Compatibility field. Proxy country used to fetch data (default: US).

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

Compatibility field. Maximum number of result rows; 0 means no limit.

## `spreadsheetId` (type: `string`):

Compatibility field. Not supported yet; use Search terms.

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

Compatibility field. Accepted and ignored: this Actor manages concurrency and retries itself.

## `maxRequestRetries` (type: `integer`):

Compatibility field. Accepted and ignored: this Actor manages concurrency and retries itself.

## `pageLoadTimeoutSecs` (type: `integer`):

Compatibility field. Accepted and ignored: this Actor manages concurrency and retries itself.

## `skipDebugScreen` (type: `boolean`):

Compatibility field. Accepted and ignored.

## `strictStatus` (type: `boolean`):

For monitoring: the run fails when more than half of the queries are incomplete (partial, failed or without data), so a run-status alert catches a broken data type early.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "python, javascript"
  ],
  "isMultiple": false,
  "timeRange": "today 12-m",
  "customTimeRange": "2024-01-01 2024-12-31",
  "dailyData": false,
  "geo": "worldwide",
  "category": "",
  "property": "",
  "includeInterestOverTime": true,
  "includeInterestBySubregion": true,
  "includeInterestByCity": false,
  "includeInterestByMetro": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": false,
  "includeLowSearchVolumeRegions": false,
  "samples": 3,
  "outputFormat": "nested"
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per term and region with all fetched data and summary metrics.

## `allData` (type: `string`):

Full rows including timelines, regions, related queries and topics.

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

Queries, successes, failures and billed results of this run.

# 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",
        "machine learning"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("insanedev/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": [
        "web scraping",
        "machine learning",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("insanedev/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": [
    "web scraping",
    "machine learning"
  ]
}' |
apify call insanedev/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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