# Google Trends Scraper: Compare Keywords, Trending Now, API (`datagleaner/google-trends-scraper`) Actor

Google Trends scraper and API: interest over time, interest by region, related queries and Trending Now for any number of keywords. Compares more than 5 terms on one scale. $1 per 1,000 results, pay per result, no rental. No login, no browser.

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

## Pricing

$1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Trends Scraper and API: compare keywords, related queries, Trending Now

**Give it any number of keywords and countries and get Google Trends interest over time, interest by region, related queries and topics, and the Trending Now list as JSON, CSV or Excel.** No login, no browser, no Google account. **$1 per 1,000 results, charged per result: no monthly rental.**

#### Why this one

- **Compare more than 5 keywords.** Google compares at most 5 terms at once. Give this Actor 50: it splits them into groups of up to 5, keeps the first term in every group as an anchor, and rescales each group so the values stay comparable (`scaledToAnchor`; the unscaled number is kept in `rawValue`).
- **You pay for results, not for waiting.** One flat price per dataset item. A related-queries or topics result that comes back empty is skipped and not charged, and an output type that fails entirely is not charged. `maxItems` and the run's maximum charge cap the bill.
- **Built for Google's rate limits.** Paced requests, then exponential backoff with a fresh session on HTTP 429 (`maxRetries`, default 6). One failing term never fails the run. A heavily throttled run can take a couple of minutes; the status message names any output that failed.
- **Trending Now in one call.** Current trending searches for a country with start time, search volume, growth and related queries, sorted by volume or start time, over 4, 24, 48 or 168 hours.
- **Paste a Google Trends link.** A `trends.google.com/trends/explore?q=...` URL in `searchTerms` runs with its terms, location, range, category and property.

#### Minimal input

```json
{"searchTerms": ["python", "javascript"], "geo": ["US"]}
```

#### Sample output rows

Interest over time, from a platform run on 2026-10-11 (timeline shortened to two of its weekly points):

```json
{
  "outputType": "interestOverTime",
  "searchTerm": "chatgpt",
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "average": 76.22,
  "peakValue": 100,
  "peakDate": "2025-10-19T00:00:00+00:00",
  "latestValue": 77,
  "groupIndex": 1,
  "scaledToAnchor": null,
  "timeline": [
    {
      "date": "2025-10-05T00:00:00+00:00",
      "value": 94,
      "rawValue": 94,
      "hasData": true,
      "isPartial": false
    },
    {
      "date": "2025-10-12T00:00:00+00:00",
      "value": 92,
      "rawValue": 92,
      "hasData": true,
      "isPartial": false
    }
  ],
  "scrapedAt": "2026-10-11T06:10:10+00:00"
}
```

Trending Now (`"mode": "trendingNow"`, related queries shortened):

```json
{
  "outputType": "trendingNow",
  "rank": 1,
  "title": "arch manning",
  "geo": "US",
  "startedAt": "2026-10-10T15:30:00+00:00",
  "searchVolume": 1000000,
  "growthPercent": 1000,
  "relatedQueries": [
    "ut vs ou",
    "oklahoma vs texas",
    "texas football"
  ],
  "categoryIds": [
    17
  ],
  "windowHours": 24,
  "input": {
    "geo": "US",
    "trendingHours": 24,
    "trendingSortBy": "searchVolume"
  },
  "scrapedAt": "2026-10-11T06:10:02+00:00"
}
```

#### Price

**$1 per 1,000 results** ($0.001 each). 40 terms x 2 countries x 2 outputs = 160 results = $0.16. A Trending Now run is 20 to 500 results depending on the window.

#### Limits

Google decides what it answers: `relatedTopics` is beta and often empty for automated requests, and Google can slow or block bursts of requests. Values are relative (0 to 100 per comparison), not search counts.

### Why use it

- **Compare more than 5 keywords.** Google compares at most 5 terms at once. Give this Actor 50 and it splits them into groups of up to 5, puts the first term (the anchor) in every group, and rescales each group to the first group's scale using the anchor's peak, so values from different groups can be compared. Each item says which group it came from and whether it was rescaled (`scaledToAnchor`); the unscaled number is kept in `rawValue`.
- **Handles Google's rate limits.** Requests are paced (`requestDelaySeconds`), and on HTTP 429 the Actor backs off and retries (`maxRetries`). One failing term never fails the run.
- **Trending Now mode.** The current trending searches for a country, with start time, search volume, growth and related queries, ordered by search volume or start time (`trendingSortBy`).
- **YouTube, News, Images and Shopping.** Set `property` to measure those Google surfaces instead of web search.
- **Paste a Google Trends URL.** A `trends.google.com/trends/explore?q=...` link in `searchTerms` runs with the terms, location, time range, category and property from that URL.
- **No browser.** Plain HTTP requests, so runs are light and fast.
- **Easy to consume.** camelCase fields, ISO 8601 dates, numbers as numbers, scalar summary columns (`average`, `peakValue`, `peakDate`, `latestValue`, `topRegion`, `topQuery`) next to the arrays.

### Use cases

Keyword and content research, SEO seasonality, market and product timing, news and PR monitoring, comparing regions, feeding trend data into an LLM or a dashboard.

### Input

```json
{
  "mode": "search",
  "searchTerms": ["python", "rust", "go", "java", "kotlin", "swift"],
  "geo": ["US", "GB"],
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "outputs": ["interestOverTime", "interestByRegion", "relatedQueries", "relatedTopics"],
  "regionResolution": "REGION"
}
```

| Field | Meaning |
|---|---|
| `mode` | `search` (default) or `trendingNow`. |
| `searchTerms` | Any number of terms. Duplicates are removed. |
| `geo` | Country or region codes (`US`, `DE`, `US-CA`). Empty means worldwide. Each location is run separately. |
| `timeRange` | Default `today 12-m`. `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`. |
| `customStartDate`, `customEndDate` | `YYYY-MM-DD`. When both are set they replace the preset. |
| `category` | Google Trends category ID. 0 is all. |
| `property` | `web`, `youtube`, `news`, `images`, `froogle`. |
| `outputs` | Any of `interestOverTime` (default), `interestByRegion`, `relatedQueries`, `relatedTopics`. One item is written per term, location and output. A related queries or topics result that comes back empty is skipped and not charged. `relatedTopics` is beta and often empty: Google withholds the data from automated requests. |
| `regionResolution` | `COUNTRY`, `REGION`, `CITY`, `DMA`. Applies to country-level locations; worldwide and sub-country searches use Google's native level. |
| `includeLowSearchVolumeRegions` | Also list regions with too little data. |
| `trendingHours` | Trending Now window: 4, 24, 48 or 168 hours (default 24). |
| `trendingSortBy` | Trending Now order: `searchVolume` (default, biggest first) or `startedAt` (newest first). |
| `maxItems` | Stop after this many dataset items, each one charged. 0 (default) means no limit. Useful in Trending Now mode, where one country can return several hundred trends. |
| `language` | Interface language for related query and topic names, such as `en-US` (default), `de`, `ja`. |
| `requestDelaySeconds`, `maxRetries` | Pacing (default 1.5 s) and attempts per request (default 6, maximum 15; a request is given up after that many tries). On 429 or a network error the wait starts at about 8 s and doubles up to about 45 s (with jitter), with a fresh session each time, so a throttled run can take a couple of minutes. If large batches keep hitting 429, raise `requestDelaySeconds` or turn on a residential proxy. |
| `proxyConfiguration` | Optional. Off by default, which works best: Apify's shared datacenter proxy is throttled by Google. Use a residential proxy only if a large batch keeps hitting 429. |

### Output

Interest over time (`outputType: "interestOverTime"`):

```json
{
  "outputType": "interestOverTime",
  "searchTerm": "rust",
  "geo": "US",
  "timeRange": "today 3-m",
  "category": 0,
  "property": "web",
  "average": 41.3,
  "peakValue": 66.2,
  "peakDate": "2026-08-14T00:00:00+00:00",
  "latestValue": 52.1,
  "groupIndex": 2,
  "scaledToAnchor": "python",
  "timeline": [
    {"date": "2026-07-07T00:00:00+00:00", "value": 39.0, "rawValue": 39, "hasData": true, "isPartial": false}
  ],
  "input": {"searchTerm": "rust", "geo": "US", "timeRange": "today 3-m", "category": 0, "property": "web"},
  "scrapedAt": "2026-10-07T15:54:54+00:00"
}
```

Other output types: `interestByRegion` (`resolution`, `topRegion`, `regions: [{geoCode, name, value}]`), `relatedQueries` and `relatedTopics` (`top` and `rising` arrays; rising entries have `isBreakout`), and `trendingNow` (`rank`, `title`, `startedAt`, `searchVolume`, `growthPercent`, `relatedQueries`, `categoryIds`, `windowHours`).

How values work: Google scales each comparison so its highest point is 100. Interest over time is rescaled across groups with the anchor as described above (the anchor's peak must be above zero in both groups; otherwise the item keeps its raw values and `scaledToAnchor` is `null`). Region values and related-query values are always relative to that one term, so they are not rescaled. Related topics need a separate request per term because Google leaves them out of multi-term comparisons.

### Pricing

Pay per event: one `result` event for each dataset item, at **$1 per 1,000 results**. The Actor stops pushing as soon as your maximum charge is reached.

With no `searchTerms`, the Actor runs an example: 2 terms (`python`, `javascript`), interest over time plus related queries, up to 4 items. The Console prefill is the same.

If an output type fails entirely (for example Google refuses every request), the run's status message names it, and nothing is charged for it.

Worked example: 40 terms, 2 countries, interest over time plus related queries is 40 x 2 x 2 = 160 results, about $0.16. A Trending Now run for one country is about 20 to 500 results depending on the window.

### Use with Python

`pip install apify-client`, set the `APIFY_TOKEN` environment variable, and run. This input returns 5 items (one timeline per term), under $0.01.

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("datagleaner/google-trends-scraper").call(run_input={
    "searchTerms": ["python", "javascript", "rust", "go", "kotlin"],
    "geo": ["US"],
    "timeRange": "today 12-m",
    "outputs": ["interestOverTime"],
})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["searchTerm"], item.get("average"), item.get("peakValue"), item.get("peakDate"))
```

### Use with JavaScript / Node.js

`npm install apify-client`, set `APIFY_TOKEN`, and run it as an ES module (`.mjs`).

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('datagleaner/google-trends-scraper').call({
    searchTerms: ['python', 'javascript', 'rust', 'go', 'kotlin'],
    geo: ['US'],
    timeRange: 'today 12-m',
    outputs: ['interestOverTime'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) console.log(item.searchTerm, item.average, item.peakValue, item.peakDate);
```

### Use it from n8n, Make, Zapier or an AI agent

Actor ID: `datagleaner/google-trends-scraper`

Minimal input:

```
{"searchTerms": ["python", "javascript"], "geo": ["US"]}
```

Each tool below runs this Actor with your own Apify API token.

- **n8n:** add the **Apify** node (`@apify/n8n-nodes-apify`). On n8n Cloud you install it from the community node registry. Choose **Run an Actor and get dataset**, set Actor to `datagleaner/google-trends-scraper` and paste the input above.
- **Make:** use the Apify app's **Run an Actor** module, then **Get Dataset Items** to read the results. **Watch Actor Runs** can trigger a scenario when a run finishes.
- **Zapier:** use the Apify action **Run Actor**, then the search **Fetch dataset items**. The trigger **Finished Actor run** starts a Zap when a run ends.
- **AI agents (MCP):** connect to `https://mcp.apify.com?tools=datagleaner/google-trends-scraper`. In Claude Code:

  ```
  claude mcp add --transport http apify "https://mcp.apify.com?tools=datagleaner/google-trends-scraper"
  ```

  Then run `/mcp` to sign in to Apify in your browser. To use an Apify token instead, add `--header "Authorization: Bearer YOUR_APIFY_TOKEN"`. Clients that take a remote server URL in an `mcpServers` config use `{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=datagleaner/google-trends-scraper"}}}`. Then ask in plain language, for example: "Pull Google Trends interest over the past 12 months in the US for air fryer, rice cooker and slow cooker, plus their rising related queries, and tell me which one is growing fastest." An agent without the Actor preloaded can find it with Apify's `search-actors` tool by searching "google trends".
- **LangChain (Python):**

```python
## pip install langchain-apify, then set APIFY_TOKEN in your environment
import json
from langchain_apify import ApifyActorsTool
tool = ApifyActorsTool("datagleaner/google-trends-scraper")
result = tool.invoke({"run_input": json.loads('{"searchTerms": ["python", "javascript"], "geo": ["US"]}')})
```

### Limits

- Google rate-limits Trends requests. Without a proxy, a 40-term, 2-country, 3-output batch (264 requests) finished with every result in about 14 minutes, with the Actor backing off on 429. Apify's shared datacenter proxy does worse than no proxy, and a very large batch may need a residential proxy.
- Google's data is sampled and normalised; it is a relative index, not search counts (Trending Now search volumes are Google's rounded buckets).
- Region data for a term with very low interest can be empty.

### FAQ

**Is this a Google Trends API?** It works as one: call it over the Apify API or from Python and Node.js (examples above) and get the same Trends data as JSON. No Google account or API key is needed; only public Trends data is read.

**Can I compare more than 5 keywords in Google Trends?** Yes. Give any number of `searchTerms`; the Actor groups them in fives around the first term and rescales every group to one scale, so all terms are comparable.

**How do I export Google Trends data to CSV or Excel?** Export the run's dataset as CSV or Excel. The scalar columns are flat and the arrays (such as `timeline`) are JSON text in their cell.

**Why do values for the same term differ between runs?** Google samples its data and the index depends on the other terms in the comparison. Use the anchor to compare across groups.

**Is the data real time?** `now 1-H` and Trending Now with `trendingHours: 4` are close to real time.

### Responsible use

The Actor collects only data that Google Trends shows publicly and contains no personal data. You are responsible for using the output lawfully and in line with Google's terms and the rules that apply to you.

# Actor input Schema

## `mode` (type: `string`):

search: interest data for your search terms. trendingNow: what is trending right now in each country.

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

Any number of terms. More than 5 are split into groups that share an anchor term (the first term), so values stay comparable across groups. You can also paste a Google Trends explore URL (trends.google.com/trends/explore?q=...): it runs with the terms, location, time range, category and property in that URL.

## `geo` (type: `array`):

Country or region codes such as US, GB, DE, US-CA, GB-ENG. Leave empty for worldwide (search mode). Trending now needs a country code and defaults to US.

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

Preset range. Ignored when both custom dates are set.

## `customStartDate` (type: `string`):

YYYY-MM-DD. Use together with the end date to override the preset.

## `customEndDate` (type: `string`):

YYYY-MM-DD.

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

Google Trends category number. 0 is all categories; for example 5 is Computers & Electronics, 7 is Finance, 45 is Health.

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

Which Google search surface to measure.

## `outputs` (type: `array`):

One dataset item is written per term per location per output. A related queries or topics result that comes back empty is skipped, so you are not charged for it.

## `outputShape` (type: `string`):

perOutput: one dataset item per term per location per output (a series, a region list and related queries are separate items, each charged). perTerm: one item per term per location holding every output you selected, charged once.

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

Level of detail for interest by region. Country-level searches support REGION, CITY and DMA; worldwide supports COUNTRY.

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

Also list regions where Google has too little data (value 0).

## `trendingHours` (type: `integer`):

Trending now mode: Google offers 4 (close to real time), 24 (the daily list), 48 and 168 (a week).

## `trendingSortBy` (type: `string`):

Trending now mode: rank by search volume (biggest trends first) or by start time (newest first).

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

Interface language code that shapes related query and topic names, for example en-US, de, ja.

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

Stop after this many dataset items (each one is charged). 0 means no limit. Useful in Trending now mode, where one country can return several hundred trends.

## `requestDelaySeconds` (type: `number`):

Pause between requests to Google. Raise it if you see many 429 retries.

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

On HTTP 429 or a network error the Actor waits with exponential backoff, gets a fresh cookie (and a new proxy session) and retries.

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

Optional, off by default. The run's own IP handled 260 requests in testing, while Apify's shared datacenter proxy got HTTP 429 on most of them. Use a residential proxy only if a large batch keeps hitting 429.

## Actor input object example

```json
{
  "mode": "search",
  "searchTerms": [
    "python",
    "javascript"
  ],
  "geo": [
    "US"
  ],
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "outputs": [
    "interestOverTime",
    "relatedQueries"
  ],
  "outputShape": "perOutput",
  "regionResolution": "REGION",
  "includeLowSearchVolumeRegions": false,
  "trendingHours": 24,
  "trendingSortBy": "searchVolume",
  "language": "en-US",
  "maxItems": 0,
  "requestDelaySeconds": 1.5,
  "maxRetries": 6
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "python",
        "javascript"
    ],
    "geo": [
        "US"
    ],
    "outputs": [
        "interestOverTime",
        "relatedQueries"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datagleaner/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": [
        "python",
        "javascript",
    ],
    "geo": ["US"],
    "outputs": [
        "interestOverTime",
        "relatedQueries",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("datagleaner/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": [
    "python",
    "javascript"
  ],
  "geo": [
    "US"
  ],
  "outputs": [
    "interestOverTime",
    "relatedQueries"
  ]
}' |
apify call datagleaner/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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