# Google Trends Scraper: Interest, Queries, Trending Now (`altronite/google-trends`) Actor

Google Trends API and scraper, a pytrends alternative: interest over time, interest by region (country, state, city, metro), related queries and topics (top, rising, breakout) and Trending Now by country. Compare up to 5 terms. Failed or empty terms are never charged.

- **URL**: https://apify.com/altronite/google-trends.md
- **Developed by:** [Altronite](https://apify.com/altronite) (community)
- **Categories:** SEO tools
- **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.

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: Interest, Queries, Trending Now

A Google Trends scraper and API that returns interest over time, interest by region, related queries (top and rising) and related topics for any search term, plus today's Trending Now searches for any country, as JSON, CSV or Excel. Compare up to 5 terms on one 0 to 100 scale, pick the location, time range and search type (Web, News, Image, YouTube or Shopping), and call it from code or an AI agent.

It works as a **pytrends alternative**: the same Trends data, but every 429 or block page swaps in a fresh session and retries with backoff, so you don't babysit rate limits.

**Terms that fail are never charged.** A term that still fails after every retry becomes an error row with the reason, free.

![One search term in, one row with interest over time, regions and related queries out](https://api.apify.com/v2/key-value-stores/aZVzOVjoal7bHifMa/records/google-trends-demo.gif)

### Who it's for

- **SEO and content**: spot rising related queries and seasonal peaks.
- **Market research**: is demand for a product or brand growing, seasonal or fading, and where?
- **Competitor tracking**: compare up to 5 terms on one 0-100 scale, e.g. `nike, adidas, puma`.
- **News monitoring**: daily trending searches with traffic estimates and the news behind them.
- **AI agents and pipelines**: structured JSON over the Apify API.

Coming from pytrends or a Google Trends API wrapper? Same kind of Trends JSON endpoints, with the retries, sessions and proxy handled for you.

### What you get

**One row per non-empty search-term group**, holding the requested sections that Google provides:

| Field | What it holds |
|---|---|
| `interestOverTime` | `date` (UTC), `formattedTime`, a 0-100 value per term, `isPartial` (true for the latest, unfinished period) |
| `interestByRegion` | `geoCode`, `geoName`, a 0-100 value per term. Only regions with data are included |
| `relatedQueries` | Per term: `top` and `rising` lists with `query`, `value`, `formattedValue` (e.g. `+3,300%` or `Breakout`) and a Trends `link` |
| `relatedTopics` | Same shape, with `topic`, `type` and Google's topic id `mid` |
| `status` | `ok`, `partial` (some sections failed, listed in `sectionErrors`), `no_data` (Google had no data for the term; not charged) or `error` (not charged) |
| Also | `searchTerm`, `terms`, `geo`, `timeRange`, `category`, `property`, `scrapedAt` |

A real row, trimmed (`saree, lehenga`, India, past 90 days):

```json
{
  "type": "searchTerm",
  "searchTerm": "saree, lehenga",
  "terms": ["saree", "lehenga"],
  "geo": "IN",
  "timeRange": "today 3-m",
  "category": 0,
  "property": "web",
  "status": "ok",
  "interestOverTime": [
    { "date": "2026-07-02T00:00:00+00:00", "formattedTime": "Jul 2, 2026", "values": { "saree": 62, "lehenga": 6 }, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "IN-KA", "geoName": "Karnataka", "values": { "saree": 93, "lehenga": 7 } }
  ],
  "relatedQueries": {
    "saree": {
      "top": [{ "query": "saree blouse", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=saree+blouse&date=today+3-m&geo=IN" }],
      "rising": [{ "query": "ghungroo saree", "value": 3300, "formattedValue": "+3,300%", "link": "https://trends.google.com/trends/explore?q=ghungroo+saree&date=today+3-m&geo=IN" }]
    }
  },
  "sectionErrors": {},
  "scrapedAt": "2026-10-02T23:04:42+00:00"
}
```

**Each Trending Now search is its own row**, with `geo`, `rank`, `title`, `approxTraffic` (e.g. `200+`), `pubDate`, `picture`, and `news` (a list of `title`, `url` and `source`).

Ready-made dataset views (**Interest over time**, **Interest by region**, **Trending now**) give flat tables for CSV or Excel.

### Use it from code or an AI agent

Run this actor with the Apify API, the Apify Python or JavaScript (JS) clients, or as a tool through the Apify MCP server. Pass the same input JSON through any of these interfaces.

Every output row has a `status` field; inspect it before processing the row. Term statuses are `ok`, `partial`, `no_data` or `error`.

Minimal input:

```json
{
  "searchTerms": [
    "saree"
  ]
}
```

### Coming from pytrends

| pytrends | This actor |
|---|---|
| `build_payload(kw_list=[...], geo='US', timeframe='today 12-m', cat=0, gprop='')` | one line in `searchTerms` with up to 5 comma-separated terms; `geo`, `timeRange`, `category`, `property` |
| `interest_over_time()` | `interestOverTime` (on by default) |
| `interest_by_region(resolution='CITY')` | `interestByRegion` + `regionResolution: "CITY"` |
| `related_queries()` / `related_topics()` | `relatedQueries` / `relatedTopics`, each with `top` and `rising` |
| `trending_searches(pn='united_states')` | `trendingNowGeos: ["US"]` (Google's Trending Now feed) |
| custom date range `'2025-01-01 2025-06-30'` | `customTimeRange` |

You get JSON rows, not pandas DataFrames. In Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("altronite/google-trends").call(run_input={
    "searchTerms": ["chatgpt, gemini, claude"], "geo": "US", "timeRange": "today 3-m",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] in ("ok", "partial") and row.get("interestOverTime"):
        print(row["searchTerm"], row["interestOverTime"][-1]["values"])
```

### How to scrape Google Trends data

1. **Search terms**: one query per line. To compare on one scale, put up to 5 on a line, comma-separated: `saree, lehenga`.
2. **Location**: an ISO code such as `US`, `IN`, `GB` or `US-CA`. Leave it empty for worldwide.
3. **Time range**: past hour up to 2004-present (default: 12 months), or a **Custom time range** `YYYY-MM-DD YYYY-MM-DD`.
4. **Category** (Google Trends category ID, 0 = all) and **Search type**: Web, News, Image, YouTube or Google Shopping (`froogle`, Google's internal name).
5. **What to collect**: toggle each section; region level Auto, Country, Region/state, City or Metro (DMA, US only).
6. **Trending now** (optional): 2-letter country codes. Works with no search terms.
7. **Reliability**: attempts per term (1-12, default 6) and proxy (Apify Proxy by default).

Example inputs:

Compare products by state in India for the past 12 months, plus today's trending searches:

```json
{ "searchTerms": ["saree, lehenga, kurti"], "geo": "IN", "timeRange": "today 12-m", "trendingNowGeos": ["IN"] }
```

Find rising related queries for a seed keyword (SEO and content research), related queries only:

```json
{ "searchTerms": ["standing desk"], "geo": "US", "timeRange": "today 3-m", "interestOverTime": false, "interestByRegion": false, "relatedTopics": false }
```

Google Trends Now (trending searches) for several countries, no search terms needed:

```json
{ "searchTerms": [], "trendingNowGeos": ["US", "GB", "IN"] }
```

YouTube search interest for a topic over the last 5 years:

```json
{ "searchTerms": ["python tutorial"], "property": "youtube", "timeRange": "today 5-y" }
```

### Pricing

This actor uses **pay-per-event** pricing: every run has a small start fee (`apify-actor-start`), charged once per run (per GB above 1 GB), plus a per-result charge (`result`). The rates are on the actor's Pricing tab.

- **One result** is one search-term row that delivered at least one section with real data, or one Trending Now item.
- **Not charged:** `error` rows (a term or trending feed that still failed after every attempt) and `no_data` rows (Google answered, but with no data at all: an all-zero timeline, no regions, no related items, as for very rare or misspelt terms).
- **Charged:** `ok` and `partial` rows, which carry at least one section with real data.

Example: 10 search-term lines plus a 10-item trending feed is at most 20 results.

### Reliability

- **On HTTP 429, a 5xx, a network error, or an HTML block page**, the actor discards the session (cookie and connection), opens a new one (with a new proxy session, if a proxy is used), waits with exponential backoff and jitter (up to 3 s at first, capped at 60 s), and retries the whole term.
- **A term that still fails** becomes an uncharged `error` row with the reason. The run continues.
- **A section that fails for a non-temporary reason** is listed in `sectionErrors`; the row is `partial` if another section has data, or an uncharged `error` if none does.
- **Pacing:** terms run one at a time, with a short random pause between data requests.
- **Invalid input** stops the run at the start with a message saying what to fix. No results are charged.
- **One failing data call** (for example related topics) is retried in place a few times before the whole term is redone, so sections already fetched are kept.
- **Close to the run's timeout** the actor stops starting new terms. The rest become uncharged `skipped` rows and the run ends normally instead of timing out.
- **The `OUTPUT` record counts every status** (`ok`, `partial`, `no_data`, `error`, `skipped`), so you can see how many terms returned data, not just whether the run succeeded.

If the proxy can't be set up, the actor logs a warning and continues without one, which makes rate limits more likely.

### Use cases

- **SEO and content strategist:** Pull `relatedQueries` for a seed keyword and scan the `rising` list for high-growth queries (like `Breakout`), using each row's Trends `link` to dig deeper before adding topics to the content calendar.

- **Online fashion retailer:** Compare up to five product terms on one line, such as `saree, lehenga, kurti`, for India over the past 12 months, then use `interestOverTime` to plan stock around seasonal peaks and `interestByRegion` to see which states to advertise in.

- **Market research analyst:** Run a brand name alongside its competitors for a given country, export the Interest over time and Interest by region dataset views to Excel, and build a report on whether demand is growing, seasonal or fading, and where it concentrates.

- **Newsroom editor:** Run a Trending Now search for your country each morning and use each item's `rank`, `title`, `approxTraffic` and the `news` list (with `url` and `source`) to pick stories for the morning editorial meeting and cite original coverage.

- **Automation or AI engineer:** Call the actor through the Apify API or MCP server from an agent or data pipeline; every row's `status` field lets the code tell success from failure without parsing text, and terms that fail after all retries show up as uncharged `error` rows.

- **Paid-media buyer:** Toggle region level to city or US metro (DMA) and use `interestByRegion` with its `geoCode` and 0-100 values to decide where to target campaigns and how to split budget across regions.

### FAQ

**Is it legal, and is it allowed?**
It uses Google Trends' public JSON endpoints (`/trends/api/...`), the public Trending Now RSS feed, and the Trends home page once per session for a cookie, all on trends.google.com. None of these paths is disallowed by that site's robots.txt. It doesn't log in and it paces its requests. This isn't legal advice: you're responsible for your use of the data and for following Google's terms. Not affiliated with Google.

**How fresh is the data?**
Nothing is cached: every run fetches live from Google. The latest time point is often `isPartial: true` because that period isn't over. Trending Now is Google's feed at run time.

**Are the numbers search volumes?**
No. Values are relative (0-100) within each query. Terms on one line share a scale; separate lines don't. `approxTraffic` on trending rows is Google's rough bucket, e.g. `200+`.

**Is there a Google Trends API?**
This actor gives you Google Trends data as JSON through the Apify API, the Python and JavaScript clients, or an MCP client, with the same input fields as the form. It uses Google Trends' public endpoints, so it is not an official Google API.

**How do I get Google Trends Now (trending searches) data?**
Put 2-letter country codes in `trendingNowGeos`. Each trending search is one row with `rank`, `title`, `approxTraffic`, `pubDate` and the related `news`. You can leave `searchTerms` empty.

**How do I find rising or breakout related queries?**
Keep `relatedQueries` on and read the `rising` list for each term. Values like `Breakout` or `+3,300%` mark the fastest growth.

**Why are related topics missing?**
Google doesn't always return them, especially for comparisons. Then the field is left out.

**Do I need a proxy?**
Apify Proxy is on by default, and every retry gets a new proxy session. Without a proxy, rate limits are more likely.

**How many terms per run?**
Up to 500 lines, each with up to 5 compared terms, run one after another.

**What's charged if Google blocks me?**
Nothing for blocked terms: only `ok` and `partial` rows and Trending Now items are charged.

### Limits

- Up to 500 lines of search terms per run. Terms after the 5th on a line are ignored.
- Up to 50 Trending Now countries per run, as 2-letter codes only (no `US-CA`).
- Custom ranges are whole days, start before end.
- Google is queried in English (`hl=en-US`), so formatted dates and topic types come back in English. Timestamps are UTC.
- Terms run one after another, so large runs take longer, especially under rate limiting.

### Related tools

- [Google Sheets Export & Import](https://apify.com/altronite/google-sheets-import-export): send any run's results to a Google Sheet.
- [YouTube Transcript Scraper](https://apify.com/altronite/youtube-transcripts): get video transcripts as text, SRT or VTT.

### Support

Term or region not working? Open an issue on the **Issues** tab with your input. Published by Altronite.

# Actor input Schema

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

One query per line. To compare terms on the same 0–100 scale, put up to 5 on one line separated by commas, e.g. 'saree, lehenga'.

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

ISO country or region code like US, IN, GB or US-CA. Leave empty for worldwide.

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

A preset range. For exact dates, use 'Custom time range' below instead.

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

Optional. Overrides Time range, e.g. '2025-01-01 2025-06-30'.

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

Google Trends category number (0 = all categories). For example 18 = Shopping, 71 = Food & Drink.

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

Which Google search the interest comes from.

## `interestOverTime` (type: `boolean`):

The timeline of relative interest (0–100).

## `interestByRegion` (type: `boolean`):

Relative interest per country, region, city or metro area.

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

Auto picks Google's default for the location (countries worldwide, regions inside a country).

## `relatedQueries` (type: `boolean`):

Top and rising related searches for each term.

## `relatedTopics` (type: `boolean`):

Top and rising related topics, when Google provides them for the query.

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

Optional. 2-letter country codes (e.g. US, IN) for today's trending searches with traffic estimates and news links.

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

On a rate limit the actor switches to a fresh session and tries again, up to this many times.

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

Apify Proxy is recommended. Each retry uses a new proxy session.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "chatgpt, gemini, claude"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "web",
  "interestOverTime": true,
  "interestByRegion": true,
  "regionResolution": "AUTO",
  "relatedQueries": true,
  "relatedTopics": true,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All rows: one per search-term group, or one per trending search. Use the dataset views for interest over time, by region and trending now.

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

Counts per status (ok, partial, no_data, error, skipped), trending items and failed or skipped feeds, billableResults and finishedAt.

# API

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

## JavaScript example

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

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

// Prepare Actor input
const input = {
    "searchTerms": [
        "web scraping",
        "chatgpt, gemini, claude"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("altronite/google-trends").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchTerms": [
        "web scraping",
        "chatgpt, gemini, claude",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("altronite/google-trends").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "web scraping",
    "chatgpt, gemini, claude"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call altronite/google-trends --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,altronite/google-trends"
        }
    }
}
```

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/6ZiziOs16QcWow9Tu/builds/jFJRnJl6pNdWZwak7/openapi.json
