# Google Trends Scraper (`stackraccoon/google-trends-scraper`) Actor

Scrape Google Trends for up to 5 keywords at once: interest over time, interest by country, state or city, related queries and topics, and a summary per term (peak, change, trend). Export to JSON, CSV or Excel, or use the API.

- **URL**: https://apify.com/stackraccoon/google-trends-scraper.md
- **Developed by:** [Stack Raccoon](https://apify.com/stackraccoon) (community)
- **Categories:** SEO tools, News
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 47.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 keyword reports

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

### What this actor does

Compare up to five search terms on Google Trends and get one row per keyword report: interest over time, interest by
region and related queries, plus a summary per term (latest, peak, mean, change, direction,
year-on-year, share of the comparison). Every row says what it is worth: which method served it, which sections were
served, a **reason** for every section that was withheld, dropped or failed, and **notes** for normal facts about the
data (such as the current week still filling). Every served number passed a value gate first. A run Google refuses does
not sell empty rows: it ends as a named failure with a health record that says who should act.

Not affiliated with or endorsed by Google. Google Trends is a trademark of Google LLC.

Pricing in one line: 0.005 USD per keyword report served on the free plan and less on paid plans, plus Apify's 0.00005 USD
start event per run, with platform compute included. A report Google has no data for, or one the run did not serve, is
free; reports already served stay charged if the run later fails. On the free plan, Apify's monthly platform credit (5 USD when this was written) covers about 1,000 reports.

### Use cases

Built for marketers, SEO and content teams, analysts and anyone piping search interest into a dashboard or a scheduled
report.

- **Compare product or brand names.** Send up to five terms in one keyword set and read `interestOverTime` and `summary.shareOfComparison`.
- **Plan content around seasons.** Read `summary.peakDate` and `summary.yoyPct` over `today 5-y`.
- **Pick the next market.** Read `interestByRegion` with `leadingTerm` for a term across countries, or within a US state with `geo`.
- **Find what people search next.** Read `relatedQueries` with its `rising` lists and `breakout` flag.
- **Feed a weekly report.** Schedule a run, then read `health` and `reasons` before trusting a row.
- **Watch a trend's direction.** Read `summary.trendDirection` and `summary.changePct` for each term.

### How to use it

1. Open the Input tab and add your terms under **Keyword sets**, one list of 1 to 5 terms per report.
2. Pick the location, time range and sections, or keep the defaults: worldwide, the last 12 months, three sections.
3. Set Maximum cost per run in the run options if you want a ceiling, then click Start.
4. Read the status message when the run ends: it says what happened, what was charged and what to do next.
5. Open the Output tab, or fetch the dataset through the API, and read each row's `health` before using it.

### Pricing

This actor is priced per event. You pay for two things and nothing else:

| Event | Price (USD) | When it is charged |
|---|---|---|
| Keyword report | 0.005 on FREE, 0.0042 on BRONZE, 0.0033 on SILVER, 0.0025 on GOLD; the enterprise plans (PLATINUM, DIAMOND) pay the GOLD price, 0.0025 | Once for each report row served live as `healthy` or `degraded` with data in at least one section (a degraded row still carries every section Google served, and its `reasons` say what is missing). A row whose every section has no data is saved free. |
| Actor start | 0.00005 | Once per run, Apify's standard start event. Apify charges it once for a run of up to 1 GB of memory and once more for each extra GB, and this actor's memory is capped at 1 GB, so a run pays it once. |

The price tier follows your Apify plan's discount tier. Not charged as a report: a report where Google has no data in any
section (the row is saved and says `none:noData`), the canary, replayed test data, a run refused for its input, and any
report Google blocked or broke. Those runs still pay the one start event. Every row says what it was billed as in `chargedEvent`. There is no
separate charge for platform usage, and no per-item charge on top of the report. A run whose Maximum cost per run cannot
pay for one report is refused before any request, but a run refused for its budget still pays the start event (0.00005
USD), as every refused run does: set Maximum cost per run to at least 0.00505 USD for one report.

### Worked cost example

A planned example at the FREE price above, with the form's prefill: coffee against tea, worldwide, the last 12 months, the
three default sections. For this input the canary is the report: the run reads it once, serves one healthy row and
charges it once.

| Run | Start event | Reports | Planned cost (USD) |
|---|---|---|---|
| The run above: one report | 1 x 0.00005 | 1 x 0.005 | 0.00505 |
| The same run with 20 keyword sets (the `maxReports` default), all served | 1 x 0.00005 | 20 x 0.005 | 0.10005 |
| A run refused before any request (a category outside 0 and 3 to 1397, or a reversed date range, for example) | 1 x 0.00005 | none | 0.00005 |

These are planned figures, worked from the prices above; no measured run stands behind them yet.

### What a row looks like

| Field | Key | Meaning |
|---|---|---|
| Row Type | `rowType` | What the row is. Always `keywordReport` in this version. |
| Terms | `terms` | The terms this report compares. |
| Geo | `geo` | The place the report covers; empty is worldwide. |
| Time Range | `timeRange` | The time range the report covers. |
| Property | `property` | The search property; empty is web search. |
| Category | `category` | The Trends category id. |
| Health | `health` | `healthy`: every requested section was served (notes may still be present). `degraded`: at least one requested section was withheld, dropped or failed, and `reasons` says which. |
| Reasons | `reasons` | Why a requested section is missing, as `section:kind[:detail]`, for example `relatedTopics:withheld:emptyRankedList`, `relatedTopics:notOffered:multiTermComparison`, `interestByRegion:shapeCheckFailed:geoMapData:rowShape`, `interestOverTime:valueCheckFailed:maxNot100:87` (the numbers broke a rule Google's answers always keep, so they were not served), `interestByRegion:widgetTermMismatch` (the map was about other terms). Any reason makes the row degraded. |
| Notes | `notes` | Normal facts that do not degrade the row, from a closed list: `interestOverTime:partialLastPoint` or `partialLastPoints:N` (the newest buckets are still filling), `interestOverTime:sparse:<term>:KofN` (Google holds data for fewer than half the buckets: a 100 from one week of searches is not a trend), `interestOverTime:noData[:term]`, `interestOverTime:unknownStep:Ns` (a bucket size the actor has not seen; values still passed the gate), `interestOverTime:googleAveragesMalformed`, `interestOverTime:hasDataMissing`, `interestByRegion:noDataRegions:N`, `interestByRegion:noDataForTerm:<term>:N`, `interestByRegion:lowVolumeRegionsIncluded`, `<section>:noData:<term>`, `<section>:mappedByIndex`, `<section>:tokenRefreshedAfter401`, `servedAfterRateLimitWait:N`. Anything else that explains a gap is a reason. |
| Method | `method` | Which method served the row (`trendsJson` today). |
| Google User Type | `googleUserType` | The session flag Google returned. Google gives `USER_TYPE_SCRAPER` to every session, browsers included, so it says nothing about this actor. |
| Sections Requested | `sectionsRequested` | The sections you asked for. |
| Sections Served | `sectionsServed` | The sections that came back. A section Google has no data for counts as served, with a `noData` note, and the row stays `healthy`; a row with no section that came back at all is never pushed. |
| Interest Over Time | `interestOverTime` | Buckets `{date, timestamp, formattedTime, values: {term: 0..100}, hasData: {term: bool}, partial}`. All terms share one scale: the highest bucket of any term is 100 (the newest, still-filling bucket can hold it). Read `values` by term name, never by position: a term such as `1984` is listed first by JSON. `timestamp` is the bucket start in UTC; `date` is its UTC day and repeats for hourly spans. `hasData` false means Google has no data (the value is 0); a 0 with `hasData` true means "below 1". |
| Scale | `scale` | The timeline scale, `relative_0_100`: the highest point across all terms and dates is 100. |
| Timeline Resolution | `timelineResolution` | The bucket size Google chose for the span: `MINUTE` (now 1-H), `EIGHT_MINUTE` (now 1-d), `SIXTEEN_MINUTE`, `HOUR` (now 7-d), `DAY` (up to about 9 months), `WEEK` (today 12-m and today 5-y), `MONTH` (all, and spans of many years) or `YEAR`. |
| Interest By Region | `interestByRegion` | `{geoCode, geoName, resolution, values, hasData, hasDataByTerm, leadingTerm}` per region; CITY rows carry `coordinates` instead of a `geoCode`. `leadingTerm` is null where every term is 0. |
| Interest By Region Scale | `interestByRegionScale` | `relative_0_100` for one term (the top region is 100). `share_of_terms_percent` for a comparison: each region's values are the terms' shares of that region and sum to 100. |
| Related Queries | `relatedQueries` | Per term, `{top[], rising[]}`; `null` when not served. Top values are relative (the first is 100). Rising values are percent growth; `breakout: true` marks an item Google shows as "Breakout" (growth too large to print), whose raw value is not a percentage to quote. Digits in any script count. |
| Related Topics | `relatedTopics` | The same shape as Related Queries, for topics. `null` when withheld or not offered, and `reasons` says which: Google sends no topics list for a comparison of two or more terms. |
| Summary | `summary` | Per term, over complete buckets: `latest` and `latestPartial`, `latestComplete`, `peak`, `peakDate` and `peakAt` (`null` when the term never rose above 0), `mean`, `googleAverage` (Google's own mean, sent for comparisons), `changePct` (mean of the last quarter of the span against the first quarter), `trendDirection` (`rising` or `falling` past 10 percent, else `flat`), `yoyPct` (the latest 4 weeks, 3 months or 28 days against the same stretch a year earlier, for weekly, monthly or daily buckets when the span holds it) and `shareOfComparison` (the term's share of the comparison's summed means, comparisons only). Every percent is a change in Google's 0 to 100 index, not in search volume. |
| Data Source | `dataSource` | `live` (read from Google in this run), `fixture` (replayed test data) or `stub` (a local test endpoint). Only live rows are ever billed. |
| Charged Event | `chargedEvent` | What this row was billed as: `keyword-report`, or `none:<why>` (`notPayPerEvent`, `canary`, `fixtureReplay`, `testEndpoint`, `noData`, `eventNotPriced:<event>`). |
| Fetched At | `fetchedAt` | When the actor read the report, as an ISO time. |
| Trends URL | `trendsUrl` | The Explore URL for a human to compare. |
| Proxy Class | `proxyClass` | The proxy class the read used: `datacenter`, `custom`, `none` or `fixture`. |
| Attempts | `attempts` | How many requests the report took, waits included. |

The Output tab shortens five of these titles: Timeline Resolution to Resolution, Interest By Region Scale to Region scale, Charged Event to Billed as, Trends URL to Trends link, Fetched At to Fetched.

A row, shortened, from a replay of this actor's bundled test data: the values are illustrative, the shape is real
(`dataSource` reads `fixture`, and `chargedEvent` reads `none:fixtureReplay`, so this row was never billed). Lists are cut to
two items here.

```json
{
  "rowType": "keywordReport",
  "terms": [
    "coffee",
    "tea"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "property": "",
  "category": 0,
  "health": "healthy",
  "reasons": [],
  "notes": [],
  "method": "trendsJson",
  "proxyClass": "fixture",
  "attempts": 6,
  "googleUserType": "USER_TYPE_SCRAPER",
  "scale": "relative_0_100",
  "timelineResolution": "WEEK",
  "interestByRegionScale": "share_of_terms_percent",
  "dataSource": "fixture",
  "fetchedAt": "2026-11-05T13:26:12.344Z",
  "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=coffee%2Ctea&hl=en-US",
  "interestOverTime": [
    {
      "date": "2024-10-27",
      "timestamp": "2024-10-27T00:00:00.000Z",
      "formattedTime": "bucket 1",
      "values": {
        "coffee": 70,
        "tea": 27
      },
      "hasData": {
        "coffee": true,
        "tea": true
      },
      "partial": false
    },
    {
      "date": "2024-11-03",
      "timestamp": "2024-11-03T00:00:00.000Z",
      "formattedTime": "bucket 2",
      "values": {
        "coffee": 72,
        "tea": 27
      },
      "hasData": {
        "coffee": true,
        "tea": true
      },
      "partial": false
    }
  ],
  "interestByRegion": [
    {
      "geoCode": "US",
      "geoName": "United States",
      "resolution": "COUNTRY",
      "values": {
        "coffee": 71,
        "tea": 29
      },
      "hasData": true,
      "hasDataByTerm": {
        "coffee": true,
        "tea": true
      },
      "leadingTerm": "coffee"
    },
    {
      "geoCode": "GB",
      "geoName": "United Kingdom",
      "resolution": "COUNTRY",
      "values": {
        "coffee": 38,
        "tea": 62
      },
      "hasData": true,
      "hasDataByTerm": {
        "coffee": true,
        "tea": true
      },
      "leadingTerm": "tea"
    }
  ],
  "relatedQueries": {
    "coffee": {
      "top": [
        {
          "query": "coffee query 0",
          "value": 100,
          "formatted": "100"
        }
      ],
      "rising": [
        {
          "query": "coffee query 10",
          "value": 250,
          "formatted": "+250%",
          "breakout": false
        }
      ]
    },
    "tea": {
      "top": [
        {
          "query": "tea query 0",
          "value": 100,
          "formatted": "100"
        }
      ],
      "rising": [
        {
          "query": "tea query 10",
          "value": 250,
          "formatted": "+250%",
          "breakout": false
        }
      ]
    }
  },
  "relatedTopics": null,
  "summary": {
    "coffee": {
      "latest": 63,
      "latestPartial": false,
      "latestComplete": 63,
      "peak": 100,
      "peakDate": "2024-12-22",
      "peakAt": "2024-12-22T00:00:00.000Z",
      "mean": 71.88,
      "googleAverage": 72,
      "changePct": -7,
      "trendDirection": "flat",
      "yoyPct": null,
      "shareOfComparison": 74.2
    },
    "tea": {
      "latest": 23,
      "latestPartial": false,
      "latestComplete": 23,
      "peak": 29,
      "peakDate": "2025-06-22",
      "peakAt": "2025-06-22T00:00:00.000Z",
      "mean": 25.04,
      "googleAverage": 25,
      "changePct": 10.3,
      "trendDirection": "rising",
      "yoyPct": null,
      "shareOfComparison": 25.8
    }
  },
  "sectionsRequested": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "sectionsServed": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "chargedEvent": "none:fixtureReplay"
}
```

### Health states and exit codes

| State | Exit code | Platform status | Who acts |
|---|---|---|---|
| `healthy` | 0 | SUCCEEDED | nobody (notes are information); an `alert` may ask the owner to review a new answer form |
| `degraded` | 0 | SUCCEEDED | read the rows' `reasons`; when a section broke or reports went unserved, `HEALTH.alert` names who acts |
| `refused` | 2 | FAILED | the buyer: the input was refused before any request; `HEALTH.reasons` names each field |
| `broken` | 10 | FAILED | the actor owner when Google's answers changed shape or failed the value gate, or an unexpected error; the buyer first when Google refused the options as sent (HTTP 400, for example an unknown category) |
| `blocked` | 11 | FAILED | the actor owner when every method was rate limited, challenged or answered with server or network errors; the buyer when the run's time bound was reached (`wallTimeBound`) or Google challenged the run's address (`challengeRedirect`, `challengePage`): retry it 30 to 60 minutes later, since the actor never solves a challenge or changes address; the owner when every run for a day is challenged |
| `auth_required` | 12 | FAILED | the buyer or actor owner: a sign-in wall, or a method that needs credentials |

When methods fail differently the run takes the most actionable state met: `auth_required` over `broken` over
`blocked`. Before it exits, every run writes the record `HEALTH` to its default key-value store: state, exit code, each
method's state, attempts, session id, proxy host and groups, and whether the session was exhausted, sections requested
and served, every reason, every note, the charging block, the canary's result, a `page:` line naming who acts on a
failing run (picked from the reasons, so a buyer's input is not sent to the owner), an `alert` line when an exit-0 run
still needs someone (a broken section, reports left unserved, or an answer form to review), the pacing used (`pacing`),
the first 300 requests with their status and answer time (`requests`, no URLs or tokens; `requestsTotal` counts every
request and `requestsTruncated` says when the list was cut), and `sessionsCreated` (always 1: the
actor never opens a second session). Refusals and unexpected errors write it too, and a platform abort writes it from
the abort handler, naming the reports it never reached (`notAttempted:runAborted`). A scheduled caller reads `HEALTH`
without opening the dataset. A run that TIMED-OUT with no record should be treated as `broken`.

Every run that can sell a report keeps a small `PROGRESS` record. If the platform moves the run to another server midway, it
resumes after the last finished report: no report is read or charged twice, and HEALTH notes
`run:resumedAfterMigration:atReportN`. A row saved in the instant before the move but not yet charged is left
uncharged: its dataset row still reads `keyword-report`, and HEALTH's `charging.billed` holds the platform's own count of
what was charged.

### When a run fails

The status message says what happened, what was charged and what to do next, in these words. The technical record is
`HEALTH` in the run's key-value store: `kind` holds the slug the second table below gives for each row, `detail` is the
one-line technical summary, and `state`, `reasons` and `page` are as the table above says.

| What happened | The status message starts with | What to do |
|---|---|---|
| Input refused | The input was refused before any request was sent. | Change the field the status message names (Geo, for example) as the input form's help text says, then run again. |
| No results | Google Trends had no data for this input, so the run saved 1 report saying so. | Check the spelling, the region and the time range in the input, or widen them, then run again. |
| Not covered | This request is outside what Google Trends covers, so no result was saved for it. | Change the input to a request Google Trends covers, as the Limits section of the README lists. |
| Blocked by the site | Google Trends refused or challenged this run's requests, so the run saved 0 of 3 reports. | Try again in 30 to 60 minutes. If every run fails for a day, open an issue on the Issues tab. |
| Rate limited | Google Trends is rate limiting this run, so the run saved 0 of 3 reports. | Try again in 30 to 60 minutes, or ask for fewer reports per run. If every run fails for a day, open an issue on the Issues tab. |
| Proxy failed | The proxy this run used failed, so the run saved 0 of 3 reports. | Check the proxy setting in the input, or run again with the default proxy. If the default proxy fails too, open an issue on the Issues tab. |
| Site down | Google Trends did not answer or answered with server errors, so the run saved 0 of 3 reports. | Wait 30 to 60 minutes, then run again. If it still fails a day later, open an issue on the Issues tab. |
| Site changed | Google Trends returned pages this actor could not read, so the run saved 0 of 3 reports. | Open an issue on the Issues tab so we can update the actor, since no input change will help. |
| Site moved | Google Trends moved the address this actor reads, so the run saved 0 of 3 reports. | Open an issue on the Issues tab so we can update the actor, since no input change will help. |
| Sign-in asked | Google Trends asked this run to sign in, so the run saved 0 of 3 reports. | Try again later, and open an issue on the Issues tab if every run asks to sign in. |
| Charge limit reached | The run stopped at the Maximum cost per run you set, after saving 1 of 3 reports. Or, when Max reports in the input cut the run: The run stopped at the Max reports in the input, after saving 20 of 25 reports. | At Maximum cost per run: raise Maximum cost per run in the run options, or ask for fewer reports per run. At Max reports: put only the reports it did not reach in a new run, since a run of the same input charges again, and raise Max reports in the input if you need more per run. |
| Time limit reached | The run reached its time limit, after saving 1 of 3 reports. | Raise Wall-time bound (s) in the input and the run timeout in the run options, or ask for fewer reports per run. |
| Stopped early | The run was stopped before it finished, after saving 1 of 3 reports. | Run it again without anything already finished, since a new run starts over and charges again. |
| Error in the actor | The run stopped on an error in this actor's code, after saving 0 of 3 reports. | Open an issue on the Issues tab and share this run, so we can fix it. |

Each row's `HEALTH.kind` slug, and the state and exit code the run ends in:

| `HEALTH.kind` | Row above | State and exit code |
|---|---|---|
| `bad-input` | Input refused | `refused`, exit 2 |
| `nothing-found` | No results | `healthy`, exit 0 (the no-data row is saved free) |
| `not-covered` | Not covered | `degraded`, exit 0 when other reports were served; `broken`, exit 10 when none was |
| `blocked` | Blocked by the site | `blocked`, exit 11 |
| `rate-limited` | Rate limited | `blocked`, exit 11 |
| `proxy-fault` | Proxy failed | `blocked`, exit 11 |
| `site-down` | Site down | `blocked`, exit 11 |
| `site-changed` | Site changed | `broken`, exit 10; `degraded`, exit 0 when only a section broke and the rest was served |
| `site-moved` | Site moved | `broken`, exit 10 |
| `login-wall` | Sign-in asked | `auth_required`, exit 12 |
| `budget-stop` | Charge limit reached | `degraded`, exit 0 at Maximum cost per run (HEALTH names each report not reached); at Max reports exit 0, `healthy` or `degraded` as the reports it read; `refused`, exit 2 when Maximum cost per run cannot pay for one report |
| `time-bound` | Time limit reached | `blocked`, exit 11 |
| `aborted` | Stopped early | `degraded`, exit 0 when reports were saved before the stop, else `blocked`; the platform status reads ABORTED |
| `our-bug` | Error in the actor | `broken`, exit 10 |
| `done` | none: the run finished | `healthy`, exit 0, or `degraded`, exit 0 when a section is missing |

### How it heals itself, and where it stops

- **A value gate on every section.** Timelines must hold integers 0 to 100 with a 100 present, increasing time and
  partial buckets only at the end; region rows must name a place and their shares must sum to about 100; related lists
  must start at 100 and descend. A section that fails is dropped with `valueCheckFailed:<rule>`, never served.
- **Canary sentinels.** Coffee and tea always have data. If the canary comes back zero-filled, near empty, with fewer than
  20 countries or empty related queries, the canary counts as broken: no buyer report is attempted or billed. The empty canaries end two ways: a zero-filled canary
  (values of 0 that Google marks as data) or a default canary with no data at all is `broken` (exit 10, no buyer report
  attempted), while a default canary with no data for only one term or section is `degraded` (`canary:unexpectedNoData`,
  exit 0) and the buyer's reports still run.
- **A repair kit.** A response that broke the readers is saved as `REPAIR_1` to `REPAIR_5` in the key-value store, with
  widget tokens masked and credentials removed, so the fix starts from the real changed answer.
- **Retries that change nothing about the request.** One fresh explore when Google rejects a widget token (401); one
  retry after 5 s on a dropped connection or a server error (two failures in a row stop the method); Google's own
  `Retry-After` is honoured up to 5 minutes inside the run bound; one redirect inside the same host is followed, and the
  owner is told the endpoint moved.
- **Adaptive pacing.** 1000 ms between requests, rising to 2000 ms after any rate-limit answer and 1200 ms past 60
  requests, on the same session and address.
- **Fewer doomed requests.** An explore answer that cannot change between reports stops the method. A set Google
  refuses with HTTP 400 costs nothing, and the later sets are still sent, because the refusal does not say why.
- **Never**: a second session or address, a challenge solved, a sign-in, a residential proxy group, a value invented or
  rescaled to look valid. A proxy URL you give in `proxyUrls` is used as given: the actor cannot tell its class, so a
  residential address you supply is your choice, and the row reads `proxyClass: custom`.

### Input fields

Inputs Google would answer with an error, or would silently reinterpret, are refused before any request (exit 2), with
one named message per field. The input of Apify's Google Trends Scraper (`searchTerms`, `isMultiple`, `timeRange`,
`category`, `customTimeRange`, `startUrls`, `viewedFrom`) is read too, so a run built for it works unchanged; fields that
mean nothing here are named in HEALTH (`input:officialActorFieldsIgnored`).

| Field | Default | What it does |
|---|---|---|
| `keywordSets` | none (the form prefills `[["coffee","tea"]]`; that prefill is dropped when you fill `keywords`, `exploreUrls` or `searchTerms`, with the note `input:prefillDropped:keywordSets`) | A list of term lists: one report per list, 1 to 5 terms each, compared on one shared scale. Terms are matched case-insensitively and may not hold a comma. A flat item such as `"coffee, tea"` is read as one line of comma-separated terms (`input:keywordSetsReadAsLines:N`). Duplicate sets are merged with a note. Search operators work as on the Trends site: `"coffee shop"`, `coffee + tea`, `coffee -tea`, and topic ids such as `/m/02vqfm`. |
| `keywords` | none | The easy form: each line is one report, terms on a line separated by commas (`coffee, tea`). Adds to your own `keywordSets`. A blank line or a blank term between commas is skipped and named in HEALTH notes (`input:blankLineSkipped`, `input:emptyTermDropped`). |
| `exploreUrls` | none | Explore URLs copied from the browser (`https://trends.google.com/trends/explore?q=...`). Each is one report with its own terms, place, time range, category, property and language. A URL comparing several places or periods is refused, with the reason. The URL is read, never requested. |
| `geo` | `""` (worldwide) | An uppercase location code: `US`, `GB`, a sub-region `US-CA`, or a US metro `US-NY-501`. |
| `timeRange` | `today 12-m` | A preset (`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`), `all_YYYY`, `YYYY-MM-DD YYYY-MM-DD`, or an hourly `YYYY-MM-DDTHH YYYY-MM-DDTHH` of at most 7 days (UTC). Reversed, future and pre-2004 ranges are refused. |
| `property` | `""` (web search) | Web, `images`, `news`, `youtube` or `froogle` (shopping). |
| `category` | `""` (all categories) | Trends category id as text digits, 3 to 1397, as in an Explore URL (`cat=`); empty or `0` is all categories, and 1 and 2 are refused. Google answers HTTP 400 to an unknown id, which the run reports to the buyer. |
| `language` | `en-US` | Language for place names and labels (`hl`), shaped like `en-US`, `de` or `pt-BR`. |
| `sections` | interest over time, by region, related queries | Which sections each report returns; a name given twice is read once (`input:duplicateSectionsRemoved`). `relatedTopics` is opt-in and cannot be asked for alone: Google returns topics empty to keyless clients and sends no topics widget for comparisons of two or more terms; the row then names why. |
| `regionResolution` | `""` (Google's own level) | Region level: empty keeps Google's level for the geo (countries worldwide, sub-regions in a country, cities in a sub-region). `COUNTRY` (worldwide only), `REGION` (a country geo; worldwide Google answers 500), `DMA` (US only) or `CITY` (not for `US`). Combinations Google refuses are refused here. |
| `includeLowVolumeRegions` | `false` | Google's own option: also list regions whose search volume is too low to rank, as the Trends site's checkbox does. The row notes `interestByRegion:lowVolumeRegionsIncluded`. |
| `timezoneOffsetMinutes` | `0` | Offset for Google's `formattedTime` labels, -1439 to 1439 (US Central is 360, Central Europe -60). Timestamps and values are always UTC buckets. |
| `maxReports` | `20` | 1 to 200. At most this many sets are read, in order; each served live report is one billed event. Extra sets are skipped and named by field and entry in HEALTH notes (`input:keywordSetsSkippedAtMaxReports:keywordSets[20],...`, counted from 0); the status message then says the run stopped at Max reports, whether you set it or left the default. |
| `methods` | `["trendsJson"]` | Methods tried in order for each report; `trendsJson` is the one method today. Other names are refused. |
| `proxyConfiguration` | Apify datacenter proxy (also when an API caller omits the field) | One session and one address per run (the session id is the run id); the actor never rotates past a rate-limit answer. Residential groups are refused, as is a shape the platform cannot read. |
| `requestDelayMs` | `1000` | Pause between requests (500 to 30000). The run slows down on its own: to 2000 ms after a rate-limit answer and to 1200 ms past 60 requests. |
| `rateLimitWaitSeconds` | `20` | First wait after a rate-limit answer (5 to 120); each further wait doubles, on the same session and cookie. Google's own `Retry-After` replaces it when given, up to 5 minutes. |
| `rateLimitMaxWaits` | `2` | 0 to 5. Waits before the method is recorded `blocked` for the rest of the run. A `Retry-After` past 5 minutes or past the run bound stops at once (`retryAfter:N`). |
| `maxRunSeconds` | `600` | No request starts after this long (or 40 s before the platform timeout, whichever is sooner), pacing included, so the run always ends in a named state. Shown on the form as Wall-time bound (s). 30 to 3000. A report needs one request for explore, one per timeline or map section and one per term for related queries, at 1 s each by default; on the platform the canary and one two-term report with the default sections took 8.4 s. HEALTH warns up front when the reports will not fit (`input:runBoundMayCutReports`). |
| `canaryFirst` | `true` | Read the canary before your reports. If it cannot be served, or its values look wrong (the sentinels above), your reports are not attempted and no report is charged; the run still pays Apify's start event, as every run does. If the default canary (coffee and tea, worldwide, the last 12 months) comes back with no data at all, the sentinels make it `broken`; with no data for only one term or section, the run is `degraded` (`canary:unexpectedNoData`); the value floors hold only for that default, and any other canary may legitimately have none. |
| `canaryOnly` | `false` | Read only the canary and write its health record (a scheduled health check). No report is charged; the run still pays Apify's start event, as every run does. It runs only the default canary (coffee and tea, worldwide, `today 12-m`); with any other `canaryInput` it is refused, since a check on your own terms is a report: put the terms in `keywordSets`. |
| `canaryInput` | coffee vs tea, worldwide, `today 12-m` | The canary's `terms`, `geo` and `timeRange`, cleaned like your terms; blank terms are refused. The canary is always a plain web report (all categories, en-US, the three default sections), so a buyer's options never decide its result. |

Three hidden fields (`fixtureSource`, `allowReplayOnPlatform` and `endpointBaseUrl`) are for the owner's offline tests and drills;
on the platform they are refused on any run the owner did not start.

A run whose Maximum cost per run cannot pay for one report is refused before any request; the refused run still pays the start event. A run that reaches its Maximum cost per run midway stops on its own: HEALTH names each report it did not reach (`notAttempted:budgetStop`) and the `alert` says the buyer acts.

### Integrations

- **API**: start a run and read its dataset over HTTP ([Apify API](https://docs.apify.com/api/v2)). The API tab of this page has ready calls.
- **Python and Node clients**: [apify-client for Python](https://docs.apify.com/api/client/python) and [for JavaScript](https://docs.apify.com/api/client/js).
- **MCP and AI agents**: call this actor as a tool through [Apify's MCP server](https://docs.apify.com/platform/integrations/mcp).
- **Zapier, Make and n8n**: [Zapier](https://docs.apify.com/platform/integrations/zapier), [Make](https://docs.apify.com/platform/integrations/make) and [n8n](https://docs.apify.com/platform/integrations/n8n).

### Limits

Google Trends has no public data contract. The actor reads the same JSON endpoints the Explore page reads, paces its
requests, waits on a rate-limit answer only inside a small budget on the same session, and never solves a challenge,
signs in or escalates to a residential address. Values are relative (0 to 100 within the report), not search volumes.
Google draws a fresh sample once a day, so the same report can differ slightly from one UTC day to the next. Google
challenges datacenter addresses after bursts of runs: in the 2026-10-25 live matrix, 10 of 13 runs served, one was an
option Google refuses (category 1999), and the last two, minutes apart, were challenged or rate limited.

Not covered: an option Google refuses as sent, such as an unknown category or a region level a location does not have.
Google answers those with an HTTP 400, and the run says so and saves nothing for that report.

### FAQ

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

This actor reads only pages anyone can open without signing in: aggregate search-interest numbers, the same JSON the Trends
Explore page reads. Collecting public data is generally lawful, but the law differs by country and by purpose, and this is
not legal advice. The actor never requests the Explore page itself, never solves a challenge and never signs in.

#### How does it compare with other Google Trends actors on the Store?

Prices as each actor's Store record read on 2026-11-14. Their charge is per dataset item; ours is per keyword report
of up to five compared terms with every section in one row, so compare the cost of the question you want answered,
not the line price.

| Actor | What one charge buys | Price per charge, free plan (USD) | Paid plans (USD) | Start fee per run (USD) |
|---|---|---|---|---|
| This actor | one keyword report (1 to 5 terms, all sections, health per row) | 0.005 | 0.0025 to 0.0042 | 0.00005 |
| apify/google-trends-scraper | one search term, or one comma-joined comparison, with every section | 0.006 | 0.0015 to 0.005 | 0.00005 |
| data_xplorer/google-trends-fast-scraper | one keyword a run | 0.002 | 0.0005 to 0.001 | 0.025 |
| agenscrape/google-trends-scraper | one keyword | 0.025 | 0.025 | 0.025 |
| khadinakbar/google-trends-scraper | one data point (a timeline point, a region value or one related query) | 0.005 | 0.005 | 0.00005 |

What this actor adds is the record on every row and run: which method served it, which sections Google withheld and
why, a named health state, and no report charge for a report that was not served.

#### Why was a run charged when it returned no rows?

Every run pays Apify's start event (0.00005 USD), including a run refused for its input or blocked by Google. No
keyword report is charged unless a row with data was served. `HEALTH` in the run's key-value store says what happened and who
should act.

#### My run ended `blocked`. What now?

Google challenged or rate limited the run's address. Retry 30 to 60 minutes later: the actor never changes address or
solves a challenge, so it stops honestly instead. Fewer keyword sets per run also help.

#### Why is `relatedTopics` empty?

Google returns related topics empty to keyless sessions and sends none for comparisons of two or more terms. The row's
`reasons` say which of the two happened.

#### How do I call it from code, or report a problem?

The API tab of this page has ready calls for every language Apify supports. Report a problem on the Issues tab with a
link to the run; the `HEALTH` record usually says what went wrong before anyone has to ask.

### Disclaimers

Results come as Google Trends publishes them, with no warranty of completeness or accuracy. You decide how to use them and
you answer for that use.

Read Google's terms of service and follow them, especially before large or scheduled jobs.

Results can contain personal data, such as a person's name in the terms you supply or in the query and topic text Google
returns.
The GDPR in the EU, the CCPA in California and similar laws elsewhere protect it. Collect and keep it only with a
legitimate reason, and ask a lawyer if you are unsure. The rest of the output is aggregate search-interest numbers, with
no accounts, email addresses or locations of people.

This is an independent tool. It is not affiliated with or endorsed by Google LLC, and Google LLC does not sponsor it. Google
Trends is a trademark of Google LLC.

It reads only pages anyone can open without signing in. Collecting public data is generally lawful, but the law differs by
country and by purpose, and this is not legal advice.

Google Trends changes its pages without notice. When a change breaks a read, the row's health field says so and the run
names the failure, and no result charge applies to what did not arrive.

### Support

Report a problem on the [Issues tab](https://apify.com/stackraccoon/google-trends-scraper/issues) with a link to the run. Each version's
changes are on the Changelog tab of this page.

# Changelog

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

# Actor input Schema

## `keywordSets` (type: `array`):

Add one report per set. Each set is a list of 1 to 5 terms that Google compares on one shared 0 to 100 scale (the highest point of any term is 100). Example: \[\["coffee", "tea"], \["espresso"]]. Terms are matched case-insensitively; a term may not contain a comma. Each report saved with data is one billed event, plus Apify's start event once per run; a report Google has no data for is saved free, and the canary is not charged as a report.

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

Type reports here as an easier way to give them: each line is one report, and terms on a line separated by commas are compared on one scale ("coffee, tea"). Adds to your own keywordSets; the prefilled coffee and tea set is dropped when you fill this.

## `exploreUrls` (type: `array`):

Paste Explore URLs from your browser (https://trends.google.com/trends/explore?q=...). Each URL is one report with its own terms, place, time range, category, property and language; the URL is read, never visited. A URL comparing several places or several time ranges is refused. Adds to your own keywordSets; the prefilled coffee and tea set is dropped when you fill this.

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

Pick the location code: empty for worldwide, an uppercase ISO country code (US, GB), a sub-region (US-CA) or a US metro (US-NY-501). Any other code in that shape is accepted; lowercase or unknown codes are refused because Google answers them with an error.

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

Pick a preset, or enter all_YYYY, a custom range "YYYY-MM-DD YYYY-MM-DD" or an hourly range "YYYY-MM-DDTHH YYYY-MM-DDTHH" (UTC, at most 7 days). Google picks the bucket size from the span; each row names it in timelineResolution.

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

Pick the Google search property the interest is measured on.

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

Enter the Trends category id as digits, 3 to 1397; empty or 0 is all categories (71 is Food and Drink, 20 is Sports). Text, as Apify's Google Trends Scraper takes it, so its inputs work unchanged. An id outside 3 to 1397 is refused before any request; copy the id from a Trends explore URL (the cat= parameter).

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

Pick the language for place names, labels and "Breakout". Google silently falls back to en-US on an unknown language, so tags not shaped like en-US, de or pt-BR are refused.

## `sections` (type: `array`):

Pick the sections each report returns. Related topics are opt-in and need one other section with them (alone they are refused): Google withholds them from keyless sessions it flags as scrapers, and the row then says so (degraded, reason relatedTopics:withheld). Accepted values: interestOverTime, interestByRegion, relatedQueries, relatedTopics.

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

Pick the level of the interest-by-region rows. Leave empty to keep the level Google picks for the geo (countries worldwide, sub-regions inside a country, cities inside a sub-region). Combinations Google refuses (COUNTRY with a geo, REGION worldwide, CITY with US, DMA outside the US) are refused before any request.

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

Include regions whose search volume is too low to rank (Google's own option; they come back with no data or small values). Off by default, as on the Trends site.

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

Set the offset for Google's formattedTime labels, JavaScript convention (US Central is 360, Central Europe is -60). It changes only the labels: timestamps and values are always UTC buckets.

## `maxReports` (type: `integer`):

Limit the run to at most this many keyword sets, read in order; each served report is one billed event. When you give more sets than this, the run reads the first ones and ends on the Charge limit reached message, with the sets it skipped named in HEALTH notes. A large run needs a higher Wall-time bound and run timeout: the canary and one report took 8.4 s on the platform.

## `methods` (type: `array`):

Pick the methods tried in order for each report; the row names the method that served it. One method today: the Trends JSON endpoints. Accepted value: trendsJson.

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

Pick the proxy; datacenter proxy by default. The actor keeps one session and one address for the whole run and never rotates past a rate-limit answer. Residential proxy groups are not offered by this actor and are refused before any request: leave the Apify datacenter default, or give your own proxy URLs.

## `requestDelayMs` (type: `integer`):

Pause between requests on the session. The run slows down on its own: to at least 2000 ms after Google rate limits it, and to at least 1200 ms past 60 requests. It never speeds up past what you set.

## `rateLimitWaitSeconds` (type: `integer`):

Set the first wait after a rate-limit answer; each further wait doubles. The same session and cookie are reused.

## `rateLimitMaxWaits` (type: `integer`):

Set how many waits come before the method is recorded blocked for the rest of the run.

## `maxRunSeconds` (type: `integer`):

Set the time after which no request starts, pacing included (or 40 s before the platform timeout, whichever is sooner), so the run always ends in a named state and writes HEALTH. At the default pacing the canary and one two-term report took 8.4 s on the platform.

## `canaryFirst` (type: `boolean`):

Read the canary report before your reports; if it cannot be served the run cannot end healthy or degraded. The canary is not charged as a report.

## `canaryOnly` (type: `boolean`):

Read only the canary report and write its health record (for a scheduled health check). The canary is not charged as a report.

## `canaryInput` (type: `object`):

Set the everyday report the canary reads: terms, geo, timeRange. The canary is not charged as a report unless it is one of your own reports.

## `fixtureSource` (type: `string`):

Owner testing only. Replays a bundled fixture with no network. Refused on the platform except in the owner's own drills; replayed rows say dataSource fixture and are never billed.

## `endpointBaseUrl` (type: `string`):

Base URL of the Trends host. Only changed to point the live request path at a local test stub.

## `allowReplayOnPlatform` (type: `boolean`):

Owner drills only: lets fixtureSource or a test endpoint run on the platform, and only on a run the actor's owner started.

## Actor input object example

```json
{
  "keywordSets": [
    [
      "coffee",
      "tea"
    ]
  ],
  "keywords": [
    "coffee, tea",
    "bitcoin"
  ],
  "exploreUrls": [
    "https://trends.google.com/trends/explore?q=coffee,tea&geo=US"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "property": "",
  "category": "",
  "language": "en-US",
  "sections": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "regionResolution": "",
  "includeLowVolumeRegions": false,
  "timezoneOffsetMinutes": 0,
  "maxReports": 20,
  "methods": [
    "trendsJson"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "requestDelayMs": 1000,
  "rateLimitWaitSeconds": 20,
  "rateLimitMaxWaits": 2,
  "maxRunSeconds": 600,
  "canaryFirst": true,
  "canaryOnly": false,
  "canaryInput": {
    "terms": [
      "coffee",
      "tea"
    ],
    "geo": "",
    "timeRange": "today 12-m"
  },
  "endpointBaseUrl": "https://trends.google.com",
  "allowReplayOnPlatform": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per keyword report that served at least one section

## `health` (type: `string`):

The run's HEALTH record

# 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 = {
    "keywordSets": [
        [
            "coffee",
            "tea"
        ]
    ],
    "timeRange": "today 12-m",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("stackraccoon/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 = {
    "keywordSets": [[
            "coffee",
            "tea",
        ]],
    "timeRange": "today 12-m",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("stackraccoon/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 '{
  "keywordSets": [
    [
      "coffee",
      "tea"
    ]
  ],
  "timeRange": "today 12-m",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call stackraccoon/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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