# Google Trends Scraper: Interest, Related and Rising Queries (`tan-solutions/google-trends`) Actor

Google Trends scraper and API alternative: interest over time for up to 20 terms on one scale (anchor chaining), related and rising queries, and the rising queries new since your last run. One row per term set; failed sets are free. Not affiliated with Google.

- **URL**: https://apify.com/tan-solutions/google-trends.md
- **Developed by:** [Tan Solutions](https://apify.com/tan-solutions) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 term group delivereds

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: Interest, Related and Rising Queries

Google Trends scraper and API alternative: get interest over time for up to 20 search terms on one scale, the related
top and rising queries for each term, and, if you want, only the rising queries that are new since your last run. You
get one clean row per term set, ready for a spreadsheet, a dashboard or an AI agent. Failed sets are free.

Not affiliated with Google: this Actor is not affiliated with, endorsed by or sponsored by Google LLC. It reads the
public Google Trends data that anyone can see in a browser.

### Run it from the API or on a schedule

Get the rows back in one call (replace `<YOUR_API_TOKEN>` with your Apify API token from Console, **Settings**,
**API & Integrations**):

```bash
curl -X POST "https://api.apify.com/v2/acts/tan-solutions~google-trends/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms":["web scraping, data extraction"],"geo":"US","timeRange":"today 12-m","monitorNewRising":true}'
```

Send `{}` (no input) to try it on one term.

Check the same terms every Monday at 07:00 UTC with an Apify schedule. With `monitorNewRising` on, each run flags the
rising queries that were not there the week before (Ng9SU5FxSeLkCklvD is this Actor's ID):

```bash
curl -X POST "https://api.apify.com/v2/schedules?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name": "google-trends-weekly", "cronExpression": "0 7 * * 1", "timezone": "UTC", "isEnabled": true, "isExclusive": true,
       "actions": [{"type": "RUN_ACTOR", "actorId": "Ng9SU5FxSeLkCklvD",
         "runInput": {"body": "{\"searchTerms\":[\"web scraping, data extraction\"],\"geo\":\"US\",\"timeRange\":\"today 12-m\",\"monitorNewRising\":true}", "contentType": "application/json"}}]}'
```

In Apify Console the same is: **Schedules**, **Create new**, cron `0 7 * * 1`, add this Actor with your input.

### What it does

- **Interest over time** for every term, 0 to 100, exactly as Google Trends shows it, plus the average per term.
- **Up to 20 terms on one scale.** Google compares at most 5 terms at a time. For more, the Actor uses the first term
  as an anchor in every group of 5 and rescales the groups so all terms share one scale (anchor chaining). The row
  shows the anchor and the factors it used.
- **Related queries**, top and rising, for each term.
- **New rising queries since your last run** (monitor): the first run records a baseline, every later run lists only
  the rising queries it has not seen before for the same terms, country and time range.
- **Country or region, time range, category and search type** (web, images, news, Google Shopping, YouTube).
- **Polite and honest:** about one request per second, a pause between term sets, the public Google Trends data only.
  If Google refuses a set, the set is not charged and the row says why.

### Quick start

1. Click **Start** with the default input to see one row for "web scraping".
2. Put your own terms in **Search terms**: one line per term set, terms on a line separated by commas.
3. Pick a **Country or region** and a **Time range**, then start the run.
4. Download the rows as JSON, CSV or Excel, or read them through the API.

### Input

| Field | What it does |
| --- | --- |
| Search terms | One line = one term set = one row. Separate terms on a line with commas to compare them (up to 20). |
| Country or region | Empty = worldwide, or a code like `US`, `GB` or `US-CA`. |
| Time range | Past hour up to all time since 2004; default: past 12 months (`today 12-m`). |
| Custom dates (optional) | `YYYY-MM-DD YYYY-MM-DD`; overrides the time range. |
| Category | Google Trends category number; 0 = all categories. |
| Search type | Web search (default), image, news, Google Shopping or YouTube search. |
| Related and rising queries | On by default; off makes runs faster when you only need the timeline. |
| Flag rising queries that are new since the last run | Turns on the monitor (see above). |
| Monitor name | Keeps separate monitors apart; the store is called `google-trends-monitor-<name>`. |
| Term sets with their own settings (advanced) | A list like `[{"terms": ["coffee", "tea"], "geo": "GB"}]` for sets with their own country or time range. |
| Max term sets per run | Default 50, at most 1,000. Extra sets are skipped and the run says so. |
| Proxy | Apify Proxy; each term set gets its own proxy session. |

### Output

One row per term set. Example (shortened to two points per term):

```json
{
  "status": "ok",
  "setIndex": 0,
  "terms": ["web scraping", "data extraction"],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "anchor": null,
  "chainFactors": null,
  "interestOverTime": [
    {"term": "web scraping", "average": 61.5, "points": [
      {"date": "2025-11-16", "value": 58, "hasData": true, "partial": false},
      {"date": "2025-11-23", "value": 65, "hasData": true, "partial": false}]},
    {"term": "data extraction", "average": 23, "points": [
      {"date": "2025-11-16", "value": 22, "hasData": true, "partial": false},
      {"date": "2025-11-23", "value": 24, "hasData": true, "partial": false}]}
  ],
  "relatedQueries": [
    {"term": "web scraping", "top": [{"query": "web scraping python", "value": 100, "formatted": "100"}],
     "rising": [{"query": "web scraping ai", "value": 250, "formatted": "+250%"}], "risingNew": ["web scraping ai"]},
    {"term": "data extraction", "top": [{"query": "pdf data extraction", "value": 100, "formatted": "100"}],
     "rising": [], "risingNew": []}
  ],
  "monitorBaseline": false,
  "chargedGroups": 1,
  "source": "Google Trends (public data)",
  "capturedAt": "2026-11-14T09:00:00.000Z"
}
```

- `status`: `ok`, `partial` (some term groups came back, see `error`), `empty` (Google has no data for these terms;
  free) or `failed` (free; `error` says why and what to do).
- `interestOverTime[].points[].partial` is true for the latest, still incomplete period, as in Google Trends.
- `risingNew` is `null` when the monitor is off; on the first monitored run it is `[]` and `monitorBaseline` is true.
- `chargedGroups`: how many term groups this row was charged for (0 = free).

### Pricing

Pay per event: you pay once per group of up to 5 terms that came back with data (the `term-set` event). A set of 1 to
5 terms is 1 group, 6 to 9 terms is 2, 10 to 13 is 3, and 20 terms is 5 groups. Example: one 3-term set and one
20-term set cost 1 + 5 = 6 groups. Each set is still one row, and the row shows `chargedGroups`.

| Apify plan | Price per 1,000 term groups |
| --- | --- |
| Free | $4.00 |
| Bronze | $3.30 |
| Silver | $3.00 |
| Gold | $2.50 |
| Platinum and Diamond | $1.80 |

Free: `empty` and `failed` rows. If Google stops answering part way through a big set, you pay only for the groups
that came back, and the row lists the terms that are missing. A set starts only when all its groups fit in your
spending limit; when the limit is reached the run stops cleanly and tells you so.

### Limits

- Up to 20 terms per term set (Google compares 5 at a time; more terms are linked by the anchor term).
- Up to 50 term sets per run by default, at most 1,000.
- About one request per second and a 3-second pause between term sets, so a run of 50 single-term sets takes a few
  minutes.
- Values are relative (0 to 100) as Google Trends reports them, not search volumes. Sets with very little search
  interest come back `empty` and are free.
- The anchor should be a term with steady interest; if it has no interest in a group, the set cannot be put on one
  scale and fails free.

### Use cases

- Compare brands, products or competitors on one scale, up to 20 at a time.
- Find rising topics for content, SEO and keyword research every week with the monitor.
- Feed demand signals into dashboards, spreadsheets or a Google Trends API workflow for AI agents.

### FAQ

**Is this the official Google Trends API?** No. This Actor is not a Google product. It reads the public Google
Trends data and works as a Google Trends API alternative: one API call or schedule gives you clean rows.

**Why did a set fail?** Google sometimes refuses or does not answer. The Actor waits and retries politely, never
solves challenges, and marks the set `failed` with a plain reason. Failed sets are free; run them again later.

**Why are the values not search volumes?** Google Trends only publishes relative interest (0 to 100 within the set,
place and time range).

### Your responsibilities

- You are responsible for lawful use of the data and for following Google's terms that apply to you.
- Data is public aggregate Google Trends data as Google returns it; it may be incomplete, sampled or delayed. No
  warranty. Liability is capped at the fees you paid in the last 12 months.
- "Google" and "Google Trends" are used only to describe the data source. No Google logos or colours are used.
- Questions and issues are answered within 14 days through the Actor's Issues tab.

### Related tools by Tan Solutions

- [URL to Markdown](https://apify.com/tan-solutions/url-to-markdown): web pages to clean Markdown for LLMs, RAG pipelines and AI agents.
- [Document to Markdown](https://apify.com/tan-solutions/document-to-markdown): PDF, Word and PowerPoint files to Markdown for LLMs and RAG.
- [SEO Audit Tool](https://apify.com/tan-solutions/seo-audit): on-page SEO checker with PageSpeed for any list of pages.
- [Domain Intelligence](https://apify.com/tan-solutions/domain-intel): DNS, WHOIS/RDAP, SSL and tech stack for up to 1,000 domains.
- [US Company Filings & Financials](https://apify.com/tan-solutions/company-filings): 10-K, 10-Q, 8-K filings and XBRL facts by ticker.

Made by Tan Solutions.

# Actor input Schema

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

One line = one term set (one row). Put several terms on one line, separated by commas, to compare them on one scale (for example: chatgpt, gemini, claude). Up to 20 terms per line: above 5, the first term is the anchor that links the groups, so pick a steady, popular term first. Empty = one example set (web scraping).

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

Two-letter country code (US, GB, DE) or a region code (US-CA). Empty = worldwide.

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

Period for interest over time and related queries.

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

Start and end date as "YYYY-MM-DD YYYY-MM-DD", for example "2024-01-01 2024-12-31". Overrides Time range.

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

Google Trends category number. 0 = all categories.

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

Which Google search the interest comes from.

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

Add the top and rising related queries for every term.

## `monitorNewRising` (type: `boolean`):

Remembers the rising queries of each term set in a named key-value store in your account. The first run records a baseline; later runs list the new ones in risingNew. Use it with a schedule.

## `monitorName` (type: `string`):

Keeps separate monitors apart (a-z, 0-9 and "-"). The store is called google-trends-monitor-<name>.

## `termSets` (type: `array`):

Optional list of objects, each with "terms" and optionally its own "geo", "timeRange", "category" and "property". Example: \[{"terms": \["coffee", "tea"], "geo": "GB", "timeRange": "today 5-y"}]

## `maxTermSets` (type: `integer`):

Stops after this many term sets (1 to 1000).

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

Apify Proxy. Each term set gets its own proxy session.

## Actor input object example

```json
{
  "searchTerms": [
    "coffee",
    "chatgpt, gemini, claude"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeRelatedQueries": true,
  "monitorNewRising": false,
  "monitorName": "default",
  "maxTermSets": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per term set: interest over time per term (on one scale), related top and rising queries, the rising queries new since the last run (monitor), or a free error row.

# 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, data extraction"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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