# Google Trends Scraper API: Fast, No Browser (`heocoi/google-trends-api`) Actor

Google Trends data over HTTP, no browser: interest over time, interest by region, related queries and Trending Now. Compare up to 5 keywords. Filter by Web, YouTube, News, Images or Shopping search.

- **URL**: https://apify.com/heocoi/google-trends-api.md
- **Developed by:** [anhphong](https://apify.com/heocoi) (community)
- **Stats:** 2 total users, 1 monthly users, 94.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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?

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 API (fast, no browser)

Get Google Trends data as clean JSON, without a browser: interest over time, interest by region, related queries and today's Trending Now searches.

### Why this one

- **Fast**: plain HTTP requests, no headless browser. A query with all sections returns in seconds.
- **Compare up to 5 keywords** in one query, exactly like the Trends website: `iphone, android, pixel`.
- **YouTube, News, Image and Shopping search**, not just web search.
- **Paste Trends URLs**: keywords, country, date range, category and search type are read from the URL.
- **Retries on a fresh residential IP** when Google rate-limits. Queries that still fail are not charged and are listed in the `RUN_SUMMARY` record.

### Input

| Field | What it does |
|---|---|
| `searchTerms` | One query per line. Comma-separate up to 5 keywords to compare them. |
| `startUrls` | Google Trends explore URLs. |
| `timeRange` / `customTimeRange` | Preset (past hour to 2004-present) or `YYYY-MM-DD YYYY-MM-DD`. |
| `geo` | `US`, `JP`, `US-CA`... Empty = worldwide. |
| `searchProperty` | `web`, `youtube`, `news`, `images`, `shopping`. |
| `category` | Google Trends category ID, 0 = all. |
| `sections` | Any of `interestOverTime`, `interestByRegion`, `relatedQueries`. |
| `regionResolution` | Country, region/state, city or US metro (DMA). |
| `trendingNowGeos` | Country codes for today's Trending Now list. |

### Output (one item per query)

```json
{
  "searchTerm": "iphone, android",
  "keywords": ["iphone", "android"],
  "geo": "US",
  "timeRange": "today 3-m",
  "searchProperty": "web",
  "interestOverTime": [{"date": "2026-07-03T00:00:00Z", "formattedTime": "Jul 3, 2026", "values": {"iphone": 43, "android": 11}, "isPartial": false}],
  "interestByRegion": [{"geoCode": "US-NY", "geoName": "New York", "values": {"iphone": 84, "android": 16}}],
  "relatedQueries": {"iphone": {"top": [{"query": "iphone 18", "value": 100, "link": "https://trends.google.com/..."}], "rising": []}},
  "url": "https://trends.google.com/trends/explore?q=iphone%2Candroid&date=today%203-m&geo=US",
  "scrapedAt": "2026-10-03T11:00:00Z"
}
```

Trending Now items have `"type": "trendingNow"` with `title`, `approxTraffic`, `pubDate` and related `news`.

### Notes

- Values are Google's relative 0-100 scale, the same numbers the Trends website shows.
- Related topics are not offered: Google currently returns an empty topic list to all automated clients.

# Actor input Schema

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

One query per line. Compare up to 5 keywords in one query by separating them with commas, e.g. `iphone, android`.

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

Paste Google Trends explore URLs; keywords, geo, date, category and search type are read from the URL.

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

Preset time window, same options as the Google Trends website.

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

Overrides Time range. Format `YYYY-MM-DD YYYY-MM-DD`, e.g. `2025-01-01 2025-12-31`.

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

ISO country code like `US`, `JP`, or a region like `US-CA`. Empty = worldwide.

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

Which Google search to measure: Web, YouTube, News, Images or Google Shopping.

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

Google Trends category ID (0 = all categories).

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

Which parts of the Trends page to return for each query.

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

Granularity of Interest by region. Google default is region/state inside a country and country for worldwide.

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

Also fetch today's Trending Now searches for these country codes, e.g. `US`, `JP`.

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

Affects names of regions and topics.

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

How many queries run in parallel.

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

Retries per query, each on a fresh proxy IP. Failed queries are not charged.

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

Residential proxy is the default: Google rate-limits datacenter IPs quickly.

## Actor input object example

```json
{
  "searchTerms": [
    "matcha",
    "iphone, android"
  ],
  "timeRange": "today 12-m",
  "geo": "",
  "searchProperty": "web",
  "category": 0,
  "sections": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "regionResolution": "",
  "language": "en-US",
  "maxConcurrency": 5,
  "maxRequestRetries": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One item per query (interest over time, by region, related queries) and one item per Trending Now country.

## `runSummary` (type: `string`):

Counts of succeeded and failed queries. Failed queries are listed here and are not charged.

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

// Run the Actor and wait for it to finish
const run = await client.actor("heocoi/google-trends-api").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": [
        "matcha",
        "iphone, android",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("heocoi/google-trends-api").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": [
    "matcha",
    "iphone, android"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call heocoi/google-trends-api --silent --output-dataset

```

## MCP server setup

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

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/Y0AlCsl7Mjg1GGee6/builds/gMaOySc59xIBMYDKE/openapi.json
