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

Scrape Google Trends: interest over time, interest by region, related queries, keyword comparisons and Trending Now searches with news. Any country, period, category and search type. Fast HTTP scraper, no browser.

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

## Pricing

from $6.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 Scraper

Get the data behind **Google Trends** as clean JSON, CSV or Excel: **interest over time**, **interest by region**, **related queries**, side-by-side **keyword comparisons**, and the **Trending Now** list of searches that are spiking right now — with search volume, growth and news articles.

The actor talks to Google Trends over plain HTTP — no browser — so a keyword takes a few seconds and a full Trending Now list for a country about ten.

### Features

- 📈 **Interest over time** — Google's 0–100 scale for any period: the past hour (minute by minute), past 7 days (hourly), past 5 years (weekly), back to 2004, or your own dates.
- 🗺 **Interest by region** — by country, state or province, metro area or city (cities come with coordinates).
- 🔎 **Related queries** — the most common related searches and the fastest rising ones, with breakouts flagged.
- ⚖️ **Compare up to 5 terms** — put them on one line; each term gets its own result plus its share of searches in every region.
- 🔥 **Trending Now** — what is spiking in a country in the past 4 hours to 7 days: search volume, growth, start and end time, category, related searches and, optionally, news articles.
- 🌍 **Any place** — 230+ countries, or regions such as `US-CA`. Run the same searches for several places at once.
- 🏷 **Category and search type** — narrow a word with several meanings to one category, and choose Web, Image, News, YouTube or Shopping search.
- 🔗 **Paste Google Trends links** — copy a link from the Explore page and get the same data.
- 🧮 **Ready-made summary** — average, peak, peak date, latest interest, top region and top rising query for every term, so you can sort and filter without unpacking the series.
- 📄 **Nested or flat output** — one result per term with everything inside, or one row per date, region and related search for spreadsheets and databases.

### Use cases

- Keyword and content research: find rising searches before they peak
- Product and market research: compare brands, track seasonality, find where demand is
- News and social media: follow what is trending in a country right now
- Dashboards and reports that need fresh Google Trends data on a schedule
- Datasets for forecasting and AI

### Quick start

1. Enter one or more search terms, e.g. `bitcoin`. To compare, put terms on one line: `bitcoin, ethereum`.
2. Pick a country and time range (or keep Worldwide and the past 12 months).
3. Run. You get one result per term.

For Trending Now, pick one or more countries under **Trending Now** — search terms are not needed.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `searchTerms` | array | Terms to analyse, one search per line. Commas on a line compare up to 5 terms. |
| `geo` | string | Country code such as `US`; empty for Worldwide. |
| `timeRange` | string | `now 1-H`, `now 4-H`, `now 1-d`, `now 7-d`, `today 1-m`, `today 3-m`, `today 12-m` (default), `today 5-y` or `all`. |
| `startDate` / `endDate` | string | A custom period (`yyyy-mm-dd`), replacing `timeRange`. |
| `category` | string | Google Trends category number; `0` (default) is all categories. |
| `searchType` | string | `web` (default), `images`, `news`, `youtube` or `shopping`. |
| `outputFormat` | string | `nested` (default): one result per term. `rows`: one row per data point. |
| `startUrls` | array | Links copied from the Google Trends Explore page. |
| `geoCodes` | array | Several places to run every search for, e.g. `US`, `GB`, `US-CA`. Replaces `geo`. |
| `compareTerms` | boolean | Treat commas as separators between compared terms. Default `true`. |
| `includeInterestOverTime` | boolean | Default `true`. |
| `includeInterestByRegion` | boolean | Default `true`. |
| `regionResolution` | string | `auto` (default), `country`, `region`, `metro` or `city`. |
| `includeLowVolumeRegions` | boolean | Include places with few searches. Default `false`. |
| `includeRelatedQueries` | boolean | Default `true`. |
| `includeRelatedTopics` | boolean | Default `true`. |
| `trendingCountries` | array | Countries to get Trending Now for, e.g. `US`, `GB`. |
| `trendingHours` | string | `4`, `24` (default), `48` or `168`. |
| `trendingCategories` | array | Only trends in these categories, e.g. `Sports`, `Technology`. |
| `trendingStatus` | string | `all` (default), `active` or `ended`. |
| `trendingMaxItems` | integer | Trends to return per country; `0` (default) returns all. |
| `trendingIncludeNews` | boolean | Add news articles to each trend. Default `false`. |
| `language` | string | Language of names and labels, e.g. `en-US`, `fr`, `de`. |
| `proxyConfiguration` | object | Proxy settings. The default is recommended. |

#### Examples

Compare three terms in the United States over five years:

```json
{
    "searchTerms": ["coffee, tea, matcha"],
    "geo": "US",
    "timeRange": "today 5-y"
}
```

The top 50 active trends in the UK and Germany with news:

```json
{
    "trendingCountries": ["GB", "DE"],
    "trendingStatus": "active",
    "trendingMaxItems": 50,
    "trendingIncludeNews": true
}
```

### Output

Every item has a `type`: `keyword` for an analysed search term, `trending` for a Trending Now search.

#### Keyword item

```json
{
    "type": "keyword",
    "searchTerm": "coffee",
    "comparedWith": ["tea", "matcha"],
    "hasData": true,
    "averageInterest": 59,
    "peakInterest": 100,
    "peakDate": "2026-04-12T00:00:00.000Z",
    "latestInterest": 71,
    "dataPoints": 262,
    "regionCount": 51,
    "topRegion": "Hawaii",
    "relatedQueryCount": 50,
    "topQuery": "coffee near me",
    "topRisingQuery": "ryze coffee",
    "topRisingQueryWithTerm": "ryze coffee",
    "interestOverTime": [
        { "date": "2021-10-10T00:00:00.000Z", "label": "Oct 10 – 16, 2021", "value": 53, "isPartial": false }
    ],
    "interestByRegion": [
        { "code": "US-HI", "name": "Hawaii", "value": 93, "shareOfComparison": 63 }
    ],
    "relatedQueries": {
        "top": [
            { "query": "coffee near me", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=coffee+near+me&date=today+5-y&geo=US" }
        ],
        "rising": [
            { "query": "ryze coffee", "value": 10400, "formattedValue": "Breakout", "link": "https://trends.google.com/trends/explore?q=ryze+coffee&date=today+5-y&geo=US", "isBreakout": true }
        ]
    },
    "relatedTopics": { "top": [], "rising": [] },
    "geo": "US",
    "timeRange": "today 5-y",
    "timeRangeLabel": "Past 5 years",
    "category": "All categories",
    "searchType": "web",
    "trendsUrl": "https://trends.google.com/trends/explore?date=today+5-y&geo=US&q=coffee%2Ctea%2Cmatcha",
    "scrapedAt": "2026-10-12T18:20:00.000Z"
}
```

In the dataset's table view the lists are summarised by `dataPoints`, `regionCount` and `relatedQueryCount`; switch to **All fields** or export JSON to get the lists themselves.

#### Row output

With `outputFormat` set to `rows`, each term is spread into flat rows instead — easy to open in a spreadsheet, chart or load into a database. Every row carries the term, place, period and link.

```json
{ "type": "interest_over_time", "searchTerm": "coffee", "date": "2021-10-10T00:00:00.000Z", "label": "Oct 10 – 16, 2021", "value": 53, "isPartial": false, "geo": "US", "timeRange": "today 5-y" }
{ "type": "interest_by_region", "searchTerm": "coffee", "code": "US-HI", "name": "Hawaii", "value": 93, "geo": "US", "timeRange": "today 5-y" }
{ "type": "related_query", "searchTerm": "coffee", "ranking": "rising", "position": 1, "query": "ryze coffee", "value": 10400, "formattedValue": "Breakout", "isBreakout": true, "geo": "US", "timeRange": "today 5-y" }
```

A term over the past 12 months gives roughly 53 time rows, up to a few hundred region rows and up to 50 related-search rows. Turn off the parts you do not need under **What to collect** to get only the rows you want. The dataset has a ready-made table view for each kind of row.

#### Trending item

```json
{
    "type": "trending",
    "rank": 1,
    "term": "columbus day",
    "searchVolume": 500000,
    "searchVolumeFormatted": "500K+",
    "growthPercent": 500,
    "isActive": true,
    "startedAt": "2026-10-11T21:00:00.000Z",
    "endedAt": null,
    "categories": ["Hobbies and Leisure"],
    "relatedSearches": ["is today a federal holiday", "indigenous peoples day"],
    "news": [
        {
            "title": "What is open and closed on Columbus Day",
            "url": "https://www.example.com/news/columbus-day",
            "source": "Example News",
            "publishedAt": "2026-10-12T17:04:56.000Z",
            "imageUrl": "https://encrypted-tbn1.gstatic.com/images?q=..."
        }
    ],
    "geo": "US",
    "timeframeHours": 24,
    "trendsUrl": "https://trends.google.com/trends/explore?q=columbus+day&date=now+1-d&geo=US",
    "scrapedAt": "2026-10-12T18:20:00.000Z"
}
```

### Good to know

- **Values are relative, not counts.** Google Trends scores interest from 0 to 100 within the period and place you choose: 100 is the peak, 50 is half as popular. In a comparison all terms share one scale, so `averageInterest` shows how they rank against each other.
- **The latest point can be incomplete.** The current hour, week or month is still filling up; such points have `isPartial: true`, and `latestInterest` skips them.
- **Rising queries.** `value` is the growth in percent; `Breakout` means growth above 5,000%. Google does not filter this list for relevance — a search for "openai" can be led by "walmart near me" — so each item also has `topRisingQueryWithTerm`: the fastest rising search that contains the term itself.
- **Too little data.** For rare terms, small places or narrow periods Google has nothing to show. The item is still returned, with `hasData: false`.
- **Region detail depends on the place.** Countries exist only for worldwide searches, metro areas mainly in the United States, and city data is missing for short periods. When Google has nothing at the level you chose, the actor uses the level Google offers by default and says so in the log.
- **Related topics** are returned when Google provides them; lately it often does not.
- **Trending Now** is not available for every country, and Google decides how many trends it lists — a few dozen in small countries, several hundred in large ones. `rank` is the trend's position in Google's full list, so it keeps its place when you filter.
- **Proxies.** Google limits how many Trends requests one IP address may make. The actor spreads its requests over many addresses, starting on datacenter proxies and switching to residential proxies by itself if Google begins refusing them.

### Billing

You pay per result saved to the dataset — one per search term and one per trending search. With row output each row is a result, so a term costs as many results as it has rows; use it when you want the flat format, and the default when you want the most data per result. The run stops on its own when it reaches the maximum charge you set, so you never pay for more than you asked for.

### Local development

```bash
npm install
npm test          # parser, input and scraping-flow unit tests
apify run         # runs with the input in storage/key_value_stores/default/INPUT.json
```

# Actor input Schema

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

Keywords or topics to analyse, one search per line — e.g. "bitcoin". To compare terms with each other, put up to five on one line separated by commas — e.g. "bitcoin, ethereum, dogecoin".

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

Where the searches were made. Leave on Worldwide for global data.

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

The period to analyse. Short ranges give minute-by-minute or hourly data, long ranges weekly or monthly data.

## `startDate` (type: `string`):

Start of a custom period (yyyy-mm-dd). Set it together with the end date; the two replace the time range above.

## `endDate` (type: `string`):

End of a custom period (yyyy-mm-dd).

## `category` (type: `string`):

Limit the analysis to searches in one category — useful for words with several meanings, such as "apple" or "jaguar".

## `searchType` (type: `string`):

Which Google search to look at.

## `outputFormat` (type: `string`):

One result per term keeps everything about a term together, with the time series, regions and related searches as lists inside it. One row per data point spreads those lists into flat rows — a row per date, per region and per related search — ready for a spreadsheet or database. Rows are separate results, so a term produces many of them.

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

Or paste links copied from trends.google.com/trends/explore — the terms, country, period, category and search type are read from each link.

## `geoCodes` (type: `array`):

Run every search for each of these places, one code per line — countries such as "US" or "GB", or regions such as "US-CA" (California) or "GB-ENG" (England). Replaces the country chosen above.

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

When on, "bitcoin, ethereum" compares the two terms. Turn it off to search a phrase that contains a comma.

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

How search interest changed over the period, on Google's 0–100 scale.

## `includeInterestByRegion` (type: `boolean`):

Where the term is searched most.

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

How finely interest by region is broken down. Automatic gives countries for a worldwide search and states or provinces inside a country.

## `includeLowVolumeRegions` (type: `boolean`):

Google leaves out places with a low search volume by default.

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

What else people who searched the term looked for — the most common searches and the fastest rising ones.

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

Topics connected to the term, when Google provides them.

## `trendingCountries` (type: `array`):

Get the searches that are spiking right now in these countries. Leave empty to skip Trending Now.

## `trendingHours` (type: `string`):

How far back to look for trends.

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

Only trends in these categories. Leave empty for all.

## `trendingStatus` (type: `string`):

Keep trends that are still growing, ones that have ended, or both.

## `trendingMaxItems` (type: `integer`):

How many trends to return for each country, strongest first. 0 returns all of them — often several hundred.

## `trendingIncludeNews` (type: `boolean`):

Add the news articles Google links to each trend. One extra request per trend, so the run takes longer.

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

Language of region names, topics and date labels, e.g. en-US, fr, de, pt-BR.

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

Proxy used to reach Google Trends. With the default setting the scraper starts on Apify datacenter proxies and moves to residential proxies by itself if Google begins limiting requests.

## Actor input object example

```json
{
  "searchTerms": [
    "bitcoin"
  ],
  "geo": "",
  "timeRange": "today 12-m",
  "category": "0",
  "searchType": "web",
  "outputFormat": "nested",
  "geoCodes": [],
  "compareTerms": true,
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "auto",
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "trendingCountries": [],
  "trendingHours": "24",
  "trendingCategories": [],
  "trendingStatus": "all",
  "trendingMaxItems": 50,
  "trendingIncludeNews": false,
  "language": "en-US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

The scraped data as dataset items — one item per search term, and one per trending search.

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

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

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

```

## MCP server setup

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