# Google Trends Scraper & API – Pay Only for Results (`solidscrapers/google-trends-scraper`) Actor

Google Trends API alternative: interest over time, by country/region/city, related & rising queries, keyword comparisons and daily trending searches. Automatic retries, no hanging runs, and failed terms are never charged.

- **URL**: https://apify.com/solidscrapers/google-trends-scraper.md
- **Developed by:** [SolidScrapers](https://apify.com/solidscrapers) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.
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 & API – Pay Only for Results

**Google Trends data without the failed runs.** Get interest over time, interest by country / region / city, related queries (top, rising and *Breakout*), keyword comparisons and today's **trending searches** for any country – as JSON, CSV or Excel, or straight from the API.

You pay **only for results that arrive**. Terms that fail or have no data in Google Trends are never charged.

### Why this Google Trends scraper?

- ✅ **Built for reliability** – the Actor adapts its speed to Google: it slows down as soon as Google pushes back and speeds up again when it can. Throttled requests are retried with a new IP and cookies (up to 8 times), with residential fallback.
- 💸 **Only successful results are charged** – failed terms, terms without data and skipped terms are listed in a separate `ERRORS` record, never in your dataset or your bill.
- ⏱️ **No hanging runs** – hard time limits per term; every term finishes or fails within minutes.
- 🛑 **Safe with a maximum cost** – you are never charged above it; if Apify stops the run at your limit, the results so far are kept and the terms not processed are listed in `ERRORS`, ready for your next run.
- ♻️ **Never charges twice** – duplicate terms are skipped, and if Apify migrates or restarts the run, finished terms are not scraped or charged again.
- 🔗 **Paste any Google Trends link** – classic or new explore page, any country domain, comparisons, *Trending now* links.
- 🤖 **Friendly to AI agents and no-code tools** – accepts `Spain` or `ES`, `past 7 days` or `now 7-d`, `bitcoin, ethereum` in one line.

### What Google Trends data can I get?

| Data | Description |
|---|---|
| **Interest over time** | The 0–100 popularity curve with ISO dates, timestamps and a "partial data" flag for the latest point |
| **Average interest** | Mean of the curve (or Google's own averages when comparing terms) |
| **Interest by region** | Countries, regions/states, US metro areas (DMA) or cities (with coordinates – see the notes below) |
| **Related queries** | Top and rising queries, rising %, *Breakout* flag and links |
| **Related topics** | Optional – Google limits this list for automated access, so it is often empty (see the notes below) |
| **Keyword comparison** | Up to 5 terms, regions or periods on the same scale |
| **Trending now** | Today's top trending searches per country (Google's feed lists about 10): title, approximate traffic, time, picture and related news |

Filters: country or region (`US`, `US-CA`, `GB-ENG`…), any time range from the past hour to 2004–present (including custom dates and hours), category, and search property (Web, Images, News, Google Shopping, YouTube).

### Popular use cases

- **SEO and content marketing** – find rising queries and seasonal peaks before writing.
- **Keyword research** – compare keywords and pick the one people actually search for.
- **Market and competitor research** – track brands, products and categories by country.
- **E-commerce** – spot demand spikes and plan stock and campaigns.
- **Finance and crypto** – follow interest in tickers, coins and topics over time.
- **Newsrooms and social media** – monitor today's trending searches per country.
- **AI agents and dashboards** – feed fresh trend data to LLMs, Google Sheets or BI tools on a schedule.

### How to scrape Google Trends

1. Add one or more **search terms** – or paste **Google Trends URLs**.
2. Choose the **country** (empty = worldwide) and the **time range**; optionally a category or property.
3. Optional: tick **Compare terms** (up to 5 on one scale) or add countries under **Trending now**.
4. Click **Start**, then download the results (JSON, CSV, Excel, XML) or get them via API.

Input values can be written the way people – and AI agents – naturally write them:

- **Countries**: codes (`ES`, `US-CA`), names (`Spain`, `España`, `United Kingdom`) or locales (`es-ES`).
- **Periods**: Google codes (`today 12-m`), words (`past 7 days`, `5 years`, `all time`), dates (`2024-01-01 2024-06-30`) or hours (`2026-10-01T10 2026-10-03T22`).
- **Terms**: one per row, or several in one row separated by commas.

#### Input example

```json
{
  "searchTerms": ["bitcoin", "ethereum"],
  "compareTerms": true,
  "geo": "US",
  "timeRange": "today 12-m",
  "regionResolution": "REGION",
  "includeRelatedQueries": true,
  "trendingNowGeos": ["US", "ES"]
}
```

#### Output example

```json
{
  "type": "keyword",
  "searchTerm": "iphone",
  "geo": "US",
  "timeRange": "today 3-m",
  "averageInterest": 44.0,
  "interestOverTime": [
    { "date": "2026-07-07T00:00:00Z", "timestamp": 1783382400, "formattedTime": "Jul 7, 2026", "value": 42, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "US-KS", "geoName": "Kansas", "value": 100 }
  ],
  "regionResolution": "REGION",
  "relatedQueries": {
    "top": [{ "query": "iphone 18", "value": 100, "formattedValue": "100" }],
    "rising": [{ "query": "iphone duo release date", "value": 5600, "formattedValue": "Breakout", "breakout": true }]
  },
  "exploreUrl": "https://trends.google.com/trends/explore?q=iphone&date=today+3-m&hl=en-US&geo=US",
  "scrapedAt": "2026-10-07T10:22:08Z"
}
```

In comparison mode (`"type": "comparison"`) each point has a `values` object with one number per term, and related queries are grouped by term. Trending searches come as `"type": "trendingNow"` items.

#### Errors and terms without data

They are kept out of the dataset. Open the run's **Storage → Key-value store → ERRORS** record (types: `noData`, `query` or `trendingNow` failures, and `skipped` / `interrupted` terms when a run was stopped):

```json
[
  { "type": "noData", "searchTerms": ["zxqv kettle"], "error": "Google Trends has no data for this term with these settings (try a longer period or a wider region).", "at": "2026-10-07T10:22:08Z" }
]
```

### Use it as a Google Trends API

Call the Actor from your code with the official Apify clients and get the results as JSON.

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("solidscrapers/google-trends-scraper").call(
    run_input={"searchTerms": ["bitcoin"], "geo": "US", "timeRange": "today 3-m"}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["searchTerm"], item["averageInterest"])
```

**JavaScript / Node.js**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('solidscrapers/google-trends-scraper').call({
    searchTerms: ['bitcoin'], geo: 'US', timeRange: 'today 3-m',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

It also works with **n8n, Make, Zapier, Google Sheets**, webhooks and schedules, and with AI agents (Claude, ChatGPT and others) through the **Apify MCP server**.

### Pricing

Pay per result – no subscription, no charge for failures:

| Your Apify plan | Price per 1,000 results |
|---|---|
| Free | $1.00 |
| Starter (Bronze) | $0.80 |
| Scale (Silver) | $0.65 |
| Business (Gold) | $0.50 |

A result is one search term (or one comparison group) with all the sections you selected, or one trending search. Failed terms, terms without data and skipped terms are **never charged**. You can set a maximum cost per run in the run options – you will never pay more than that.

### FAQ

**Is there an official Google Trends API?**
Google's official Trends API is still in limited alpha with a waiting list. This Actor reads the same public data the Google Trends website shows and gives it to you as an API today.

**Is it legal to scrape Google Trends?**
The Actor only collects publicly available, aggregated data (no personal data). Use the data in line with the laws that apply to you and Google's terms; when in doubt, ask a lawyer.

**Why are the values between 0 and 100?**
Google Trends shows relative interest, not absolute search volume: 100 is the peak for the chosen terms, place and period. Compare terms in one run to put them on the same scale.

**Why do I get fewer cities than the website shows?**
Google Trends gives automated tools less detail at city level than it shows in a browser, especially outside the US and for less popular terms. Ticking **Include low search volume regions** can add more cities for popular terms (in our tests: 1 → 11 cities for *bitcoin* in Spain), but less popular terms may still get few or none. Region level (states, provinces) and US metro areas (DMA) are complete. When a result has few cities, its `notes` field says so – you always know what you got.

**Why did a term return no data?**
Very rare terms, very short periods or very small regions may have no data in Google Trends. Such terms are listed in `ERRORS` and are not charged – try a longer period or a wider region.

**What happens when my maximum cost is reached?**
Apify stops the run at your limit, so you never pay more than you set. The results stored so far stay in the dataset, and the terms that were not processed are listed in `ERRORS` – start a new run with just those terms to get the rest. (If a run is stopped by a timeout or aborted by hand instead, you can **resurrect** it: it continues where it stopped and finished terms are not scraped or charged again.)

**Can I schedule it?**
Yes – create a task and a schedule in Apify (e.g. daily), and send the results to Google Sheets, a webhook, n8n or Make.

**Do I need my own proxies?**
No. The Actor uses Apify Proxy and switches to residential proxies automatically when needed.

### Notes and limits

- Google Trends values are **relative** (0–100), not absolute search volumes.
- Very short periods (`now 1-H`, `now 4-H`) and small regions may return few or no data points.
- If a region resolution is not available for the chosen place (e.g. *Country* for `US-CA`), Google's default resolution is used instead of failing.
- **City-level data and related topics are limited by Google for automated access.** Interest over time, regions, metro areas and related queries are not affected. Results with little city data or no related topics carry a `notes` field explaining it.
- **Trending now** returns the searches in Google's trending feed for each country (about 10 per country), not the full list of the *Trending now* page.
- This is an independent tool: it is not affiliated with, endorsed or sponsored by Google. "Google" and "Google Trends" are trademarks of Google LLC.

### Support

Found a problem or need a feature? Open an issue on the **Issues** tab – include your input and the run link – and it will be answered quickly.

# Actor input Schema

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

Keywords to look up on Google Trends: one per line, or several in one line separated by commas. Each term becomes one result (unless you enable comparison).

## `compareTerms` (type: `boolean`):

Group the search terms in sets of up to 5 and return them on the same relative scale, like the comparison view on trends.google.com.

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

Paste Google Trends links: explore pages (classic or new, any country domain, comparisons) or Trending now links. Terms, country, period, category and property are read from each link.

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

Country or region as a code or a name, such as ES, Spain, US, US-CA or GB. Leave empty for worldwide.

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

Preset period. For exact dates use the custom range field below. You can also type a period such as "past 7 days" or "5 years".

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

Overrides the preset. Dates: "2025-01-01 2025-12-31". Hours (UTC): "2026-10-01T10 2026-10-03T22".

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

Google Trends category number (0 = all categories). You can copy it from the cat= value of a Trends URL.

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

Which Google search to analyse.

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

The 0-100 popularity curve for the chosen period.

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

Popularity broken down by country, region or city.

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

Breakdown level for interest by region. Auto uses Google's default (countries for worldwide, regions inside a country).

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

Also return places with little search volume, like the checkbox of the same name on trends.google.com. Can add more cities for popular terms; values for small places are less reliable.

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

What else people search for, including Breakout queries.

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

Related topics (Google often returns this list empty).

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

Countries (codes or names, e.g. ES, US, Spain) to fetch today's trending searches with traffic estimates and news links. Works with or without search terms.

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

Interface language for labels such as formatted dates (e.g. en-US, es-ES).

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

How many terms to process at the same time. Higher is faster but more likely to be throttled by Google.

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

Proxies used to reach Google Trends.

## `residentialFallback` (type: `boolean`):

After repeated blocks, retry through residential proxies automatically (if your account has access).

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin",
    "ethereum"
  ],
  "compareTerms": false,
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "AUTO",
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": false,
  "language": "en-US",
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# Actor output Schema

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

Dataset with one item per search term, comparison group or trending search. Only these items are charged.

## `errors` (type: `string`):

Terms that failed, had no data or were skipped (never charged), with the reason.

# 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": [
        "bitcoin",
        "ethereum"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidscrapers/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": [
        "bitcoin",
        "ethereum",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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