# Google Trends Scraper: Compare Terms, Trending Now (`pinescore/google-trends`) Actor

Google Trends for people and AI agents: compare up to 5 terms on one scale over time and by region, with related queries and a rising or falling summary per term; plus every search trending now in a country, with volume, category and the news behind it.

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

## Pricing

from $2.00 / 1,000 keyword lookups

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: compare terms, trending now, agent-ready summaries

Get Google Trends data without the Google Trends website: interest over time, interest by region and related queries for up to 5 terms on one 0 to 100 scale, and every search trending right now in a country with its search volume, category and the news headlines behind it. Every result comes with a plain summary (rising, falling or flat, over the whole period and right now), so a spreadsheet, a dashboard or an AI agent can use it straight away.

### What you can do with it

- **Compare up to 5 terms on one scale**, exactly like the Google Trends website: `chatgpt`, `claude` and `gemini` in one lookup, for one price.
- **Five kinds of search**: web, YouTube, News, Images and Google Shopping.
- **Any country or region**, any period from the past hour to 2004 onwards, and any Google Trends category.
- **Trending now** for a country or US state: every trending search from the past 4 hours, 24 hours, 48 hours or 7 days, with search volume, rise in per cent, start and end time, category, related searches and up to 10 news headlines each. Filter by any of Google's 19 categories (Sports, Technology, Business and Finance and so on) and keep only searches that are still trending.
- **Summaries an agent can act on**: for each term, the direction over the whole period, the direction now (the latest stretch against the one before), the average, the latest value and the peak with its date.

### Why this one

- **Built to finish**: when Google pushes back, the lookup moves to a fresh residential IP and keeps every part it already fetched. If related queries still will not come, you get the rest with a clear warning instead of an empty error.
- **Failed lookups are free**: you pay only for lookups that return data.
- **Safe on long runs**: if the platform restarts a run, it carries on where it left off instead of starting again and charging twice.
- **Checked every day**: we run it on the platform every morning and fix any problem the same day.

### Input examples

Compare three AI assistants in the UK over the past 12 months:

```json
{
    "mode": "keywords",
    "searchTerms": ["chatgpt", "claude", "gemini"],
    "geo": "GB",
    "timeRange": "today 12-m"
}
```

The 25 biggest searches trending in the US over the past 24 hours in Technology or Business and Finance, with 3 headlines each:

```json
{
    "mode": "trendingNow",
    "geo": "US",
    "trendingWindow": "24h",
    "trendingCategories": ["Technology", "Business and Finance"],
    "maxItems": 25,
    "newsPerTrend": 3
}
```

| Input | What it does |
|---|---|
| `mode` | `keywords` (keyword lookup) or `trendingNow`. |
| `searchTerms` | Terms to look up. With `compareTerms` on, every 5 terms share one scale; more than 5 are split into lookups of 5. |
| `compareTerms` | Off: each term is looked up on its own scale. |
| `geo` | Country or region code in capitals, such as `GB`, `US` or `US-CA`. Empty means worldwide (keywords) or US (trending now). |
| `timeRange` | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m`, `today 5-y` or `all`. |
| `category` | Google Trends category number for keyword lookups (0 is all). |
| `searchProperty` | Empty for web search, or `youtube`, `news`, `images`, `froogle` (Shopping). |
| `includeRegions`, `includeRelatedQueries` | Add interest by region and top and rising related queries (both on by default). |
| `trendingWindow` | Trending now: `4h`, `24h`, `48h` or `7d`. |
| `trendingCategories` | Trending now: keep searches in any of these categories. |
| `activeOnly` | Trending now: leave out searches that have stopped trending. |
| `newsPerTrend` | Trending now: headlines per search, 0 to 10. |
| `maxItems` | Trending now: how many searches to return, biggest first. |
| `proxyConfiguration` | Residential proxies by default, which Google refuses least. |

### Output examples

A keyword lookup gives one item per lookup (shortened here):

```json
{
    "searchTerms": ["covid"],
    "geo": "GB",
    "timeRange": "today 12-m",
    "summary": {
        "covid": {
            "direction": "falling",
            "changePercent": -23.2,
            "recentDirection": "rising",
            "recentChangePercent": 119.1,
            "average": 33.6,
            "latest": 100,
            "peak": 100,
            "peakAt": "2026-10-04T00:00:00Z"
        }
    },
    "interestOverTime": [{ "time": "2025-10-12T00:00:00Z", "label": "Oct 12 – 18, 2025", "values": { "covid": 93 }, "isPartial": false }],
    "interestByRegion": [{ "geoCode": "GB-WLS", "geoName": "Wales", "values": { "covid": 100 } }],
    "relatedQueries": {
        "covid": {
            "top": [{ "query": "covid symptoms", "value": 100, "formattedValue": "100" }],
            "rising": [{ "query": "symptoms of covid 2026", "value": 45550, "formattedValue": "Breakout" }]
        }
    },
    "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=covid&geo=GB"
}
```

Read it as: interest in covid fell over the year as a whole, but it is rising fast now and is at its highest point of the year.

Trending now gives one item per trending search:

```json
{
    "mode": "trendingNow",
    "geo": "GB",
    "window": "24h",
    "rank": 2,
    "query": "coventry vs newcastle",
    "searchVolume": 200000,
    "searchVolumeLabel": "200K+",
    "increasePercent": 1000,
    "startedAt": "2026-10-12T17:00:00Z",
    "endedAt": null,
    "isActive": true,
    "categories": ["Sports"],
    "relatedSearches": ["coventry city fc vs newcastle united f.c. standings", "coventry city", "newcastle"],
    "news": [
        {
            "title": "Coventry 4-1 Newcastle: Frank Lampard's Sky Blues out of Premier League drop zone",
            "url": "https://www.bbc.com/sport/football/articles/cw78p7l7rp30o",
            "source": "BBC",
            "publishedAt": "2026-10-12T22:34:32Z"
        }
    ]
}
```

You can download results as JSON, CSV, Excel or HTML, or read them through the Apify API.

### Pricing

Pay per event, with no start fee and nothing extra for Apify platform usage:

- **Keyword lookup: $0.002** per successful lookup of up to 5 terms on one scale, with interest by region and related queries included. A 5-term comparison costs the same as a single term. Failed lookups are free.
- **Trending search: $0.001** per trending search, with its category, related searches and headlines.

So 1,000 keyword lookups cost $2, and the 25 biggest trending searches in a country cost 2.5 cents. On Apify's free plan, the $5 monthly credit covers about 2,500 keyword lookups. You can cap the cost of any run with the maximum charge setting; the run stops cleanly when it reaches it.

### Google Trends API for Python and JavaScript

pytrends, the popular unofficial Python library, is archived on GitHub and no longer maintained, and Google's own Trends API is still an application-only alpha. This Actor works as a Google Trends API today: send the input, get JSON back, with retries, residential proxies and parsing handled for you.

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("pinescore/google-trends").call(run_input={
    "searchTerms": ["chatgpt", "claude", "gemini"],
    "geo": "GB",
    "timeRange": "today 12-m",
})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["summary"])
```

JavaScript (`npm install apify-client`):

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('pinescore/google-trends').call({
    mode: 'trendingNow',
    geo: 'GB',
    maxItems: 5,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) console.log(item.rank, item.query, item.searchVolumeLabel);
```

Your API token is in Apify Console under Settings, API & Integrations.

**Moving from pytrends?** The inputs take the same values as pytrends' `build_payload`: `timeRange` is `timeframe` (`today 12-m`, `today 5-y`, `now 7-d` and so on), `geo` is `geo`, `category` is `cat` and `searchProperty` is `gprop` (`youtube`, `news`, `images`, `froogle`). In the output, `interestOverTime` replaces `interest_over_time()`, `interestByRegion` replaces `interest_by_region()` and `relatedQueries` replaces `related_queries()`, all from one lookup. Trending now mode replaces `trending_searches()` and `realtime_trending_searches()`, with search volumes and headlines added.

### Use it with AI agents and automations

- **AI agents and MCP**: call this Actor from Claude, ChatGPT or any MCP client through the Apify MCP server (`https://mcp.apify.com`). The `summary` field answers "is this rising?" without the agent reading the whole timeline.
- **n8n, Make and Zapier**: use the Apify integration to run it on a schedule and send the results onwards, for example a daily list of trending searches in your country to Slack or Google Sheets.
- **Any HTTP client**: start a run and read the dataset through the Apify API, as in the examples above.

### FAQ

**Is the data the same as on the Google Trends website?** Yes. It comes from the same sources the website uses. Values are Google's 0 to 100 index, relative to the highest point in the lookup, so terms compared in one lookup are on one scale and terms in different lookups are not.

**Why are some related queries missing?** Google has no related queries for very niche terms or short periods. When Google has them but refuses to give them after every retry, the item carries a `warning` and the rest of the data.

**Which countries does trending now cover?** Every country on the Google Trends Trending Now page, and US states such as `US-CA`. Codes must be in capitals. A country Google does not cover fails at once with a clear message, at no charge.

**Is it legal?** It collects public, aggregated search statistics and public news headlines, with no personal data and no login. Make sure your use complies with the laws and terms that apply to you.

**Something not working?** Open an issue on the Issues tab with your run link. We check every day.

# Actor input Schema

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

Keyword lookup: interest over time, by region and related queries for your terms. Trending now: every search trending in a country over the past 4 hours to 7 days, with search volume, category, related searches and the news headlines behind it.

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

Keyword lookup only. With 'Compare terms' on, up to 5 at a time share one 0 to 100 scale, exactly like the Google Trends website.

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

On: terms are compared in groups of up to 5. Off: each term is looked up on its own.

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

ISO code such as GB, US or US-CA (capitals). Leave empty for worldwide (keyword lookup) or US (trending now).

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

The period to cover.

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

Google Trends category number; 0 means all categories.

## `searchProperty` (type: `string`):

Which Google search to measure.

## `includeRegions` (type: `boolean`):

Add interest by country, or by region within the chosen country.

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

Add top and rising related queries for each term.

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

Language code for labels and headlines, such as en-US or en-GB.

## `maxAttempts` (type: `integer`):

How many fresh proxy sessions to try before giving up on a lookup.

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

Google limits repeated requests; residential proxies are the most reliable.

## `trendingWindow` (type: `string`):

Trending now only: how far back to look. Past 24 hours matches the Trending Now page's default.

## `trendingCategories` (type: `array`):

Trending now only: keep searches in any of these categories. Leave empty for all.

## `activeOnly` (type: `boolean`):

Trending now only: leave out searches whose trend has already ended.

## `newsPerTrend` (type: `integer`):

Trending now only: news articles to add to each trending search (0 for none).

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

Trending now only: how many trending searches to return, biggest first.

## Actor input object example

```json
{
  "mode": "keywords",
  "searchTerms": [
    "chatgpt",
    "claude",
    "gemini"
  ],
  "compareTerms": true,
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "searchProperty": "",
  "includeRegions": true,
  "includeRelatedQueries": true,
  "language": "en-US",
  "maxAttempts": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "trendingWindow": "24h",
  "trendingCategories": [],
  "activeOnly": false,
  "newsPerTrend": 3,
  "maxItems": 25
}
```

# 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": [
        "chatgpt",
        "claude",
        "gemini"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pinescore/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": [
        "chatgpt",
        "claude",
        "gemini",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("pinescore/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": [
    "chatgpt",
    "claude",
    "gemini"
  ]
}' |
apify call pinescore/google-trends --silent --output-dataset

```

## MCP server setup

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