# Google Trends Scraper (`deadmist/google-trends-scraper`) Actor

Interest over time, by region and city, related queries and topics, and trending searches from Google Trends. Retries with fresh proxy sessions, so 429 errors do not end your run. You pay only for terms that returned data.

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

## Pricing

Pay per event

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

Get Google Trends data for any search term, country and time range: **interest over time, interest by region and city, related queries, related topics** and **trending searches right now**. You get one clean JSON item per term, ready for spreadsheets, dashboards, SEO research or an AI agent.

Google Trends rate-limits scrapers hard (HTTP 429). This Actor retries every request with a fresh proxy session and switches to residential IPs when datacenter ones are blocked, so one blocked request doesn't fail your run, and you pay only for terms that returned data.

### What you can scrape

| Data | Field |
|---|---|
| Interest over time (0–100) | `interestOverTime` with `averages` |
| Interest by country, region / state, city or US metro | `interestByCountry`, `interestByRegion`, `interestByCity`, `interestByMetro` |
| Related queries: top and rising | `relatedQueries.top`, `relatedQueries.rising` |
| Related topics: top and rising | `relatedTopics.top`, `relatedTopics.rising` |
| Trending now, with traffic and news | items with `type: "trendingNow"` |

The filters are the same as on Google Trends: country, time range (past hour to 2004–present, or custom dates), category, and search type (web, image, news, Google Shopping, YouTube).

### How to use it

1. Enter one or more **search terms**, or paste **Google Trends URLs** copied from your browser.
2. Pick a country and a time range.
3. Turn on **Compare terms** to get values relative to each other, as in the comparison chart on Google Trends (up to 5 terms per chart).
4. Add country codes under **Trending now** for today's trending searches.
5. Run it, then download the data as JSON, CSV or Excel, or get it through the API.

### Input example

```json
{
  "searchTerms": ["web scraping", "data extraction"],
  "geo": "US",
  "timeRange": "today 12-m",
  "trendingNowGeos": ["US", "GB"]
}
```

### Output example

```json
{
  "type": "explore",
  "searchTerms": ["web scraping"],
  "geo": "US",
  "timeRange": "today 12-m",
  "property": "web",
  "trendsUrl": "https://trends.google.com/trends/explore?q=web+scraping&date=today+12-m&geo=US",
  "interestOverTime": [
    { "time": "2025-10-26T00:00:00.000Z", "formattedTime": "Oct 26 – Nov 1, 2025", "value": [71], "hasData": [true], "isPartial": false }
  ],
  "averages": [68],
  "interestByRegion": [{ "geoCode": "US-CA", "geoName": "California", "value": [100] }],
  "interestByCity": [{ "geoName": "San Jose", "value": [100] }],
  "relatedQueries": {
    "top": [{ "query": "python web scraping", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=python+web+scraping&date=today+12-m&geo=US" }],
    "rising": [{ "query": "ai web scraping", "value": 450, "formattedValue": "+450%" }]
  },
  "relatedTopics": { "top": [], "rising": [] },
  "scrapedAt": "2026-10-27T16:00:00.000Z"
}
```

A trending search:

```json
{
  "type": "trendingNow",
  "geo": "US",
  "title": "world series",
  "approxTraffic": "500000+",
  "startedAt": "2026-10-27T16:00:00.000Z",
  "news": [{ "title": "…", "url": "https://…", "source": "…" }]
}
```

If a term still fails after all retries, it appears as an item with `type: "error"` and you are not charged for it.

### Pricing

You pay per search term that returned data, whatever sections you pick, plus a small fee per trending search. Proxies are included. Set a maximum cost per run in the run options and the Actor stops when it is reached.

### Tips

- Values on Google Trends are relative, from 0 to 100. Compare terms on one chart if you need them on the same scale.
- For a US state or another region, paste a Google Trends URL with that region, for example `geo=US-CA`.
- The category ID is the `cat` value in a Google Trends URL.
- `now 1-H` and `now 4-H` give minute-level data, `all` gives monthly data since 2004.
- Google Trends currently returns related topics for few terms, often none. When Google shows none, `relatedTopics` is empty.

### Is scraping Google Trends legal?

The Actor reads only public, aggregated and anonymous search-interest data that Google Trends shows to any visitor, and no personal data. Check that your use follows the laws and terms that apply to you.

### Feedback

Found a bug or need another field? Open an issue on the **Issues** tab.

# Actor input Schema

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

Each term is scraped on its own, unless "Compare terms" is on.

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

Groups terms by five, like the comparison view on Google Trends, so the values are relative to each other.

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

Paste URLs copied from trends.google.com/trends/explore. The terms, country, time range, category and search type are read from the URL.

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

Same time ranges as on Google Trends.

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

Overrides the time range. Format: YYYY-MM-DD YYYY-MM-DD, for example 2024-01-01 2024-06-30.

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

For a state or region, paste a Google Trends URL that has it, for example geo=US-CA.

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

Google Trends category ID, 0 for all categories. The ID is the "cat" value in a Google Trends URL.

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

Which Google search the interest comes from.

## `sections` (type: `array`):

Fewer sections make each term faster. The price per term is the same.

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

Level of the "Interest by region" data.

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

Two-letter country codes, for example US, GB, UA. Returns the searches trending right now with their traffic and news articles.

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

Language of topic names and dates, for example en-US, de, uk.

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

Each failed request is retried with a new proxy session, up to this many times.

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

Higher is faster, but Google blocks more requests, so more of them are retried.

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

Apify Proxy is used by default. Residential IPs take over automatically when datacenter IPs are blocked.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "data extraction"
  ],
  "compareTerms": false,
  "timeRange": "today 12-m",
  "geo": "",
  "category": 0,
  "property": "",
  "sections": [
    "timeline",
    "regions",
    "relatedQueries",
    "relatedTopics"
  ],
  "regionResolution": "auto",
  "language": "en-US",
  "maxAttempts": 8,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped items.

## `overview` (type: `string`):

The overview view of the dataset.

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

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

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

```

## MCP server setup

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