# Google Trends Scraper — Pay Per Result (`smorgi_apps/google-trends-scraper`) Actor

Reliable Google Trends: multi-geo trending searches (RSS) + keyword interest over time, related queries, and regions. HTTP-only. Empty rows free. Pay-per-event (~$0.50/1k).

- **URL**: https://apify.com/smorgi\_apps/google-trends-scraper.md
- **Developed by:** [Smorgi Apps](https://apify.com/smorgi_apps) (community)
- **Categories:** SEO tools, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 trends records

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/platform/actors/running/actors-in-store#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 — Pay Per Result

Reliable **Google Trends** data without the flaky runs people hit on the default Store scrapers. Two modes:

1. **Trending searches** — public RSS, multi-geo, cheap HTTP
2. **Keyword interest** — interest over time, related queries, optional regions

**Store search keywords:** Google Trends scraper · Google Trends API · trending searches · interest over time · related queries

***

### Why this Actor

| Pain on popular Trends scrapers | What we do |
|--------------------------------|------------|
| ~70% success / silent empties | Retries + backoff; **empty / no-data rows are not charged** |
| Unclear pricing | Flat **pay-per-result** PPE |
| One geo at a time | Batch many country codes in one run |
| Browser-heavy cost | **HTTP-only** (no Playwright) |

Public data only. No Google account. No ToS-evasion playbook.

***

### Modes

#### Trending (`mode: "trending"`)

Fetches [Google Trending RSS](https://trends.google.com/trending/rss?geo=US) for each geo.

| Field | Description |
|-------|-------------|
| `recordType` | `trending` |
| `geo` | Country code |
| `title` | Trending query |
| `traffic` / `trafficValue` | Approx traffic label + parsed int |
| `url` | Trends link when present |
| `publishedAt` | RSS pubDate |
| `newsTitles` | Related news headlines (up to 5) |

#### Interest (`mode: "interest"`)

Uses Google Trends explore + widget APIs (same public endpoints the web UI uses).

| `recordType` | When |
|--------------|------|
| `interest_over_time` | Always (per keyword × time point) |
| `related_query` | If `includeRelatedQueries` (top + rising) |
| `interest_by_region` | If `includeInterestByRegion` |

Keywords are compared in **batches of up to 5** so values share one 0–100 scale.

***

### Example input

```json
{
  "mode": "trending",
  "geos": ["US", "GB", "DE"],
  "maxItemsPerGeo": 20
}
```

```json
{
  "mode": "interest",
  "keywords": ["apify", "scrapy", "playwright"],
  "geos": ["US"],
  "timeRange": "today 12-m",
  "includeRelatedQueries": true,
  "includeInterestByRegion": false
}
```

***

### Pricing

Pay-per-event: charged for each **successful** dataset row.

- Empty geos / missing widgets / `hasData: false` points → **not charged**
- Trending RSS is lightweight — best cost/reliability ratio
- Interest mode uses more requests; raise `requestDelayMs` or enable Apify Proxy if you see 429s

Exact $/1k is on the Store pricing tab (set to cover platform cost with margin).

***

### Limitations (honest)

- Google rate-limits interest APIs; large keyword × geo matrices need throttling
- Traffic values on RSS are approximate buckets (`500+`), not exact volumes
- Interest values are **relative** 0–100 (Google’s normalization), not absolute search volume
- Sub-region resolution depends on the parent `geo`
- Public endpoints only — no private Google Ads / Keyword Planner data

***

### Output tips

- Filter dataset by `recordType`
- Schedule trending mode hourly/daily for monitoring
- For competitor brand tracking, put 2–5 brands in one `keywords` array

Issues / feature requests: use the Actor **Issues** tab.

# Actor input Schema

## `mode` (type: `string`):

trending = daily trending searches via public RSS (cheap, reliable). interest = keyword interest over time (+ optional related queries / regions).

## `geos` (type: `array`):

ISO country codes, e.g. US, GB, DE, JP. Used for both modes.

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

Search terms for interest mode. Compared in batches of up to 5 (shared 0–100 scale). Ignored in trending mode.

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

Google Trends time window for keyword interest.

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

Interest mode: emit top + rising related queries. Empty/missing related lists are not charged.

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

Interest mode: emit sub-region interest rows. Off by default (extra API calls / 429 risk).

## `maxItemsPerGeo` (type: `integer`):

Cap for trending RSS items per country (RSS usually returns ~10–25).

## `requestDelayMs` (type: `integer`):

Throttle to reduce Google 429s. Increase if you see rate limits.

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

Optional. Trending RSS usually works without proxies. Enable Apify Proxy if interest mode hits 429/403.

## Actor input object example

```json
{
  "mode": "trending",
  "geos": [
    "US"
  ],
  "keywords": [
    "apify",
    "web scraping"
  ],
  "timeRange": "today 12-m",
  "includeRelatedQueries": true,
  "includeInterestByRegion": false,
  "maxItemsPerGeo": 25,
  "requestDelayMs": 1200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (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 = {
    "geos": [
        "US"
    ],
    "keywords": [
        "apify",
        "web scraping"
    ],
    "maxItemsPerGeo": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("smorgi_apps/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 = {
    "geos": ["US"],
    "keywords": [
        "apify",
        "web scraping",
    ],
    "maxItemsPerGeo": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("smorgi_apps/google-trends-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "geos": [
    "US"
  ],
  "keywords": [
    "apify",
    "web scraping"
  ],
  "maxItemsPerGeo": 25
}' |
apify call smorgi_apps/google-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=smorgi_apps/google-trends-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/E9aUGNEEtKu1zL6rJ/builds/Hfmm3hGu9UiNJMS0G/openapi.json
