# Google Trends Scraper: Verified Interest Over Time & Region (`alhadikhan/google-trends-scraper`) Actor

Scrape Google Trends interest over time and by country or state for any search terms. Every value is checked to match the Google Trends website, and decoy data that Google sends to bots is left out. Up to 1,000 terms per run; you pay only for terms with data.

- **URL**: https://apify.com/alhadikhan/google-trends-scraper.md
- **Developed by:** [MD. AL-HADI KHAN](https://apify.com/alhadikhan) (community)
- **Categories:** SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 1,000 search term results

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: verified interest over time and by region

Scrape Google Trends for any number of search terms. For each term you get **interest over time** and **interest by country or state**, as clean JSON, CSV or Excel. That's the same data the Google Trends website shows, **checked value by value against the website**.

### Why "verified"?

Google labels automated requests to Google Trends as bots, and for those requests some panels are **not real**:

- **Related queries** come back mixed with decoys. For "python" in the United States, automated requests get rising queries like "walmart near me" and "cheap flights 2024". The website shows "python docs" and "python 3.15".
- **Related topics** come back empty.
- **City data** is thin: 3 cities instead of 34.

The **timeline and the country/state map**, on the other hand, are identical to the website. In our checks on 7 Nov 2026: 53 of 53 weeks and 51 of 51 states (python, United States, past 12 months), and 204 of 204 weeks and 87 of 87 countries (chatgpt, worldwide, past 5 years).

So this scraper returns **only the panels that match the website** and leaves the rest out, rather than selling you decoys. We repeat the check every month.

**Check your current tool in 1 minute:** scrape related queries for `python`, United States, past 12 months. If the rising list starts with "walmart near me" or "lidl near me", you're getting decoy data.

### What you get

For every search term, one result with:

| Field | What it is |
|---|---|
| `averageInterest` | Average interest over the time range (0–100) |
| `peakDate` | When interest was highest |
| `timeline` | Interest per day, week or month (depending on the time range), with `isPartial` for the unfinished last period |
| `interestByRegion` | Interest by **country** (worldwide searches) or by **state or province** (searches in one country), highest first |
| `topRegion` | The region with the highest interest |
| `topic` | The Google topic used, if you asked for one |
| `url` | The same view on Google Trends, to check any row by eye |

### Input

- **Search terms**: one per line, up to 1,000 per run. Each term is scraped on its own, like opening it alone on Google Trends.
- **Google Trends URLs** (optional): paste explore URLs, and their location, time range, category and search type are used as they are.
- **Location**: `US`, `GB`, `DE`, `IN`, `BD`… or a region like `US-CA`. Empty means worldwide.
- **Time range**: past hour to 2004–now, or a custom range like `2024-01-01 2024-12-31`.
- **Category** and **search type** (web, images, news, YouTube, Google Shopping), as on Google Trends.

**Words with several meanings:** add the meaning in brackets, e.g. `Jaguar (car make)`, and the matching Google topic is used. The result says which topic it found, or notes that it measured the plain words. You can also give a topic ID with your own label: `Python language=/m/05z1_`.

```json
{
  "searchTerms": ["python", "Jaguar (car make)"],
  "geo": "US",
  "timeRange": "today 12-m"
}
```

### Output example (one result, shortened; real run, 7 Nov 2026)

```json
{
  "searchTerm": "Jaguar (car make)",
  "averageInterest": 79.63,
  "peakDate": "2026-02-15",
  "topRegion": "Florida",
  "query": "/m/0h5wslk",
  "topic": { "id": "/m/0h5wslk", "title": "Jaguar", "type": "Car make" },
  "geo": "US",
  "timeRange": "today 12-m",
  "url": "https://trends.google.com/trends/explore?q=%2Fm%2F0h5wslk&date=today+12-m&geo=US",
  "regionLevel": "state or province",
  "timeline": [
    { "date": "2025-11-02", "value": 75, "isPartial": false },
    { "date": "2025-11-09", "value": 71, "isPartial": false }
  ],
  "interestByRegion": [
    { "geoCode": "US-FL", "geoName": "Florida", "value": 100 },
    { "geoCode": "US-AZ", "geoName": "Arizona", "value": 97 }
  ]
}
```

### How to use it

1. Open the Actor in Apify Console with the button at the top of this page.
2. Enter search terms, one per line, or paste Google Trends links.
3. Choose the location (empty means worldwide) and the time range.
4. Click **Start**. 50 terms took 68 seconds in our test.
5. Download the results from the **Output** tab as CSV, Excel, JSON, XML or HTML, or open them as a table.

### What people use it for

- **SEO and content:** when interest in a topic peaks, and in which states or countries.
- **Product research:** whether a product category is growing or fading over 5 years.
- **Market reports:** interest by country for a list of brands or products, refreshed on a schedule.
- **Data science:** clean weekly or monthly series for many terms, without running your own scraper.

### Use it from your code (API)

One request starts the run, waits for it and returns the results as JSON. Get your API token in Apify Console under **Settings → API & Integrations**.

```python
import requests

items = requests.post(
    "https://api.apify.com/v2/acts/alhadikhan~google-trends-scraper/run-sync-get-dataset-items",
    headers={"Authorization": "Bearer YOUR_APIFY_TOKEN"},
    json={"searchTerms": ["electric bike", "e-scooter"], "geo": "US", "timeRange": "today 5-y"},
    timeout=300,
).json()
for term in items:
    print(term["searchTerm"], term["averageInterest"], term["peakDate"], term["topRegion"])
```

The same with `curl`:

```bash
curl -X POST "https://api.apify.com/v2/acts/alhadikhan~google-trends-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"searchTerms": ["electric bike", "e-scooter"], "geo": "US", "timeRange": "today 5-y"}'
```

This one-request form waits up to about 5 minutes. For bigger runs, start a normal run (Apify's `apify-client` package for Python or JavaScript does this) and read its dataset when it finishes.

### Speed and cost

In our tests, **50 search terms took 68 seconds** and 5 took 13 seconds, with every term finished. Terms run in parallel, and when Google rate-limits a session, the scraper switches to a fresh session and proxy instead of giving up.

You pay per search term in the results. **Terms with too little Google data aren't charged**, and the run's status message lists them.

### FAQ

**Is this a pytrends alternative?**
Yes. pytrends was archived in April 2025. This scraper returns the same interest-over-time and by-region data, handles rate limits, and can be called from Python with `apify-client`. Prefer the pytrends interface? `pip install pytrends-ladder`.

**Why no related queries or related topics?**
Because Google sends automated tools decoy related queries and no related topics (see "Why verified?" above). We don't sell data we know is wrong.

**Why no cities or metro areas?**
In our check, city data for automated requests had 3 cities where the website had 34. Searches inside a state or region (like `US-CA`) still get the full timeline, but no map.

**Why is Wyoming near the top for so many terms in the US?**
Google Trends shows that too: we checked it against the website. Interest is each term's share of all searches in a state, so a small state can rank above a big one.

**How do I compare many terms on one scale?**
Each term here is scaled on its own, like on Google Trends. To put up to 100 terms on one shared scale, use our [Google Trends Compare](https://apify.com/alhadikhan/google-trends-compare). For brand market share in percent, use [Share of Search Tracker](https://apify.com/alhadikhan/share-of-search).

**How do I scrape Google Trends with Python?**
Call this Actor's API from Python with one request (see "Use it from your code" above), or use our open-source package `pytrends-ladder`, which keeps pytrends' interface.

**Can I get daily data?**
Google decides the step: daily for ranges up to about 9 months, weekly up to 5 years, monthly beyond. Use a custom range like `2026-01-01 2026-06-30` for daily values.

### Limits

- Values are relative interest (0–100), not search counts. That's what Google Trends provides.
- Up to 1,000 search terms per run.
- Google computes Trends from a sample of searches and switches to a new sample from time to time. Values can then shift by a few points (up to 9 on a 5-year worldwide timeline in our test), on the website too.

# Actor input Schema

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

One term per line. Each term is scraped on its own, like opening it alone on Google Trends. To pick one meaning, add it in brackets, e.g. 'Jaguar (car make)', or give a Google topic ID with your own label, e.g. 'Python language=/m/05z1\_'.

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

Optional. Paste Google Trends explore URLs; their terms, location, time range, category and search type are used as they are. Each term in a URL is scraped on its own.

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

Two-letter country code (US, GB, DE, IN, BD) or region code (US-CA, GB-ENG). Leave empty for worldwide.

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

Same choices as Google Trends.

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

Optional. Overrides the time range: 'YYYY-MM-DD YYYY-MM-DD', e.g. '2024-01-01 2024-12-31'.

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

Optional. Limits searches to one Google category. Examples: 5 Computers & Electronics, 31 Programming, 47 Autos & Vehicles, 71 Food & Drink, 18 Shopping, 7 Finance, 45 Health. 0 means all categories.

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

Which Google search to measure.

## `includeTimeline` (type: `boolean`):

The timeline, point by point. The average and the peak date are always included.

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

Interest by country (worldwide) or by state or province (in a country). Left out for smaller areas, because Google's city and metro data for automated tools doesn't match its website.

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

Google rate-limits data-centre IPs hard. Residential proxies are strongly recommended.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeTimeline": true,
  "includeRegions": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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": [
        "web scraping"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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