# Google Trends API & Scraper + AI Trend Insights (`qlufiq/google-trends-ai-insights`) Actor

Google Trends API & scraper: interest over time, by region, related queries and topics, keyword comparisons and trending searches. Plus AI trend summaries, spike detection and content ideas. Failed keywords are never charged.

- **URL**: https://apify.com/qlufiq/google-trends-ai-insights.md
- **Developed by:** [lufi aq](https://apify.com/qlufiq) (community)
- **Categories:** SEO tools, Marketing, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 keyword reports

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 & Scraper + AI Trend Insights

Get **reliable Google Trends data** for any list of keywords:

- interest over time
- interest by region
- related queries (top and rising, including "Breakout")
- related topics
- multi-keyword comparisons
- today's trending searches

On top of the data, an **AI analyst** explains what the trend means: a plain-language summary, why each spike happened, where the trend is going, which keywords to target, and ready-to-use content ideas for your blog, YouTube channel, store or social media.

**Failed keywords are never charged.** The run finishes cleanly before your timeout instead of timing out.

### Use cases

- **Bloggers, YouTubers and creators:** know when a topic peaks and get content ideas that match rising searches.
- **SEO and keyword research:** compare keywords on one scale, find breakout queries and regional demand.
- **E-commerce and product research:** validate demand and seasonality before you stock or launch a product.
- **Marketing and agencies:** weekly trend reports for clients, in any language (for example Indonesian).

### Quick start

1. Click **Start** with the default input (`pickleball`, `air fryer` and a ChatGPT vs Gemini vs Claude comparison). It finishes in 1–2 minutes for under $0.10.
2. Put your own `keywords`, `geo` and `timeRange`. Turn `aiInsights` off if you only need the raw data.
3. Schedule it weekly and connect the dataset to Google Sheets, Make or Zapier.

### Why this Actor

| | This Actor | Typical Google Trends scrapers |
|---|---|---|
| Rate limits (429) | Every retry uses a **new IP** (Apify Proxy session rotation), exponential backoff, automatic escalation from datacenter to residential IPs | Retry on the same IP, or the run fails |
| Long runs | **Time budget**: stops starting new keywords before the run timeout and finishes with status SUCCEEDED | Run ends as TIMED-OUT and data is lost |
| Partial failures | A failed keyword never fails the run. Pieces fetched in earlier attempts are kept | One bad keyword can fail everything |
| Billing | Only successful reports are charged. Keywords Google has no data for are free | Charged per dataset row, errors included |
| Analysis | Trend direction, % change, robust spike detection, seasonality, breakout queries, plus **AI insights** | Raw numbers only |
| Output | One clean JSON report per keyword or comparison, with table views | Many fragmented rows |

### What you get per keyword

```json
{
  "type": "keyword",
  "keywords": ["pickleball"],
  "geo": "US",
  "timeRange": "today 12-m",
  "interestOverTime": [{ "date": "2026-04-12T00:00:00.000Z", "formattedTime": "Apr 12 – 18, 2026", "values": { "pickleball": 100 }, "isPartial": false }],
  "interestByRegion": [{ "geoCode": "US-HI", "geoName": "Hawaii", "values": { "pickleball": 100 } }],
  "relatedQueries": { "pickleball": { "top": [{ "query": "pickleball paddle", "value": 100, "formattedValue": "100", "isBreakout": false }], "rising": [{ "query": "best pickleball paddles 2026", "value": 5000, "formattedValue": "Breakout", "isBreakout": true }] } },
  "relatedTopics": { "pickleball": { "top": [], "rising": [] } },
  "stats": {
    "pickleball": {
      "average": 47.3, "latest": 42, "peak": 100, "peakDate": "2026-04-12T00:00:00.000Z",
      "changePct": 7.9, "slopePerPeriod": 0.12, "direction": "stable", "seasonality": null,
      "spikes": [{ "date": "2026-04-12T00:00:00.000Z", "value": 100, "score": 4.1 }],
      "breakoutQueries": ["best pickleball paddles 2026"]
    }
  },
  "aiInsight": {
    "summary": "U.S. interest in pickleball peaked in mid-April 2026 and has eased since; the latest reading is 42/100.",
    "trendExplanation": "Interest climbs every spring with outdoor play and stays high into June…",
    "spikeExplanations": [{ "date": "2026-04-12", "explanation": "Likely the start of the outdoor season…" }],
    "contentIdeas": [{ "title": "Best Pickleball Paddles of 2026", "angle": "Compare by skill level…", "format": "Buyer's guide" }],
    "keywordOpportunities": ["pickleball paddle", "indoor pickleball near me"],
    "outlook": "Expect the next rise from late March; publish spring content in February.",
    "model": "gpt-6-luna"
  },
  "warnings": [],
  "attempts": 1,
  "exploreUrl": "https://trends.google.com/trends/explore?q=pickleball&date=today+12-m&geo=US",
  "error": null
}
```

The key-value store also holds a **run report**: `REPORT` (JSON) and `REPORT_MD` (Markdown). It lists rising and falling keywords, the biggest spikes, breakout queries, the AI summaries and any failures.

### Input

| Field | Description |
|---|---|
| `keywords` | One full report per keyword (up to 500) |
| `compareGroups` | Compare 2–5 keywords on the same 0–100 scale, e.g. `"chatgpt, gemini, claude"` |
| `geo` | `US`, `ID`, `GB`… or a sub-region like `US-CA`. Empty = worldwide |
| `timeRange` / `customTimeRange` | Past hour → 2004-present, or `"2025-01-01 2025-12-31"` |
| `category`, `property` | Google Trends category ID; web, image, news, Shopping or YouTube search |
| `includeInterestByRegion`, `includeRelatedQueries`, `includeRelatedTopics` | Choose the data you need |
| `trendingNowGeos` | Also fetch today's trending searches for these countries |
| `aiInsights`, `insightLanguage`, `contentGoal` | AI analysis on or off, its language (any, e.g. "Indonesian"), and the type of content ideas |

### Pricing (pay per event)

| Event | Price |
|---|---|
| Keyword report (interest over time + region + related queries + related topics) | $0.004 |
| Comparison report (2–5 keywords on one scale) | $0.008 |
| AI insight (per report) | $0.02 |
| Trending now row | $0.0005 |
| Actor start | $0.001 |

- 100 keywords with full data = **$0.40**. Add AI insights for $2.00 more.
- Not charged:
  - keywords that failed after all retries
  - keywords Google has no data for
  - AI insights that could not be generated
- Platform usage (compute and proxy) is included in the price.
- Set **Maximum cost per run** in the run options. The Actor never starts work it cannot charge for within that limit.

### Good to know

- **The data is relative.** Google Trends values go from 0 to 100, where 100 is the peak for that query, place and time. They are not search volumes. Use comparisons to put keywords on the same scale.
- **Sampling.** Google Trends is computed from a sample of searches, so two requests for the same query can differ by a few points. This is normal and happens on the website too.
- **Related topics.** Google currently returns "not enough data" for related topics on most queries, including on the Google Trends website. They are included whenever Google provides them, and a warning tells you when it doesn't. Comparisons never have related topics.
- **Rising queries** sometimes contain unrelated searches; this is how Google reports them. The AI insight is told to ignore clearly unrelated ones.
- **AI insights** explain spikes from the data, related queries and well-known events. Treat these explanations as hypotheses ("likely"), not confirmed causes.
- This Actor uses publicly available Google Trends data and is not affiliated with Google.

### FAQ

**How reliable is it?** Every request that is rate limited or blocked is retried from a different IP, with increasing waits, and escalates to residential IPs when datacenter IPs are blocked. Before release we measured 0 failed reports out of 137 across 17 runs on the Apify platform (see the changelog).

**Can I run it on a schedule?** Yes. Use Apify Schedules (for example weekly) and connect the dataset to Google Sheets, Make, Zapier or your own API.

**Can AI agents use it?** Yes. This Actor is enabled for **x402 agentic payments**. An AI agent can run it through the Apify API or MCP server and pay per event in USDC on Base, without an Apify account or API key. See the [Apify x402 docs](https://docs.apify.com/platform/integrations/x402).

### More Actors by the same developer

- [AI Visibility Tracker](https://apify.com/qlufiq/ai-answer-visibility-tracker): does ChatGPT search, Grok and DeepSeek mention and cite your brand?
- [Government Tenders & AI Bid Matcher](https://apify.com/qlufiq/tender-finder-ai): open tenders from EU TED, UK, SAM.gov, Canada, Australia, World Bank and UN, scored by AI for your company.

# Changelog

This Actor's version history is a separate document: https://apify.com/qlufiq/google-trends-ai-insights/changelog.md

# Actor input Schema

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

One full report per keyword: interest over time, interest by region, related queries and related topics. Up to 500.

## `compareGroups` (type: `array`):

Compare 2–5 keywords on the same 0–100 scale. One line per comparison, keywords separated by commas, e.g. "chatgpt, gemini, claude".

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

ISO country code ("US", "ID", "GB"), a sub-region ("US-CA"), or empty for worldwide.

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

Period to analyze. Short ranges (hours/days) use finer time steps.

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

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

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

Google Trends category ID. 0 = all categories (e.g. 71 = Food & Drink, 5 = Computers & Electronics).

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

Which Google search to measure: web, images, news, Shopping or YouTube.

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

Include the region breakdown.

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

Granularity of the region breakdown. Automatic = countries for worldwide, regions/states for a country.

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

Top and rising related searches (rising includes "Breakout" queries).

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

Top and rising related topics (single-keyword reports only; Google does not provide them for comparisons).

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

Optional. 2-letter country codes to also fetch today's trending searches for, e.g. "US", "ID".

## `aiInsights` (type: `boolean`):

Add an AI analysis to each report: plain-language summary, explanation of spikes, outlook, keyword opportunities and content ideas. Charged per report (see Pricing).

## `insightLanguage` (type: `string`):

Language for the AI insights, e.g. "English", "Indonesian", "Spanish".

## `contentGoal` (type: `string`):

Tailors the content ideas.

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

Reports fetched in parallel. Higher is faster; the default is tuned for reliability.

## `hl` (type: `string`):

Language for topic names and formatted dates (Google "hl" parameter).

## Actor input object example

```json
{
  "keywords": [
    "pickleball",
    "air fryer"
  ],
  "compareGroups": [
    "chatgpt, gemini, claude"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "category": 0,
  "property": "",
  "includeInterestByRegion": true,
  "regionResolution": "AUTO",
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "trendingNowGeos": [],
  "aiInsights": true,
  "insightLanguage": "English",
  "contentGoal": "general",
  "maxConcurrency": 3,
  "hl": "en-US"
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per keyword or comparison: stats, direction and spikes.

## `insights` (type: `string`):

AI summary, outlook, keyword opportunities and content ideas per report.

## `all` (type: `string`):

Every field: interest over time, by region, related queries and topics, stats and AI insight.

## `report` (type: `string`):

Run summary (Markdown + JSON): rising keywords, biggest spikes, failures.

# 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": [
        "pickleball",
        "air fryer"
    ],
    "compareGroups": [
        "chatgpt, gemini, claude"
    ],
    "geo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("qlufiq/google-trends-ai-insights").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": [
        "pickleball",
        "air fryer",
    ],
    "compareGroups": ["chatgpt, gemini, claude"],
    "geo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("qlufiq/google-trends-ai-insights").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": [
    "pickleball",
    "air fryer"
  ],
  "compareGroups": [
    "chatgpt, gemini, claude"
  ],
  "geo": "US"
}' |
apify call qlufiq/google-trends-ai-insights --silent --output-dataset

```

## MCP server setup

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

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/NQ3GbclHpP75EUE52/builds/cgsjwNk2dvq8ac6tQ/openapi.json
