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

Extract Google Trends data: related searches (top & rising), geographic interest by region, and interest over time. Supports multiple keywords, custom time ranges, geo filtering, and categories. Fast, no browser needed.

- **URL**: https://apify.com/agenscrape/google-trends-scraper.md
- **Developed by:** [Agenscrape](https://apify.com/agenscrape) (community)
- **Categories:** News, AI, Automation
- **Stats:** 924 total users, 174 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Trends Scraper

Unlock powerful insights from Google Trends. Extract trending searches, discover what's popular in any region, and track how interest evolves over time for any keyword or topic.

### What You Get

#### Related Searches

Discover what people are searching for alongside your keyword:

- **Top Queries**: The most popular related searches with relative popularity scores
- **Rising Queries**: Breakout searches showing explosive growth (e.g., +450%, "Breakout")

#### Geographic Interest

See where your keyword is most popular:

- Country-by-country breakdown with interest scores (0-100)
- Region/state level data when searching within a country
- Identify your strongest markets or untapped opportunities

#### Interest Over Time

Track how interest changes:

- Hourly data for recent trends
- Daily/weekly data for longer timeframes
- Historical data going back to 2004

### Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| keywords | Array | List of keywords/topics to analyze |
| geo | String | Two-letter country code (e.g., "US", "GB") - leave empty for worldwide |
| timeRange | String | Time period to analyze |
| category | Integer | Google Trends category ID (0 = all categories) |
| includeRelatedSearches | Boolean | Get related search queries |
| includeGeoData | Boolean | Get geographic interest breakdown |
| includeInterestOverTime | Boolean | Get historical interest data |

### Sample Output

```json
{
  "keyword": "bitcoin",
  "geo": "Worldwide",
  "timeRange": "Past day",
  "relatedSearches": {
    "top": [
      {
        "query": "bitcoin price",
        "value": 100,
        "formattedValue": "100",
        "link": "/trends/explore?q=bitcoin+price&date=now+1-d"
      },
      {
        "query": "bitcoin usd",
        "value": 45,
        "formattedValue": "45",
        "link": "/trends/explore?q=bitcoin+usd&date=now+1-d"
      }
    ],
    "rising": [
      {
        "query": "bitcoin news today",
        "value": 450,
        "formattedValue": "+450%",
        "link": "/trends/explore?q=bitcoin+news+today&date=now+1-d"
      },
      {
        "query": "bitcoin crash",
        "value": 200,
        "formattedValue": "+200%",
        "link": "/trends/explore?q=bitcoin+crash&date=now+1-d"
      }
    ]
  },
  "geoData": [
    {
      "geoCode": "NG",
      "geoName": "Nigeria",
      "value": 100,
      "formattedValue": "100"
    },
    {
      "geoCode": "SV",
      "geoName": "El Salvador",
      "value": 85,
      "formattedValue": "85"
    },
    {
      "geoCode": "US",
      "geoName": "United States",
      "value": 42,
      "formattedValue": "42"
    }
  ],
  "interestOverTime": [
    {
      "time": "1732492800",
      "formattedTime": "Nov 25, 2024 at 12:00 AM",
      "value": 75,
      "formattedValue": "75",
      "isPartial": false
    },
    {
      "time": "1732496400",
      "formattedTime": "Nov 25, 2024 at 1:00 AM",
      "value": 82,
      "formattedValue": "82",
      "isPartial": false
    }
  ],
  "scrapedAt": "2024-11-25T12:00:00.000Z"
}
```

### Time Range Options

| Option | Description |
|--------|-------------|
| Past hour | Minute-by-minute data for the last 60 minutes |
| Past 4 hours | Recent short-term trends |
| Past day | Hourly data for the last 24 hours |
| Past 7 days | Daily data for the past week |
| Past 30 days | Daily data for the past month |
| Past 90 days | Weekly data for the past quarter |
| Past 12 months | Weekly data for the past year |
| Past 5 years | Monthly data for long-term analysis |
| Since 2004 | Complete historical data |

### Use Cases

**Market Research**

- Track interest in products, brands, or industries
- Identify seasonal trends and patterns
- Compare multiple competitors or products

**SEO & Content Marketing**

- Find trending topics for content creation
- Discover related keywords for optimization
- Identify content gaps and opportunities

**Investment & Finance**

- Monitor interest in stocks, cryptocurrencies, and assets
- Track sentiment around financial events
- Identify emerging investment opportunities

**Academic Research**

- Study public interest patterns
- Analyze cultural and social trends
- Research consumer behavior

**Competitive Intelligence**

- Compare brand awareness across regions
- Track competitor product launches
- Monitor industry trends

### Tips for Best Results

1. **Be specific**: "iPhone 15 Pro" gives better results than just "iPhone"
2. **Use multiple keywords**: Compare up to 5 related terms in one run
3. **Try different time ranges**: Short-term for trending topics, long-term for seasonal patterns
4. **Filter by region**: Get country-specific insights by setting the geo parameter
5. **Combine with categories**: Use category filtering for more relevant results in specific industries

# Actor input Schema

## `keywords` (type: `array`):

List of keywords/topics to search for in Google Trends

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

Two-letter country code (e.g., US, GB, DE). Leave empty for worldwide data.

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

Time period for the trends data

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

Google Trends category ID (0 = All categories)

## `includeRelatedSearches` (type: `boolean`):

Extract top and rising related search queries

## `includeRelatedTopics` (type: `boolean`):

Extract top and rising related topics (entities). Uses browser automation for accurate data.

## `includeGeoData` (type: `boolean`):

Extract interest by region/country

## `includeInterestOverTime` (type: `boolean`):

Extract historical interest data points

## `useBrowserForTopics` (type: `boolean`):

Attempt browser automation to fetch related topics. May be rate limited. Disable for faster, more reliable results using HTTP API.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin",
    "ethereum"
  ],
  "geo": "US",
  "timeRange": "now 1-d",
  "category": 0,
  "includeRelatedSearches": true,
  "includeRelatedTopics": true,
  "includeGeoData": true,
  "includeInterestOverTime": true,
  "useBrowserForTopics": false
}
```

# 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 = {
    "keywords": [
        "messi"
    ],
    "geo": "US",
    "timeRange": "now 1-d",
    "category": 0,
    "includeRelatedSearches": true,
    "includeRelatedTopics": true,
    "includeGeoData": true,
    "includeInterestOverTime": true,
    "useBrowserForTopics": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("agenscrape/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 = {
    "keywords": ["messi"],
    "geo": "US",
    "timeRange": "now 1-d",
    "category": 0,
    "includeRelatedSearches": True,
    "includeRelatedTopics": True,
    "includeGeoData": True,
    "includeInterestOverTime": True,
    "useBrowserForTopics": False,
}

# Run the Actor and wait for it to finish
run = client.actor("agenscrape/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 '{
  "keywords": [
    "messi"
  ],
  "geo": "US",
  "timeRange": "now 1-d",
  "category": 0,
  "includeRelatedSearches": true,
  "includeRelatedTopics": true,
  "includeGeoData": true,
  "includeInterestOverTime": true,
  "useBrowserForTopics": false
}' |
apify call agenscrape/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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