# Google Trends Scraper: Compare Keywords Over Time (`tallydata/google-trends-interest-over-time`) Actor

Google Trends scraper: interest over time, by region and related queries for keyword lists. Accepts the official Actor's input, returns the same field names. Fails fast instead of hanging. $0.015 per keyword (+$0.005 with related data); $0 if nothing is delivered. No related topics or city data.

- **URL**: https://apify.com/tallydata/google-trends-interest-over-time.md
- **Developed by:** [Tallydata](https://apify.com/tallydata) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $13.00 / 1,000 keyword trend queries

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: Compare Keywords Over Time

A Google Trends scraper for Apify. Compare up to 5 keywords over time on one 0–100 scale, or run a whole keyword list with each keyword on its own scale. It accepts the input of the official Google Trends Scraper and returns the same output field names, finishes or fails in seconds instead of hanging, and charges a fixed price per keyword only when data comes back.

To compare keywords, turn on `isMultiple` and put them in one entry, separated by commas:

```json
{
  "searchTerms": ["iphone, samsung, pixel"],
  "isMultiple": true,
  "timeRange": "today 12-m"
}
```

With `isMultiple` off (the default), each entry is its own keyword on its own scale.

Unofficial. Not affiliated with or endorsed by Google.

### What data you get

For each keyword or comparison of up to 5 keywords: interest over time, interest by country or subregion, and top and rising related queries.

```json
{
  "inputUrlOrTerm": "iphone, samsung",
  "searchTerm": "iphone,samsung",
  "interestOverTime_timelineData": [
    {"time": "1761436800", "formattedTime": "Oct 26 – Nov 1, 2025", "formattedAxisTime": "Oct 26, 2025",
     "value": [46, 14], "hasData": [true, true], "formattedValue": ["46", "14"]}
  ],
  "interestOverTime_averages": [61, 19],
  "interestBySubregion": [],
  "interestByCity": [],
  "interestByMetro": [],
  "relatedTopics_top": [],
  "relatedTopics_rising": [],
  "relatedQueries_top": [],
  "relatedQueries_rising": [],
  "interestBy": []
}
```

### Known gaps

- Related topics are not fetched. Google returns them empty, so the fields stay empty.
- City and metro data are not fetched. Those fields stay empty.
- `extendOutputFunction` is not supported.

### Reliability, measured

Before publishing, this Actor ran on a schedule every 10 minutes for 4 days (6–10 November 2026): **576 of 576 runs succeeded (100%)**. A typical run took 8.9 seconds from start to finish, and 95% of runs finished within 21.5 seconds. Queries that fail or come back empty are not charged.

This number will be replaced by the 30-day run success rate, calculated as succeeded runs divided by total runs, once it is available.

### Migrating from the official Google Trends Scraper

Change the Actor ID and keep your input. The default output contains the official keys only, and `outputFormat: full` adds one trailing `meta` column.

| Official input | Here |
|---|---|
| `searchTerms`, `isMultiple`, `timeRange`, `customTimeRange`, `geo`, `viewedFrom`, `category`, `startUrls`, `spreadsheetId`, `maxItems` | Supported |
| `maxConcurrency`, `maxRequestRetries`, `pageLoadTimeoutSecs`, `skipDebugScreen` | Accepted and ignored |
| `proxyConfiguration` | Accepted and ignored: the proxy is included in the price |

The compatibility test is public at [tallydata/google-trends-actor-examples](https://github.com/tallydata/google-trends-actor-examples).

### Pricing

| Event | Price |
|---|---|
| Keyword with data | $0.015 on Free and Starter plans, $0.014 on Scale, $0.013 on Business and above |
| Related queries for that keyword, when returned | $0.005 |

10 keywords with related data cost $0.20 at the full price. Failed or empty queries cost nothing. To cap a run, set a maximum charge in the run options.

### How to use it

Use the Console form, a Task or a schedule. For a schedule, pick a minute other than :00, for example `7 * * * *` instead of `0 * * * *`: at :00 most schedules on Apify start at once, and runs start and finish noticeably later. Through the API, `run-sync-get-dataset-items` suits up to 25 queries. Bigger batches run asynchronously at about 150 queries per 5 minutes, so 200 keywords take about 7 minutes and 1,000 keywords about 35 minutes.

#### AI agents

Add this MCP server, with your Apify token:

```
https://mcp.apify.com?tools=actors,docs,tallydata/google-trends-interest-over-time
```

Keep calls to 5 queries or fewer to get a reply within the usual 30-second wait, and use `outputFormat: full`. Worldwide queries return a large `interestBy` list.

#### Python (pytrends alternative)

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("tallydata/google-trends-interest-over-time").call(
    run_input={"searchTerms": ["web scraping"], "geo": "US"}
)
rows = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

### FAQ

**Why at most 5 keywords per comparison?** Google compares at most 5 terms on one scale. Other keywords in the list run separately.

**What happens if Google refuses a query?** If no data comes back, that query fails without a charge, and a run stops early if most of its recent queries fail, so you don't pay for a run that can't deliver.

**Why do values differ slightly from the Trends website?** Google samples its data, so values can move by a few points between requests.

**Is it legal?** It reads public aggregated data. This is not legal advice.

### Support

Open an issue on this page. First response within 24 hours on weekdays and 48 hours at weekends. If this Actor helps or disappoints you, a short review helps others decide.

If you track the same keywords every week, save this Actor in Apify so you can find it again.

# Actor input Schema

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

Keywords to look up, one per entry. Same field as apify/google-trends-scraper. With isMultiple on, a comma compares up to 5 terms on one scale.

## `isMultiple` (type: `boolean`):

On: "iphone, samsung" becomes one comparison of up to 5 terms. Off: the comma is part of the keyword.

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

Predefined range. Empty means the past 12 months.

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

YYYY-MM-DD YYYY-MM-DD, or YYYY-MM-DDTHH YYYY-MM-DDTHH for a span of 7 days or less. Overrides the time range.

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

ISO country or region code, such as US or US-CA. Empty means worldwide.

## `viewedFrom` (type: `string`):

Two-letter lower-case country the request is made from. Empty means US.

## `category` (type: `string`):

Numeric Google Trends category id. Empty means all categories.

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

Google Trends explore URLs. Their q, geo, date, cat and gprop override the fields above for that URL.

## `spreadsheetId` (type: `string`):

Public sheet: keywords in the first column, with a header in row 1.

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

Maximum rows with data to deliver. 0 means no limit.

## `outputFormat` (type: `string`):

official (default): exactly the fields of apify/google-trends-scraper. full: the same fields plus a meta object with a summary (peak, latest, average, top rising queries), the status of each data block and what the row cost. AI agents: use full and read meta; worldwide queries return a large interestBy list (~250 countries).

## `widgets` (type: `array`):

Which blocks to fetch. Blocks left out stay empty and are not charged.

## `maxRunSecs` (type: `integer`):

Stop starting new queries after this long. Default is 270 for up to 25 queries, otherwise only the run timeout.

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

Accepted for compatibility with the official input. Not used.

## `maxRequestRetries` (type: `integer`):

Accepted for compatibility. Not used.

## `pageLoadTimeoutSecs` (type: `integer`):

Accepted for compatibility. Not used, there is no browser.

## `skipDebugScreen` (type: `boolean`):

Accepted for compatibility. Not used.

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

Accepted for compatibility. The proxy is included in the price.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping"
  ],
  "isMultiple": false,
  "timeRange": "",
  "geo": "",
  "viewedFrom": "",
  "category": "",
  "maxItems": 0,
  "outputFormat": "official",
  "widgets": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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": [
        "web scraping"
    ],
    "viewedFrom": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("tallydata/google-trends-interest-over-time").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"],
    "viewedFrom": "",
}

# Run the Actor and wait for it to finish
run = client.actor("tallydata/google-trends-interest-over-time").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"
  ],
  "viewedFrom": ""
}' |
apify call tallydata/google-trends-interest-over-time --silent --output-dataset

```

## MCP server setup

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

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/RWZDOt6gR9qBWrGpW/builds/poWgx5XT0NLfaeh4g/openapi.json
