# Google Trends Scraper: Related Queries & Trending Searches (`heyitsgautham/google-trends-scraper`) Actor

Google Trends data as JSON: interest over time, interest by region and top and rising related queries for up to 5 keywords per comparison, any geo, time range, category or search type. Plus Trending Now by country. $1 per 1,000 comparisons, failures free. Final test: 58 of 58 ok.

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

## Pricing

from $1.00 / 1,000 keyword comparisons

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 Scraper: Related Queries & Trending Searches

Get Google Trends data as clean JSON, the same numbers you see on trends.google.com, for marketers, SEO teams and analysts who track demand over time.

Use cases, each with a ready-to-run example:

- [Compare keywords over 12 months, such as ChatGPT vs Claude vs Gemini](https://apify.com/heyitsgautham/google-trends-scraper/examples/chatgpt-vs-claude-vs-gemini)
- [Get today's trending searches in the US, the UK and India](https://apify.com/heyitsgautham/google-trends-scraper/examples/trending-searches-us-uk-india)
- [Find the rising related queries for a keyword](https://apify.com/heyitsgautham/google-trends-scraper/examples/google-trends-rising-related-queries)
- [See interest by US metro area](https://apify.com/heyitsgautham/google-trends-scraper/examples/google-trends-interest-by-us-metro)
- [Compare YouTube search trends](https://apify.com/heyitsgautham/google-trends-scraper/examples/youtube-search-trends)
- [Compare Google Shopping trends](https://apify.com/heyitsgautham/google-trends-scraper/examples/google-shopping-trends)

Compare up to 5 keywords at once, for any country or region, time range, category and search type, or up to 50 on one scale.
Paste a trends.google.com link, break interest down by city or US metro area, or research a keyword's related searches in one call.
You can also pull the searches trending right now in any country.

You pay **$1 per 1,000 keyword comparisons** ($0.001 each), with up to 5 keywords in each one.
Trending Now costs **$0.25 per 1,000 trending searches**, and less on Apify Store discount tiers (Bronze, Silver, Gold), down to $0.175 per 1,000 on Gold.
There is no start fee, and comparisons that fail or have no data are **never charged**.

### At a glance

| Topic | Details |
|---|---|
| Input | Comparisons of 1 to 5 keywords each (up to 50 with `moreThanFiveKeywords`), with country or region, time range, category and search type. trends.google.com explore and trending links. Research keywords. Optional country codes for Trending Now |
| Output | JSON rows with interest over time, interest by region (countries, subregions such as US states, cities or US metro areas) and top and rising related queries per keyword. Each researched related query's own timeline and growth. Trending Now rows with search volume and start time |
| Price | $0.001 per comparison ($1 per 1,000), with its timeline, region and related-query rows included. Trending Now is $0.00025 per search ($0.25 per 1,000), down to $0.175 per 1,000 on Gold. No start fee. Failed or empty comparisons are free |
| Tested | Latest test run: 58 of 58 inputs returned data, with 15 comparisons of 6 to 13 keywords, 11 city or metro breakdowns, 18 trends.google.com links and 12 research keywords. The run before it: 58 of 58 comparisons and 7 of 7 Trending Now countries |
| Limits | Google compares at most 5 keywords, so more than 5 are fetched in batches. No related topics. Cities only where Google has enough data |

### What you get

For each comparison:

| Row type | What it holds |
|---|---|
| `interestOverTime` | The timeline for all keywords on the same 0 to 100 scale, plus the average per keyword |
| `interestByRegion` | Countries (for worldwide) or subregions such as US states (for a country), with a value per keyword. Cities or US metro areas with `regionResolution` |
| `relatedQueries` | One row per keyword with the top and rising related searches, including Breakout flags |

For each research keyword, its comparison rows above, then:

| Row type | What it holds |
|---|---|
| `relatedTrend` | One related query's own timeline, its average and its growth over the last quarter of the time range |
| `researchSummary` | Free. Every researched query with its growth, highest growth first |

For each Trending Now country, one row per trending search with search volume, percent increase, start and end time, categories and the related searches Google groups with it.
Its `trendId` joins the country, the search and its start time, so the same trend keeps the same ID across runs.

Every row has a `status` of `ok`, `no_data`, `invalid_input` or `error`, and a `message` when it is not `ok`.
Rows from a pasted link carry it as `inputUrl`.

### Input

Type comparisons one per line, with keywords separated by commas, like the compare box on Google Trends.

```json
{
  "comparisons": ["chatgpt, gemini, claude", "bitcoin"],
  "geo": "US",
  "timeRange": "today 3-m",
  "property": "web",
  "trendingCountries": ["US", "GB"]
}
```

| Setting | Values |
|---|---|
| `geo` | Empty for worldwide, a country such as `US` or `IN`, or a region such as `US-CA` or `GB-ENG` |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y`, `all`, or `custom` with `customTimeRange` such as `2024-01-01 2024-06-30` |
| `category` | Google Trends category id, 0 for all. It is the `cat=` value in a trends.google.com URL |
| `property` | `web`, `youtube`, `news`, `images` or `shopping` |

Through the API, any comparison can be an object that overrides these settings for that comparison only:

```json
{
  "comparisons": [
    {"keywords": ["tea", "coffee"], "geo": "GB", "timeRange": "all"},
    {"keywords": "iphone, samsung galaxy, google pixel", "geo": "IN", "property": "youtube"},
    {"keywords": ["black friday"], "geo": "US", "timeRange": "custom", "customTimeRange": "2023-10-01 2023-12-31", "property": "shopping"}
  ]
}
```

### More options

All of these are off until you set them, so a run without them works exactly as before.

| Setting | What it does |
|---|---|
| `regionResolution` | `city` gives cities, `metro` gives US metro areas (Nielsen DMA codes), `default` keeps countries or subregions. It can also go in a comparison object |
| `moreThanFiveKeywords` | Lets one comparison hold 6 to 50 keywords on one 0 to 100 scale |
| `trendsUrls` | Links copied from trends.google.com. An explore link runs that comparison with its own location, time range, category and search type. A trending link runs Trending Now for its country, window, category and active filter |
| `researchKeywords` | Seed keywords. Each one returns its comparison and related queries, then the own timeline and growth of each of its top related queries |
| `researchMaxRelated` | How many related queries get their own timeline per seed, 10 by default and 25 at most |
| `researchRelatedType` | `both` (rising first, then top), `rising` or `top` |
| `onlyNewSinceLastRun` | Trending Now only. Returns only the trending searches this scraper has not returned to you before for the same country and categories. See [Run it on a schedule](#run-it-on-a-schedule) |

```json
{
  "comparisons": ["chatgpt, gemini, claude, perplexity, copilot, deepseek, grok, mistral"],
  "moreThanFiveKeywords": true,
  "regionResolution": "metro",
  "geo": "US",
  "trendsUrls": ["https://trends.google.com/trends/explore?cat=7&date=today%2012-m&geo=US&q=mortgage%20rates,inflation"],
  "researchKeywords": ["pickleball"],
  "researchMaxRelated": 5
}
```

#### More than 5 keywords on one scale

Google compares at most 5 keywords at a time.
With `moreThanFiveKeywords`, the scraper sends the first 5 as one comparison, then takes the most searched keyword so far as the anchor and sends it with the next 4, and so on.
The anchor's values in both comparisons give the factor that puts the new keywords on the first scale, and the result is scaled so the top value is 100.
Regions are joined the same way, through the anchor's share in each region.
A region where a later batch has no data for the anchor is left out, and the row's `message` says how many.
The row lists `batchCount`, `anchorKeywords` and the Google link of each batch in `batchExploreUrls`.

Run `hKjd0PGLalXj5a1Vv` measured how close it gets.
It checked 13 keyword pairs from 3 merged comparisons, each against a direct 2-keyword comparison of the same pair.
The ratio between the two keywords differed by a median of 0.9%, and by 3.6% or less for 11 of the 13.
The other 2 were kotlin against java (23%) and scala against javascript (15%), where the smaller keyword sits at 1 on the merged scale and Google's rounding to whole numbers dominates.

#### City and metro areas

Google shows cities only where it has enough data, the same as on the website.
In the latest test run, 4 of 6 city breakdowns returned cities (2 to 20 each), and tacos against burritos in Texas and oktoberfest in Germany over 5 years returned none.
Metro areas exist only for US locations.
All 4 US metro breakdowns returned data, 210 areas for the whole US and 10 for New York state.
A metro breakdown for Australia returns a free `no_data` region row that says so.

#### Research from a seed keyword

`growthPercent` compares the average of the last quarter of the time range with the quarter before.
For the default 12 months of weekly points, that is the last 13 weeks against the 13 before, and `growthWindowPoints` says how many points each side held.
A query that had no searches in the quarter before has `growthPercent: null` and `previousAverage: 0`, and the summary lists it first.
Google's own rising percentage (`relatedValue`) compares the whole time range with the one before it, so the two numbers measure different things.
Rising related queries come from Google as they are, and they sometimes include searches unrelated to the seed.

### Run it on a schedule

Trending Now changes within minutes, so a scheduled run with `onlyNewSinceLastRun: true` works as an alert for new trending searches in the countries you watch.
Each run still keeps only each country's top `trendingMaxItems`, and returns the ones you have not had before.
We ran 59 countries and 3 trending links, 20 searches each, four times on 20 Oct.
The first run returned 1,223 searches.
Runs 2, 15 and 49 minutes after the first returned 4, 102 and 150 searches, none of them returned before.
None was a search from an earlier run under a new start time, so each `trendId` held.
A country with nothing new comes back as a free `no_data` row.
A daily run with the default 24-hour `trendingHours` window covers each day, and the 4-hour window suits a run every 4 hours.

1. Set your input with `onlyNewSinceLastRun: true` and click **Save as a new task**.
2. On the task page, click **Actions**, then **Schedule**, and pick how often it runs.
   [Apify's schedules guide](https://docs.apify.com/actors/running/schedules) covers cron times and time zones.
3. On the task's **Integrations** tab, choose where each run's results go.

| Integration | What it does |
|---|---|
| [Slack](https://docs.apify.com/integrations/slack) | Posts a message to your channel when a run finishes |
| [Google Drive](https://docs.apify.com/integrations/drive) | Saves each run's results as a file in your Drive |
| [Webhook](https://docs.apify.com/integrations/webhooks) | Sends the finished run, with its dataset ID, to your own URL |
| [Make](https://docs.apify.com/integrations/make), [Zapier](https://docs.apify.com/integrations/zapier), [n8n](https://docs.apify.com/integrations/n8n) | Adds each new row to a Google Sheet, a CRM or a database |

Each trending row has a stable `trendId`, so a sheet or database can skip rows it already holds.
Keyword comparisons have no only-new mode, and a scheduled comparison returns the full timeline each time.

### Output example

This is real output from a test run, for the comparison `chatgpt, gemini, claude` in the US over the past 90 days.
Lists are cut to 3 entries here; the real rows have the full 93 days, 51 states and 25 top queries.

```json
{
  "type": "interestOverTime",
  "status": "ok",
  "comparisonIndex": 1,
  "keywords": ["chatgpt", "gemini", "claude"],
  "geo": "US",
  "timeRange": "today 3-m",
  "category": 0,
  "property": "web",
  "exploreUrl": "https://trends.google.com/trends/explore?q=chatgpt%2Cgemini%2Cclaude&date=today+3-m&geo=US",
  "summary": "93 points, averages chatgpt 65, gemini 26, claude 18",
  "averages": {"chatgpt": 65, "gemini": 26, "claude": 18},
  "timeline": [
    {"date": "2026-07-09T00:00:00Z", "formattedTime": "Jul 9, 2026", "values": {"chatgpt": 70, "gemini": 25, "claude": 28}, "isPartial": false},
    {"date": "2026-07-10T00:00:00Z", "formattedTime": "Jul 10, 2026", "values": {"chatgpt": 66, "gemini": 23, "claude": 24}, "isPartial": false},
    {"date": "2026-07-11T00:00:00Z", "formattedTime": "Jul 11, 2026", "values": {"chatgpt": 48, "gemini": 20, "claude": 16}, "isPartial": false}
  ]
}
```

```json
{
  "type": "interestByRegion",
  "status": "ok",
  "keywords": ["chatgpt", "gemini", "claude"],
  "geo": "US",
  "summary": "51 regions, top California",
  "resolution": "REGION",
  "valueType": "share",
  "regions": [
    {"geoCode": "US-CA", "geoName": "California", "values": {"chatgpt": 57, "gemini": 25, "claude": 18}},
    {"geoCode": "US-GA", "geoName": "Georgia", "values": {"chatgpt": 63, "gemini": 22, "claude": 15}},
    {"geoCode": "US-NJ", "geoName": "New Jersey", "values": {"chatgpt": 61, "gemini": 23, "claude": 16}}
  ]
}
```

```json
{
  "type": "relatedQueries",
  "status": "ok",
  "keyword": "claude",
  "geo": "US",
  "timeRange": "today 3-m",
  "summary": "25 top, 8 rising",
  "top": [
    {"query": "claude ai", "value": 100, "link": "https://trends.google.com/trends/explore?q=claude+ai&date=today+3-m&geo=US"},
    {"query": "claude code", "value": 56, "link": "https://trends.google.com/trends/explore?q=claude+code&date=today+3-m&geo=US"},
    {"query": "what is claude", "value": 25, "link": "https://trends.google.com/trends/explore?q=what+is+claude&date=today+3-m&geo=US"}
  ],
  "rising": [
    {"query": "kimi k3", "value": 10750, "formattedValue": "Breakout", "isBreakout": true, "link": "https://trends.google.com/trends/explore?q=kimi+k3&date=today+3-m&geo=US"}
  ]
}
```

A Trending Now row for the UK, from run `XBJhdCLvhfqzWaaK1`, with related searches cut to 5:

```json
{
  "type": "trendingNow",
  "country": "GB",
  "hours": 24,
  "status": "ok",
  "rank": 2,
  "query": "man city vs aek",
  "searchVolume": 50000,
  "increasePercent": 1000,
  "startedAt": "2026-10-20T17:50:00Z",
  "endedAt": null,
  "isActive": true,
  "categoryIds": [17],
  "categories": ["Sports"],
  "relatedQueries": ["aek athens", "elliot anderson", "aek athens f.c.", "aek", "man city – aek"],
  "exploreUrl": "https://trends.google.com/trends/explore?q=man+city+vs+aek&geo=GB&date=now+1-d",
  "trendId": "GB:man city vs aek:2026-10-20T17:50:00Z"
}
```

#### Output of the extra options

These rows come from run `FN6FJIO2hIkTuX729`, with lists cut to 3 entries.
Eight AI assistants on one scale in the US over the past 90 days, from 2 Google comparisons through the anchor `chatgpt`:

```json
{
  "type": "interestOverTime",
  "status": "ok",
  "comparisonIndex": 2,
  "keywords": ["chatgpt", "gemini", "claude", "perplexity", "copilot", "deepseek", "grok", "mistral"],
  "geo": "US",
  "timeRange": "today 3-m",
  "summary": "93 points, 8 keywords from 2 comparisons, averages chatgpt 67, gemini 27, claude 18, perplexity 1, copilot 5, deepseek 2, grok 4, mistral 0",
  "batchCount": 2,
  "anchorKeywords": ["chatgpt"],
  "batchExploreUrls": [
    "https://trends.google.com/trends/explore?q=chatgpt%2Cgemini%2Cclaude%2Cperplexity%2Ccopilot&date=today+3-m&geo=US",
    "https://trends.google.com/trends/explore?q=chatgpt%2Cdeepseek%2Cgrok%2Cmistral&date=today+3-m&geo=US"
  ],
  "averages": {"chatgpt": 67, "gemini": 27, "claude": 18, "perplexity": 1, "copilot": 5, "deepseek": 2, "grok": 4, "mistral": 0},
  "timeline": [
    {"date": "2026-07-17T00:00:00Z", "formattedTime": "Jul 17, 2026", "values": {"chatgpt": 63, "gemini": 23, "claude": 21, "perplexity": 1, "copilot": 5, "deepseek": 2, "grok": 3, "mistral": 0}, "isPartial": false},
    {"date": "2026-07-18T00:00:00Z", "formattedTime": "Jul 18, 2026", "values": {"chatgpt": 48, "gemini": 19, "claude": 15, "perplexity": 1, "copilot": 2, "deepseek": 1, "grok": 4, "mistral": 0}, "isPartial": false},
    {"date": "2026-07-19T00:00:00Z", "formattedTime": "Jul 19, 2026", "values": {"chatgpt": 45, "gemini": 15, "claude": 12, "perplexity": 1, "copilot": 3, "deepseek": 2, "grok": 4, "mistral": 1}, "isPartial": false}
  ]
}
```

US metro areas for `coffee, tea` with `regionResolution: "metro"`:

```json
{
  "type": "interestByRegion",
  "status": "ok",
  "keywords": ["coffee", "tea"],
  "geo": "US",
  "summary": "210 regions, top Cheyenne WY-Scottsbluff NE",
  "resolution": "DMA",
  "valueType": "share",
  "regions": [
    {"geoCode": "759", "geoName": "Cheyenne WY-Scottsbluff NE", "values": {"coffee": 73, "tea": 27}},
    {"geoCode": "678", "geoName": "Wichita-Hutchinson KS", "values": {"coffee": 68, "tea": 32}},
    {"geoCode": "744", "geoName": "Honolulu HI", "values": {"coffee": 70, "tea": 30}}
  ]
}
```

Cities have no code, so they come with coordinates:

```json
{"geoCode": null, "geoName": "Bagdad", "values": {"hurricane": 100}, "coordinates": {"lat": 30.5988048, "lng": -87.0310767}}
```

A pasted explore link keeps its own settings, here the Finance category (`cat=7`):

```json
{
  "type": "interestOverTime",
  "status": "ok",
  "comparisonIndex": 32,
  "keywords": ["mortgage rates", "inflation"],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 7,
  "inputUrl": "https://trends.google.com/trends/explore?cat=7&date=today%2012-m&geo=US&q=mortgage%20rates,inflation",
  "summary": "53 points, averages mortgage rates 54, inflation 10"
}
```

Research on `pickleball` with `researchMaxRelated: 5`, one related query and the free summary:

```json
{
  "type": "relatedTrend",
  "status": "ok",
  "researchKeyword": "pickleball",
  "query": "best pickleball paddles 2026",
  "relatedType": "rising",
  "relatedRank": 1,
  "relatedValue": 2800,
  "relatedFormattedValue": "+2,800%",
  "isBreakout": false,
  "summary": "53 points, average 40, growth -52.7%",
  "average": 40,
  "growthPercent": -52.7,
  "recentAverage": 34.3,
  "previousAverage": 72.5,
  "growthWindowPoints": 13,
  "timeline": [
    {"date": "2026-09-27T00:00:00Z", "formattedTime": "Sep 27 – Oct 3, 2026", "values": {"best pickleball paddles 2026": 19}, "isPartial": false},
    {"date": "2026-10-04T00:00:00Z", "formattedTime": "Oct 4 – 10, 2026", "values": {"best pickleball paddles 2026": 17}, "isPartial": false},
    {"date": "2026-10-11T00:00:00Z", "formattedTime": "Oct 11 – 17, 2026", "values": {"best pickleball paddles 2026": 15}, "isPartial": true}
  ]
}
```

```json
{
  "type": "researchSummary",
  "status": "ok",
  "researchKeyword": "pickleball",
  "summary": "5 of 5 related queries with data, highest growth rpm pickleball +19.9%",
  "seedGrowthPercent": -11.1,
  "relatedTrends": [
    {"query": "rpm pickleball", "relatedType": "rising", "status": "ok", "average": 47, "growthPercent": 19.9, "recentAverage": 68.5, "previousAverage": 57.2},
    {"query": "rpm pickleball paddle", "relatedType": "rising", "status": "ok", "average": 44, "growthPercent": 4.8, "recentAverage": 61, "previousAverage": 58.2},
    {"query": "tesla pickleball paddle", "relatedType": "rising", "status": "ok", "average": 18, "growthPercent": -19.6, "recentAverage": 15.5, "previousAverage": 19.2}
  ]
}
```

### How to read the numbers

Google Trends values are relative, not search counts.
In `interestOverTime`, 100 is the peak for the busiest keyword in the comparison, so keywords in one comparison share one scale.
In `interestByRegion`, a single keyword gets a 0 to 100 index per region (`valueType: "index"`).
With 2 or more keywords, each region shows how the searches split between them (`valueType: "share"`).
Rising related queries show percent growth, and `Breakout` means growth above 5,000%.
`searchVolume` in Trending Now is Google's rounded bucket, such as 50,000 or 500,000.

### Pricing

Prices are per 1,000 comparisons or searches.

| Event | No discount | Bronze | Silver | Gold |
|---|---|---|---|---|
| `trend_query`, a comparison of 1 to 5 keywords that returns data, with its timeline, regions and related queries | $1 | $1 | $1 | $1 |
| `trending_search`, one Trending Now search returned | $0.25 | $0.225 | $0.20 | $0.175 |
| No data, invalid input or failed fetch | Free | Free | Free | Free |

Bronze, Silver and Gold are Apify Store discount tiers, and Apify's Pricing tab shows them as Starter, Scale and Business.
Apify decides which tier an account is on.
Keyword comparisons cost the same on every tier.

The region and related-query rows come with the comparison at no extra cost, and so does a city or metro breakdown.
A pasted explore link is one comparison.
With more than 5 keywords, each Google comparison the scraper sends is one `trend_query`, charged only when it returns data.
That is 2 for 6 to 9 keywords, 3 for 10 to 13, and 1 more for every 4 keywords after that, up to 13 for 50.
In research, the seed keyword is one `trend_query`, and so is each related query whose timeline returns data, so `researchMaxRelated: 10` costs at most 11 per seed.
The `researchSummary` row is free.
Trending Now returns the top 50 searches per country by default, which costs $0.0125 per country, or $0.00875 on Gold.
Lower `trendingMaxItems` to pay for fewer.
Set a maximum cost per run in the run options, and the scraper stops when it is reached.

### Use it from AI agents

The scraper works as a tool through the [Apify MCP server](https://mcp.apify.com) in Claude, Cursor, VS Code and other MCP clients.
An agent can ask "is interest in X growing, and where?" and get the timeline, regions and rising searches in one call.
With `researchKeywords`, "what is rising around X?" also returns each rising search's own curve and growth in the same call.

You can also call it through the [Apify API](https://docs.apify.com/api/v2) or the Python and JavaScript clients, and schedule it or connect it to Make, Zapier and n8n.

### More from heyitsgautham

Other actors from the same account.

- [Etsy Products & Listings Scraper (Search, Shop, Category)](https://apify.com/heyitsgautham/etsy-products-scraper) for Etsy listings with price, sale price, shop and rating, for product and price research.
- [YouTube Search Results & Rank Tracker Scraper](https://apify.com/heyitsgautham/youtube-search-scraper) for YouTube search results with rank, to see which videos rank for a keyword that Trends shows rising.
- [Trustpilot Reviews & TrustScore Scraper](https://apify.com/heyitsgautham/trustpilot-reviews-scraper) for Trustpilot reviews and each company's TrustScore, for any business on any Trustpilot country site.
- [YouTube Video & Shorts Comments Scraper with Replies](https://apify.com/heyitsgautham/youtube-comments-scraper) for the comments and replies on a video or Short, for sentiment analysis and audience research.

### FAQ

**Why did a comparison come back as `no_data`?**
Google Trends only shows keywords with enough search volume.
Very rare keywords, small regions and short time ranges often have none.
Those rows are free.

**Why did a made-up keyword return a few points?**
For short time ranges and rare keywords, Google sometimes shows a sparse timeline with one or two non-zero points.
The website shows the same chart.
The scraper returns what Google returns, so that comparison counts as data.

**Why did a comparison come back as `error`?**
Google Trends sometimes rate limits its data, mostly when many requests reach it at the same moment.
The scraper then retries on a fresh residential IP, waiting longer each time, for about two minutes.
If Google still refuses, you get an `error` row that says so, the rest of the run carries on, and that comparison is free.
Running it again a few minutes later usually works.

**Does it return related topics?**
No.
Google stopped serving related topics to automated clients in 2026 and now returns an empty list, so this scraper returns related queries only.

**Why are my numbers slightly different from the website?**
Google samples its data, so the same query can shift by a few points between requests.
That happens on trends.google.com too.

**Why does a keyword at 0 or 1 look less exact in a comparison of more than 5?**
Google rounds every value to a whole number.
A keyword far below the top one rounds to 0 or 1, the same as it would on the website next to that top keyword.
In the measured pairs, the ratio between two such keywords was off by up to 23%, while the rest were within 3.6%.

**Which time zone are the dates in?**
UTC.

**Does it use an official Google API?**
No.
It reads the same public data the Google Trends website loads, without logging in.

### Limitations

- Up to 5 keywords per comparison, the same limit as the website, or up to 50 with `moreThanFiveKeywords`.
- Related topics are not available (see the FAQ).
- Cities appear only where Google has enough data, and metro areas exist only for the US.
- A Trends link that gives each keyword its own location or date returns a free `invalid_input` row.
- Trending Now covers the countries Google lists on trends.google.com/trending.

# Actor input Schema

## `comparisons` (type: `array`):

One comparison per line, with 1 to 5 keywords separated by commas, exactly like the compare box on trends.google.com. Turn on More than 5 keywords on one scale below for up to 50. Each comparison returns interest over time, interest by region and related queries. Through the API you can also pass objects such as {"keywords": \["tea", "coffee"], "geo": "GB", "timeRange": "today 5-y"} to override the settings below per comparison.

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

Country code such as US, GB or IN, or a region such as US-CA or GB-ENG. Leave empty for worldwide.

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

Same choices as the Google Trends website. Pick Custom to use the custom date range below.

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

Start and end date as YYYY-MM-DD YYYY-MM-DD, for example 2024-01-01 2024-06-30. Used when the time range is Custom. Data starts in 2004.

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

Google Trends category id. 0 means all categories. Common ids are 3 Arts and Entertainment, 5 Computers and Electronics, 7 Finance, 12 Business and Industrial, 18 Shopping, 20 Sports, 45 Health, 71 Food and Drink. The id is the cat= value in a trends.google.com URL.

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

Which Google search the data comes from.

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

Adds one row per comparison with countries (for worldwide) or subregions (for a country).

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

Adds one row per keyword with the top and rising related searches.

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

Default gives countries for worldwide and subregions such as US states for a country. City gives cities. Metro gives US metro areas (Nielsen DMA), only for US locations. Applies to the interest by region row.

## `moreThanFiveKeywords` (type: `boolean`):

Lets a comparison hold 6 to 50 keywords. Google compares at most 5, so the scraper fetches them in batches that share one anchor keyword and puts every keyword on one 0 to 100 scale. Each batch Google returns data for is one charged keyword comparison, so 9 keywords cost 2 and 13 cost 3.

## `trendsUrls` (type: `array`):

Paste links from trends.google.com. An explore link (trends.google.com/trends/explore?q=...) runs that comparison with its own location, time range, category and search type. A trending link (trends.google.com/trending?geo=US) returns Trending Now for that country, window and category.

## `researchKeywords` (type: `array`):

One keyword per line. For each one the scraper fetches its timeline, regions and related queries, then each related query's own timeline with its growth: the average of the last quarter of the time range against the quarter before (for 12 months, the last 3 months against the 3 before). Uses the location, time range, category and search type above. The keyword and each related query with data are one charged keyword comparison each.

## `researchMaxRelated` (type: `integer`):

How many related queries get their own timeline, at most 25. This caps the cost of one research keyword at 1 plus this number of keyword comparisons.

## `researchRelatedType` (type: `string`):

Rising first then top, rising only, or top only.

## `trendingCountries` (type: `array`):

Two-letter country codes such as US, IN or DE. Returns the searches trending right now in each country, like trends.google.com/trending.

## `trendingHours` (type: `string`):

Searches that started trending within this many hours.

## `trendingCategories` (type: `array`):

Only keep trending searches in these categories. Leave empty for all.

## `trendingActiveOnly` (type: `boolean`):

Drop searches whose trend has already ended.

## `trendingMaxItems` (type: `integer`):

Keeps the top N trending searches for each country. Each returned search is one charged trending_search event.

## `onlyNewSinceLastRun` (type: `boolean`):

For scheduled runs. Returns only the trending searches, among each country's top N above, that this actor has not returned to you before for the same country and categories. A search that starts trending again later counts as new. The first run returns the usual list and remembers it. Applies to Trending Now only, not to keyword comparisons. The memory is a key-value store named google-trends-scraper-monitor in your Apify account.

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

Language for region names, dates and categories, for example en-US, de or ja.

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

How many comparisons and countries to fetch in parallel.

## `useProxy` (type: `boolean`):

Leave on. Google Trends blocks cloud IPs.

## Actor input object example

```json
{
  "comparisons": [
    "chatgpt, gemini, claude",
    "bitcoin"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "includeInterestByRegion": true,
  "includeRelatedQueries": true,
  "regionResolution": "default",
  "moreThanFiveKeywords": false,
  "researchMaxRelated": 10,
  "researchRelatedType": "both",
  "trendingCountries": [
    "US"
  ],
  "trendingHours": "24",
  "trendingActiveOnly": false,
  "trendingMaxItems": 50,
  "onlyNewSinceLastRun": false,
  "language": "en-US",
  "maxConcurrency": 5,
  "useProxy": true
}
```

# Actor output Schema

## `trends` (type: `string`):

For each comparison, one interestOverTime row, one interestByRegion row and one relatedQueries row per keyword. For Trending Now, one row per trending search. Only comparisons and countries that return data are charged.

# 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 = {
    "comparisons": [
        "chatgpt, gemini, claude",
        "bitcoin"
    ],
    "trendingCountries": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("heyitsgautham/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 = {
    "comparisons": [
        "chatgpt, gemini, claude",
        "bitcoin",
    ],
    "trendingCountries": ["US"],
}

# Run the Actor and wait for it to finish
run = client.actor("heyitsgautham/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 '{
  "comparisons": [
    "chatgpt, gemini, claude",
    "bitcoin"
  ],
  "trendingCountries": [
    "US"
  ]
}' |
apify call heyitsgautham/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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