# Google Trends Scraper API – Interest, Related & Trending Now (`k-data-lab/google-trends-scraper`) Actor

Google Trends API, no login or key: interest over time, rising trend label, interest by region, related & rising queries, compare 5 keywords, and Trending now searches with volume for any country. $0.002 per keyword report; first 50 reports a month free.

- **URL**: https://apify.com/k-data-lab/google-trends-scraper.md
- **Developed by:** [K-Data Lab](https://apify.com/k-data-lab) (community)
- **Categories:** SEO tools, Marketing, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 API: Related Queries, Interest Over Time & Trending Now (No Login)

**Get Google Trends data as clean JSON, with no login and no API key.** Type a search term, or up to 5 terms to compare, and get one row with everything the Explore page shows: interest over time, interest by region (countries, states, metro areas or cities), and top and rising related queries. Each row also answers the usual question in plain columns: `trend` (rising, falling or stable), `changePercent`, `topRegion`, `topRisingQuery`, and in a comparison the `leader`. Add countries to also get Google's **Trending now** list: what people search right now, with search volume, growth %, start time and related searches. Export as JSON, CSV or Excel, or call the actor as an API from code, n8n, Make, Zapier or an AI agent.

**Built for:** keyword and content research, SEO, spotting rising queries before competitors, seasonal demand planning for e-commerce, newsroom and social-media trend alerts, market research dashboards, and feeding trend data to an LLM.

**Your first 50 keyword reports and 500 trending searches each month are free**, so a first test costs only the $0.005 start fee, which Apify's free $5 monthly credit covers. After that it's **$0.002 per keyword report** (a whole report, not per data point) and **$0.25 per 1,000 trending searches**. Click Start and the prefilled run returns 2 reports and 20 trending searches in about 5 seconds. This tool is unofficial and not affiliated with Google.

Real rows from 9 November 2026 (United States, past 5 years):

| Search term (`input`) | `average` | Peak week | `topRegion` | `topRisingQuery` |
|---|---:|---|---|---|
| hurricane | 3.3 | 2024-10-06 | Florida | milton hurricane tracker (Breakout) |
| green bay packers | 19 | 2026-11-08 | Wisconsin | green bay packers schedule 2026 (Breakout) |
| super bowl | 4.2 | 2024-02-11 | Kansas | super bowl halftime show 2026 (Breakout) |
| lakers | 12.7 | 2023-05-07 | California | austin reaves (+3,250%) |

And from Trending now, United States, past 24 hours:

| Rank | Trending search | Volume | Growth | Started (UTC) | Category |
|---:|---|---|---:|---|---|
| 1 | buccaneers vs bears | 500K+ | +1,000% | 2026-11-08 21:50 | Sports |
| 2 | packers vs patriots | 1M+ | +1,000% | 2026-11-08 13:20 | Sports |
| 9 | nvidia | 200K+ | +1,000% | 2026-11-08 20:20 | Other |

#### 🚀 Pick your starting point

| You want | Paste this input |
|---|---|
| One keyword, past 12 months, US | `{ "searchTerms": ["air fryer"], "geo": "US" }` |
| Compare up to 5 terms on one scale | `{ "searchTerms": ["iphone, samsung galaxy, pixel"], "geo": "US" }` |
| Many keywords at once | `{ "searchTerms": ["coffee", "tea", "matcha", "kombucha"], "geo": "GB" }` |
| Five years, worldwide | `{ "searchTerms": ["bitcoin"], "timeRange": "today 5-y" }` |
| A custom period | `{ "searchTerms": ["black friday"], "timeRange": "custom", "customTimeRange": "2025-10-01 2025-12-31" }` |
| YouTube or Shopping interest | `{ "searchTerms": ["lego"], "searchProperty": "youtube" }` |
| City-level demand | `{ "searchTerms": ["pickleball"], "geo": "US", "regionResolution": "CITY" }` |
| Paste a link from Google Trends | `{ "trendsUrls": ["https://trends.google.com/trends/explore?q=chatgpt,gemini&geo=US"] }` |
| What's trending now in 3 countries | `{ "trendingCountries": ["US", "GB", "KR"], "maxTrendingPerCountry": 50 }` |
| A week of trends, Sports + Technology | `{ "trendingCountries": ["US"], "trendingHours": "168", "trendingCategories": ["17", "18"], "maxTrendingPerCountry": 0 }` |

#### 🔍 What does it do?

- **Interest over time.** Google's 0–100 timeline for the term, from the past hour (minute steps) to 2004–now (month steps), with the partial last period flagged.
- **A summary per term.** Each term gets `average`, `latest`, `peak`, `peakDate`, `changePercent` and `trend` (rising / falling / stable), so you can sort 500 keywords without opening the timelines.
- **Flat columns for CSV, Excel and AI agents.** `trend`, `changePercent`, `average`, `leader`, `topRegion`, `topRelatedQuery`, `topRisingQuery` and `topRisingQueryLabel` sit at the top level of each row, so a spreadsheet or an agent reads the answer without unpacking nested arrays.
- **Comparisons.** Up to 5 terms on one line share one scale, exactly like Google Trends' Compare.
- **Interest by region.** Countries, regions/states, US metro areas (DMA) or cities, with an automatic fallback when Google doesn't offer a level.
- **Related queries.** Top and rising, with the growth % or "Breakout" (over +5,000%).
- **Trending now.** Google's list for any country or US state, for the past 4, 24, 48 hours or 7 days (3,000+ trends for the US in a week), with volume, growth, start and end time, categories and related searches.
- **Every filter Google has.** Location, time range, category, and search type (web, YouTube, news, images, Google Shopping). Topic IDs like `/m/027lnzs` work too.

#### 💡 Why choose this actor?

| | This actor | The most-used Google Trends scrapers on the Store (checked 9 Nov 2026) |
|---|---|---|
| Price per keyword report (Bronze) | **$0.002** | $0.005 on the most-used one |
| Price per 1,000 trending searches (Bronze) | **$0.25** | $0.40 to $1.20; some add a $0.02–0.025 start fee |
| Free every month | ✅ 50 reports + 500 trending searches | None |
| Keywords and Trending now in one run | ✅ | Usually one mode per run or per actor |
| Compare up to 5 terms on one scale | ✅ | Varies |
| Summary numbers on each row (average, peak, change, rising/falling) | ✅ | Raw timelines only |
| Top region and top rising query as flat CSV columns | ✅ | Nested arrays |
| Trending now: start/end time, growth %, 4 h to 7 days | ✅ | Varies |
| Status on every row | ✅ Not enough data is a free row with a reason, not a silent gap | Varies |

Our test runs: 108 keyword reports in 49 seconds with 0 refused requests and 0 failures; 12,401 trending searches from 5 countries (7 days) in 42 seconds.

#### 💰 Pricing

You pay per event, and only for complete reports and trending searches you receive.

| Event | What you get | Free plan | Bronze | Silver | Gold | Platinum+ |
|---|---|---:|---:|---:|---:|---:|
| `keyword-report` | One complete report (timeline, regions, related queries) for a term or a comparison | $0.0025 | $0.002 | $0.0018 | $0.0015 | $0.0012 |
| `trending-search` | One Trending now search | $0.30 / 1K | $0.25 / 1K | $0.20 / 1K | $0.15 / 1K | $0.15 / 1K |
| `apify-actor-start` | Charged once per run | $0.005 | $0.005 | $0.005 | $0.005 | $0.005 |

**Free every month:** the first 50 keyword reports and the first 500 trending searches for each user. Reports with status `NO_DATA`, `PARTIAL`, `INVALID_INPUT` or `UNAVAILABLE` are never charged. Put many keywords in one run: the start fee is paid once. Set a maximum cost per run and the actor stops cleanly at that limit; in our test a $0.02 limit returned exactly 7 reports.

#### 📥 Input

| Field | What it does |
|---|---|
| `searchTerms` | One report per line. Up to 5 terms on one line, separated by commas, are compared |
| `trendsUrls` | Google Trends Explore links; their terms, location, period, category and search type are used |
| `geo` | `US`, `GB`, `KR` …, a region like `US-CA`, or empty for worldwide |
| `timeRange` | Past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months (default), 5 years, 2004 to now, or custom |
| `customTimeRange` | `2024-01-01 2024-12-31`, or with hours: `2026-11-01T00 2026-11-07T00` |
| `searchProperty` | `web`, `youtube`, `news`, `images` or `shopping` |
| `category` | Google Trends category ID, e.g. 5 Computers & Electronics, 18 Shopping, 20 Sports, 71 Food & Drink |
| `includeRegions`, `regionResolution`, `maxRegions` | Interest by region, at country, region, metro or city level |
| `includeRelatedQueries`, `includeRelatedTopics` | Related queries and topics (top and rising) |
| `trendingCountries` | Countries or US states for Trending now |
| `trendingHours` | 4, 24 (default), 48 or 168 |
| `trendingCategories`, `trendingActiveOnly` | Keep only some categories, or only trends still rising |
| `maxTrendingPerCountry`, `maxRelatedQueriesPerTrend` | Caps for Trending now (0 = all) |
| `language` | Labels and region names, e.g. `en-US`, `de`, `ko`, `ja` |

#### 📤 Output

A keyword report (shortened):

```json
{
  "type": "keyword",
  "status": "OK",
  "input": "chatgpt",
  "searchTerms": ["chatgpt"],
  "geo": "US",
  "timeRange": "today 12-m",
  "period": "2025-11-09 2026-11-09",
  "resolution": "WEEK",
  "searchProperty": "web",
  "trendsUrl": "https://trends.google.com/trends/explore?q=chatgpt&date=today%2012-m&geo=US",
  "average": 80.9,
  "changePercent": -4.2,
  "trend": "stable",
  "leader": null,
  "topRegion": "California",
  "topRelatedQuery": "ai chatgpt",
  "topRisingQuery": "chatgpt caricature",
  "topRisingQueryLabel": "+3,400%",
  "terms": [{ "term": "chatgpt", "label": "chatgpt", "average": 80.9, "latest": 85, "peak": 100, "peakDate": "2025-11-09", "changePercent": -4.2, "trend": "stable" }],
  "interestOverTime": [
    { "date": "2026-11-01", "label": "Nov 1 – 7, 2026", "value": 85, "values": [85], "hasData": true, "isPartial": false },
    { "date": "2026-11-08", "label": "Nov 8 – 14, 2026", "value": 64, "values": [64], "hasData": true, "isPartial": true }
  ],
  "interestByRegion": [{ "geoCode": "US-CA", "geoName": "California", "value": 100, "values": [100] }],
  "regionResolution": "REGION",
  "relatedQueriesTop": [{ "term": "chatgpt", "query": "ai chatgpt", "value": 100 }],
  "relatedQueriesRising": [{ "term": "chatgpt", "query": "chatgpt caricature", "value": 3400, "isBreakout": false, "label": "+3,400%" }],
  "relatedTopicsTop": [],
  "relatedTopicsRising": [],
  "note": "Google returned no related topics for this term.",
  "scrapedAt": "2026-11-09T03:15:20Z"
}
```

In a comparison, `values` holds one number per term in the order of `searchTerms`, and `value` is the first term. The flat columns (`average`, `changePercent`, `trend`, `topRisingQuery` …) also describe the first term, and `leader` names the term with the highest average. A Trending now row:

```json
{
  "type": "trending",
  "rank": 2,
  "query": "packers vs patriots",
  "country": "US",
  "hours": 24,
  "searchVolume": 1000000,
  "searchVolumeLabel": "1M+",
  "increasePercent": 1000,
  "isActive": true,
  "startedAt": "2026-11-08T13:20:00Z",
  "endedAt": null,
  "categories": ["Sports"],
  "categoryIds": [17],
  "relatedQueries": ["drake maye", "patriots", "drake maye stats", "new england patriots", "jordan love"],
  "relatedQueriesCount": 39,
  "news": [],
  "trendsUrl": "https://trends.google.com/trends/explore?q=packers%20vs%20patriots&date=now%201-d&geo=US"
}
```

The **Keyword reports** and **Trending now** views in the Output tab show the main columns. `RUN_SUMMARY` in the key-value store lists the status of every input.

#### ❓ FAQ

**What do the numbers mean?** Google Trends doesn't give search counts for keywords. It scales interest from 0 to 100, where 100 is the peak for the chosen term, place and period. In a comparison the scale is shared, so a 9 next to a 100 means about 11 times fewer searches. Trending now `searchVolume` is Google's own estimate (500K+ means at least 500,000 searches).

**Why does a number differ slightly from what I see on trends.google.com?** Google samples searches, so a report can shift by a point or two between days. Our values come unchanged from the same data Google Trends serves. We checked them against known facts: Packers peaks in Wisconsin, Red Sox in Massachusetts, Super Bowl every February, hurricane in Florida with Ian and Milton among the rising queries.

**What are `changePercent` and `trend`?** `changePercent` compares the average of the last 4 complete points with the first 4 points of the period. `trend` turns it into a word: `rising` at +10 % or more, `falling` at -10 % or less, otherwise `stable`. A quick "is it growing?" signal for sorting many keywords; use the timeline for anything precise.

**Why is a report `NO_DATA`?** Google Trends has not enough search volume for that term, place and period (for example a rare term in the past hour). The row says so, and it is free.

**Why are related topics empty?** In our November 2026 tests Google's Trends API returned an empty related-topics list for every term (108 of 108). We pass them on as soon as Google sends them, and the row note says when it didn't. Related queries work for all of them. In comparisons Google shows related topics for none of the terms.

**What does `PARTIAL` mean?** Google didn't answer one part (usually the region map) after several tries. The row has the rest, is marked `PARTIAL` and isn't charged.

**Which region levels work?** Countries for worldwide, regions/states inside a country, US metro areas (DMA) and cities. Google doesn't offer every level for every view, for example cities in a worldwide comparison. Then we use Google's own level and say so in `note`. City rows have names and coordinates but no code.

**How many keywords can I run?** As many as you like in one run; reports are fetched 6 at a time. 108 reports took 49 seconds in our test.

**How fresh is Trending now?** It's read live when the run starts. Schedule the actor (for example every hour) and use `startedAt` and `isActive` to see what's new.

**Do I need a Google account or proxies?** No. The actor uses the public data the Google Trends site loads, and switches to Apify Proxy by itself if Google slows it down.

**Is it legal?** It collects public, aggregated search-interest data, not personal data. You're responsible for how you use it, including Google's terms.

#### 🤖 Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/k-data-lab~google-trends-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms":["air fryer","iphone, samsung galaxy"],"geo":"US","timeRange":"today 5-y"}'
```

#### 🧠 Use it from AI agents (MCP)

Connect the Apify MCP server to Claude, ChatGPT, Cursor or any other MCP client with this actor already loaded as a tool:

```
https://mcp.apify.com?tools=actors,k-data-lab/google-trends-scraper
```

It returns plain JSON with the answer already computed: `trend` says rising, falling or stable, `leader` says which compared term wins, and `topRisingQuery` gives the fastest-growing related search. An agent can answer "is this growing?" without parsing a chart.

| The agent is asked to | Input to send |
|---|---|
| Is interest in a product growing in the US? (read `trend`) | `{ "searchTerms": ["<product>"], "geo": "US", "timeRange": "today 5-y" }` |
| Which of these brands is searched more? (read `leader`) | `{ "searchTerms": ["<brand a>, <brand b>, <brand c>"] }` |
| Find rising keywords around a topic | `{ "searchTerms": ["<topic>"], "includeRegions": false }` |
| Where is a term most popular? | `{ "searchTerms": ["<term>"], "geo": "US", "regionResolution": "CITY", "maxRegions": 20 }` |
| What's trending in Germany today? | `{ "trendingCountries": ["DE"], "maxTrendingPerCountry": 25 }` |

#### 🧰 More from K-Data Lab

**Google and search**

- [Google Maps Scraper API](https://apify.com/k-data-lab/google-maps-scraper): places, phones and ratings
- [Google Ad Library Scraper](https://apify.com/k-data-lab/google-ad-library-scraper): Google Ads Transparency ads by advertiser or domain
- [Google Play Scraper API](https://apify.com/k-data-lab/google-play-scraper): app details and reviews
- [YouTube Scraper API](https://apify.com/k-data-lab/youtube-scraper) · [YouTube Comments Scraper API](https://apify.com/k-data-lab/youtube-comments-scraper)

**Social, reviews and more**

- [TikTok Scraper API](https://apify.com/k-data-lab/tiktok-scraper) · [X (Twitter) Tweet Scraper API](https://apify.com/k-data-lab/x-tweet-scraper) · [Telegram Scraper API](https://apify.com/k-data-lab/telegram-channel-scraper)
- [App Store Reviews Scraper API](https://apify.com/k-data-lab/app-store-scraper) · [Amazon ASIN Rating Scraper](https://apify.com/k-data-lab/amazon-asin-rating-scraper) · [Amazon Seller Central Review Scraper](https://apify.com/k-data-lab/amazon-seller-central-review-scraper)
- [Amazon Best Sellers Scraper](https://apify.com/k-data-lab/amazon-bestsellers-scraper): top 100 Best Sellers and New Releases
- [Airbnb Scraper](https://apify.com/k-data-lab/airbnb-scraper) · [Agoda Scraper](https://apify.com/k-data-lab/agoda-scraper) · [Airline Award Seat Scraper](https://apify.com/k-data-lab/airline-award-seat-scraper) · [Uber Eats & Deliveroo Scraper](https://apify.com/k-data-lab/uber-eats-deliveroo-scraper)
- Korean music charts: [Melon](https://apify.com/k-data-lab/melon-scraper) · [Genie](https://apify.com/k-data-lab/genie-scraper) · [Bugs](https://apify.com/k-data-lab/bugs-scraper) · [FLO](https://apify.com/k-data-lab/flo-scraper) · [VIBE](https://apify.com/k-data-lab/vibe-scraper) · [All charts in one](https://apify.com/k-data-lab/korean-music-chart-scraper)
- Korean real estate: [KB Land](https://apify.com/k-data-lab/kbland-scraper) · [R114](https://apify.com/k-data-lab/r114-scraper)

#### 💬 Feedback

Is a field missing, or does a term not work? Open an issue on the **Issues** tab. We answer the same day.

Tags: google trends scraper, keyword trend direction, rising or falling keywords, top region, google trends api, google trends data, interest over time, related queries, rising queries, breakout keywords, trending searches, google trending now, daily search trends, keyword research, seo trends, search volume trends, compare keywords, pytrends alternative, no login

# Changelog

This Actor's version history is a separate document: https://apify.com/k-data-lab/google-trends-scraper/changelog.md

# Actor input Schema

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

One report per line: interest over time, interest by region, related queries and related topics, plus a <code>trend</code> label (rising, falling or stable), top region and top rising query. To compare terms on the same 0–100 scale, put up to 5 on one line separated by commas, e.g. <code>iphone, samsung galaxy</code>. Topic IDs like <code>/m/027lnzs</code> work too. No Google login or API key needed.

## `trendsUrls` (type: `array`):

Optional. Paste Google Trends Explore links (https://trends.google.com/trends/explore?q=...). Their terms, location, time range, category and search type are used instead of the fields below.

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

2-letter country code (US, GB, DE, KR, JP, IN …), a region such as US-CA or GB-ENG, or empty for worldwide.

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

Period of the report. Google picks the step: minutes for the past hour, hours for the past days, days up to 90 days, weeks up to 5 years, months for 2004 to now.

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

Used when Time range is Custom: <code>2024-01-01 2024-12-31</code>, or with hours (up to 7 days): <code>2026-11-01T00 2026-11-07T00</code>.

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

Which Google search the interest comes from.

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

Google Trends category ID, 0 = all categories. Examples: 3 Arts & Entertainment, 5 Computers & Electronics, 7 Finance, 18 Shopping, 20 Sports, 45 Health, 47 Autos & Vehicles, 71 Food & Drink, 12 Business & Industrial, 174 Science.

## `includeRegions` (type: `boolean`):

Add the regional breakdown (countries for worldwide, states or regions inside a country).

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

Level of the regional breakdown.

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

Also list regions with little search volume (Google's own checkbox).

## `maxRegions` (type: `integer`):

Keep only the top N regions. 0 = all.

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

Add top and rising related queries (rising shows the growth %, or Breakout above 5,000%).

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

Add top and rising related topics. Google shows these for single terms only, not for comparisons.

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

Countries (or US states like US-CA) to read Google's Trending now list for: what people search right now, with search volume, growth, start time and related queries. Example: US, GB, KR.

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

How far back the Trending now list goes. The past 7 days can hold 3,000+ trends for the US.

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

Optional. Keep only trends in these categories. Empty = all.

## `trendingActiveOnly` (type: `boolean`):

Keep only trends that are still rising (no end time yet).

## `maxTrendingPerCountry` (type: `integer`):

Top N trends per country, in Google's order. 0 = all.

## `maxRelatedQueriesPerTrend` (type: `integer`):

How many of Google's related searches to keep per trend. 0 = all.

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

Language for labels, region and topic names (en-US, de, ko, ja …).

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "iphone, samsung galaxy"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "searchProperty": "web",
  "category": 0,
  "includeRegions": true,
  "regionResolution": "AUTO",
  "includeLowVolumeRegions": false,
  "maxRegions": 0,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "trendingCountries": [
    "US"
  ],
  "trendingHours": "24",
  "trendingActiveOnly": false,
  "maxTrendingPerCountry": 20,
  "maxRelatedQueriesPerTrend": 10,
  "language": "en-US"
}
```

# Actor output Schema

## `keywords` (type: `string`):

No description

## `trending` (type: `string`):

No description

## `summary` (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 = {
    "searchTerms": [
        "chatgpt",
        "iphone, samsung galaxy"
    ],
    "geo": "US",
    "trendingCountries": [
        "US"
    ],
    "maxTrendingPerCountry": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("k-data-lab/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": [
        "chatgpt",
        "iphone, samsung galaxy",
    ],
    "geo": "US",
    "trendingCountries": ["US"],
    "maxTrendingPerCountry": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("k-data-lab/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": [
    "chatgpt",
    "iphone, samsung galaxy"
  ],
  "geo": "US",
  "trendingCountries": [
    "US"
  ],
  "maxTrendingPerCountry": 20
}' |
apify call k-data-lab/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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