# Google Trends Scraper & API — Trending Now (`automationnation/google-trends-scraper`) Actor

Google Trends scraper and API: interest over time, by region and city, and rising related queries for any number of keywords, plus Trending now searches with volume, growth % and news. Compare unlimited terms on one scale. Only-new mode for trend alerts. $1 per 1,000 reports.

- **URL**: https://apify.com/automationnation/google-trends-scraper.md
- **Developed by:** [Nathan Carter](https://apify.com/automationnation) (community)
- **Categories:** SEO tools, Marketing, AI
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.27 / 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

**Google Trends Scraper is an Apify Actor that extracts Google Trends data for any keywords and regions.** You get interest over time, interest by region and city, related queries, and the trending searches for any country, at $1 per 1,000 keyword reports.

It works as a **Google Trends API**:

- call it from code
- schedule it for trend alerts
- let AI agents (Claude, ChatGPT, Cursor) use it through Apify's MCP server

#### Quick facts

- **What you get, one row per keyword:**
  - the 0–100 timeline with dates
  - trend direction (`rising` / `falling` / `stable`), change %, peak date
  - a one-sentence summary
  - interest by country, state or city
  - top and rising related queries with growth % and "Breakout" flags
- **Trending now:** trending searches for any country with search volume, growth %, start time, related searches and news articles. **Only new trends** mode turns scheduled runs into alerts.
- **Any number of keywords:** compare up to 5 terms like Google Trends does, or **compare any number of terms on one scale**. Bigger comparisons are rescaled through a shared anchor term.
- **Every Google Trends option:**
  - region (any country or subregion)
  - time range (past hour to 2004–present, or custom dates)
  - category
  - search type: web, image, news, YouTube or Google Shopping
- **Inputs:** keywords, Google Trends URLs, or a Google Sheet.
- **Price:** $1 per 1,000 keyword reports and $0.50 per 1,000 trending searches on Apify's Free plan; on paid plans from $0.27 to $0.90 and from $0.20 to $0.40. Reports with too little search volume are free. Apify's free $5 monthly credit covers about 5,000 keyword reports.
- **Reliable:** every search runs in its own session with automatic retries on fresh IPs. In our launch tests, all 80 test searches succeeded on the first attempt.
- **Drop-in replacement for apify/google-trends-scraper:** the same input fields work, and every row also includes that Actor's output fields.
- **AI agents:** connect `https://mcp.apify.com?tools=automationnation/google-trends-scraper` (setup below).

### What does Google Trends Scraper do?

Google Trends shows how often people search for something, relative to all searches, on a 0–100 scale. This Actor reads the same data the trends.google.com pages load and returns it as structured rows:

- **Interest over time.** Each point has a date, an ISO timestamp, a 0–100 value and an `isPartial` flag for the current, incomplete period.
- **Trend metrics:**
  - `trendDirection` and `changePercent`: the latest part of the period compared with the part before it
  - `averageInterest`, `latestInterest`, `peakInterest` and `peakDate`
  - `summary`: one plain-English sentence you can paste into a report or hand to an AI agent
- **Interest by region and city.** Countries (worldwide searches), states or provinces (country searches), cities with coordinates, or US metro areas (DMA).
- **Related queries.** The top 25 and the rising 25 searches for each keyword, with growth % (`+3,200%`) or `Breakout`.
- **Trending now.** What's trending in a country over the past 4, 24 or 48 hours or 7 days, the same list as trends.google.com/trending. Each trend includes:
  - search volume (`50K+`) and growth %
  - start time and whether it's still active
  - categories and related searches
  - news articles: title, link, source, time and image

### Who is it for?

- **SEO and content teams.** Find seasonal peaks, rising queries and content ideas, and plan your content calendar around demand.
- **Marketers and brand managers.** Track brand vs competitor interest over time and by region.
- **E-commerce and product teams.** Spot rising products and regional demand before you stock up or launch.
- **Analysts, investors and researchers.** Collect clean Google Trends time series for dozens or hundreds of terms in one run.
- **Newsrooms and social teams.** Get alerts when something new starts trending in your country or category.
- **AI agents and automations.** Typed output fields, a one-line summary per keyword and a fast default run. It works well through Apify's MCP server, n8n, Make and Zapier.

### Why this Google Trends scraper?

- **Reliable.** Google Trends rate-limits automated traffic hard, and that breaks many Trends tools. Here every search gets a fresh session and IP, and failed requests are retried automatically, escalating to residential IPs. A search that still fails isn't charged.
- **Complete reports in one row.** Interest over time, regions, cities and related queries for every keyword, plus trend metrics and a summary. You don't stitch several runs together.
- **Unlimited comparisons.** Google compares at most 5 terms. Switch on **Compare all search terms on one scale** and any number of terms are batched around an anchor term and rescaled onto one scale.
- **Trending now built in.** It covers any country, time window and category, adds news articles, and has an **Only new trends** mode for scheduled alerts.
- **Low price.** $1 per 1,000 keyword reports on the Free plan, down to $0.27 per 1,000 on Gold plans and above. Keywords without enough search volume cost nothing.
- **Easy to switch to.** It accepts the same input as apify/google-trends-scraper and outputs the same fields (`interestOverTime_timelineData`, `interestBySubregion`, `relatedQueries_top`, …) next to the cleaner ones.

### How to scrape Google Trends

1. Click **Try for free** (or **Start**) on this page.
2. Enter your **search terms**, e.g. `coffee`, `matcha`, `cold brew`.
3. Choose a **region** (e.g. `US`, or leave it empty for worldwide) and a **time range**.
4. Optional: tick **Compare all search terms on one scale**, pick a category or a search type (YouTube, News, Shopping…), or add countries under **Trending now**.
5. Click **Start**. A few keywords take about 10 seconds. Download the results as JSON, CSV or Excel, or read them through the API.

#### Input example

```json
{
  "searchTerms": ["chatgpt", "gemini", "claude ai"],
  "geo": "US",
  "timeRange": "today 12-m",
  "compareAll": true
}
```

More inputs:

- **Trends URL:** `{"startUrls": [{"url": "https://trends.google.com/trends/explore?q=coffee,tea&geo=GB&date=today%205-y"}]}`
- **Trending now alerts** (schedule hourly):
  ```json
  {"trendingGeos": ["US", "GB"], "trendingHours": 4, "onlyNewTrends": true}
  ```
- **YouTube search interest in a category:**
  ```json
  {"searchTerms": ["minecraft"], "searchType": "youtube", "category": "8", "geo": ""}
  ```
- **Custom dates and several regions:**
  ```json
  {"searchTerms": ["electric cars"], "customTimeRange": "2024-01-01 2025-12-31", "geos": ["US", "GB", "DE"]}
  ```

#### Output example

One keyword report (shortened):

```json
{
  "type": "keyword-report",
  "searchTerm": "chatgpt",
  "geo": "US",
  "geoName": "United States",
  "timeRangeLabel": "Past 12 months",
  "hasData": true,
  "averageInterest": 76.7,
  "latestInterest": 73,
  "peakInterest": 100,
  "peakDate": "2025-10-19",
  "changePercent": 7.9,
  "trendDirection": "stable",
  "summary": "Search interest in \"chatgpt\" (United States, past 12 months) is stable (+7.9% vs the previous period). Peak: 100 on 2025-10-19. Latest: 73, average: 76.7. Most interest: California. Top rising query: \"chatgpt caricature\" (+3,200%).",
  "timeline": [
    { "date": "2025-09-28", "timestamp": "2025-09-28T00:00:00.000Z", "formattedTime": "Sep 28 – Oct 4, 2025", "value": 90, "isPartial": false, "hasData": true }
  ],
  "regions": [
    { "geoCode": "US-CA", "name": "California", "value": 100 },
    { "geoCode": "US-NJ", "name": "New Jersey", "value": 93 }
  ],
  "risingQueries": [
    { "query": "chatgpt caricature", "growth": "+3,200%", "growthPercent": 3200, "isBreakout": false }
  ],
  "topQueries": [
    { "query": "what is chatgpt", "value": 100 }
  ],
  "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=chatgpt&geo=US&hl=en-US"
}
```

One trending search (shortened):

```json
{
  "type": "trending-search",
  "rank": 1,
  "title": "pittsburgh vs virginia tech",
  "geo": "US",
  "searchVolume": 20000,
  "searchVolumeLabel": "20K+",
  "increasePercent": 1000,
  "isActive": true,
  "categories": ["Sports"],
  "newsArticles": [
    { "title": "Five Things to Know: Virginia Tech vs. Pitt", "url": "https://hokiesports.com/news/2026/09/29/virginia-tech-football-five-things-to-know-virginia-tech-vs-pitt-2026", "source": "Virginia Tech Athletics" }
  ]
}
```

#### Output fields

| Field | Description |
|---|---|
| `type` | `keyword-report` or `trending-search` |
| `searchTerm`, `geo`, `geoName`, `timeRange`, `timeRangeLabel`, `categoryName`, `searchType` | What was searched |
| `comparedWith`, `scaledToAnchor` | Other terms on the same scale, and the anchor used for comparisons of more than 5 terms |
| `hasData` | `false` when Google has too little search volume (these rows are free) |
| `timeline` | `date`, `timestamp`, `value` (0–100), `isPartial` |
| `averageInterest`, `latestInterest`, `peakInterest`, `peakDate`, `lowestInterest` | Timeline statistics |
| `changePercent`, `trendDirection` | Latest ~15% of the period vs the ~15% before it; ±10% counts as rising or falling |
| `summary` | One-sentence summary |
| `regions`, `cities`, `regionLevel` | Interest by region (`geoCode`, `name`, `value`) and city (`name`, `value`, `lat`, `lng`) |
| `topQueries`, `risingQueries` | Related queries; rising ones carry `growth`, `growthPercent` and `isBreakout` |
| `trendsUrl` | Opens the same search on trends.google.com |
| `inputUrlOrTerm`, `interestOverTime_timelineData`, `interestOverTime_averages`, `interestBySubregion`, `interestByCity`, `relatedQueries_top`, `relatedQueries_rising`, `relatedTopics_top`, `relatedTopics_rising` | Same fields as apify/google-trends-scraper |
| Trending: `title`, `rank`, `searchVolume`, `searchVolumeLabel`, `increasePercent`, `startedAt`, `endedAt`, `isActive`, `categories`, `relatedQueries`, `newsArticles` | One trending search |

The **Run summary** (key-value store `OUTPUT`) lists every search with its status, any warnings, retries, and why the run stopped.

### How much does it cost to scrape Google Trends?

| | Price |
|---|---|
| Keyword report (one term, one region and time range, with timeline, regions, cities and related queries) | **$0.001** ($1 per 1,000) on the Free plan · $0.0009 Bronze · $0.00045 Silver · $0.00027 Gold and above |
| Trending search (with news articles) | **$0.0005** ($0.50 per 1,000) on the Free plan · $0.0004 Bronze · $0.0003 Silver · $0.0002 Gold and above |
| Keyword with too little search volume, or a search that failed | free |

Examples:

- 100 keywords in one country: $0.10.
- 50 keywords in 5 countries: $0.25.
- Hourly Trending now alerts for one country with **Only new trends**: usually a handful of new trends an hour, roughly $0.05–0.25 a day.

Apify's free plan includes $5 of credit every month, which is about 5,000 keyword reports. You can set a maximum cost per run in the run options.

### Trend alerts: Only new trends

Add countries under **Trending now**, switch on **Only new trends**, and schedule the Actor (for example every hour). Each run returns only the trending searches that earlier runs with the same country, time window and category didn't return. Repeats aren't charged. Then connect a Slack, email or webhook integration to get alerted.

### Switching from apify/google-trends-scraper

Change the Actor ID to `automationnation/google-trends-scraper` and keep your input. These fields mean the same here:

- `searchTerms`, `isMultiple`
- `timeRange`, `customTimeRange`
- `geo`, `category`
- `startUrls`, `spreadsheetId`, `maxItems`

Every row still contains `inputUrlOrTerm`, `searchTerm`, `interestOverTime_timelineData`, `interestOverTime_averages`, `interestBySubregion`, `interestByCity`, `relatedQueries_top`, `relatedQueries_rising`, `relatedTopics_top` and `relatedTopics_rising`, next to the cleaner fields described above. Comparisons (`isMultiple`) return one row per term.

### Use Google Trends Scraper with AI agents (MCP)

AI assistants can query Google Trends live through Apify's MCP server.

**Hosted (Claude, ChatGPT, Cursor and other MCP clients that support remote servers).** Add this server URL and sign in with Apify:

```
https://mcp.apify.com?tools=automationnation/google-trends-scraper
```

**Local (Claude Desktop or Cursor config):**

```json
{
  "mcpServers": {
    "google-trends": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--tools", "automationnation/google-trends-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}
```

Then ask, for example:

- "Is interest in 'cold plunge' rising or falling in the US? Which states search for it most?"
- "Compare Google search interest for ChatGPT, Gemini, Claude, Copilot, Perplexity and DeepSeek over the past 12 months."
- "What's trending in the UK right now in Sports? Include the news."

### Integrations and API

- **API:**
  ```bash
  curl -X POST "https://api.apify.com/v2/acts/automationnation~google-trends-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"searchTerms":["coffee","matcha"],"geo":"US","timeRange":"today 5-y"}'
  ```
- **Python / JavaScript:** use the `apify-client` package with Actor ID `automationnation/google-trends-scraper`.
- **n8n, Make, Zapier, Google Sheets, Slack, webhooks:** through Apify's integrations.

### FAQ

**Is there an official Google Trends API?**
In 2025 Google opened an official Google Trends API to a small group of alpha testers. For everyone else there's no public API, so scraping the public Trends data is the practical option. This Actor does that and returns clean JSON for any keywords.

**What do the 0–100 numbers mean?**
They're relative, not search counts. 100 is the peak popularity for the term (or for the group of compared terms) in that region and period, and 50 means half as popular. Terms compared together share one scale. Terms searched separately each have their own.

**Why does my keyword have no data?**
Google only shows terms with enough search volume. Such rows come back with `hasData: false` and aren't charged. Try a broader region, a longer time range, or a more common spelling.

**Can I compare more than 5 keywords?**
Yes. Tick **Compare all search terms on one scale**. The first 5 terms are compared together. Each later batch repeats the most-searched term from the first batch as an anchor, plus 4 new terms, and is rescaled so everything sits on one 0–100 scale. Very rare terms lose some precision when compared with very popular ones, as they do on Google Trends itself.

**What about related topics?**
Google currently withholds related topics from automated sessions, so those fields are usually empty. Related queries (top and rising) are always complete. You can still switch on **Related topics** in the input.

**Which countries does Trending now cover?**
Any country Google Trends lists on trends.google.com/trending, using two-letter codes such as `US`, `GB`, `IN`, `DE`, `BR` or `JP`.

**How fresh is the data?**
It's live: each run reads Google Trends at that moment. The latest point of a timeline is marked `isPartial` until the period ends.

**Is it legal to scrape Google Trends?**
Google Trends shows aggregated, anonymous search statistics, not personal data. You're responsible for how you use the data and for complying with the laws and terms that apply to you.

### More from AutomationNation

- **[Google Jobs Scraper](https://apify.com/automationnation/google-jobs-scraper)**: job listings from Google Jobs with full descriptions, salaries and employer apply links in 26 countries, plus an only-new mode for alerts.
- **[AEO & GEO Tracker: Google AI Overview Citation Checker](https://apify.com/automationnation/aeo-auditor)**: see whether Google AI Overviews cite your website, who is cited instead and what changed since last week.
- **[Google Maps Leads Scraper UK: Emails & Directors](https://apify.com/automationnation/uk-business-leads)**: UK business leads from Google Maps with emails, phone numbers, Companies House directors and AI outreach copy.
- **[App Store & Google Play Reviews Scraper + AI](https://apify.com/automationnation/app-store-review-miner)**: App Store and Google Play reviews turned into an AI report of bugs, feature requests and critical issues.

Feedback or a missing field? Open an issue on the Actor's **Issues** tab. Fixes usually ship within a day.

# Changelog

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

# Actor input Schema

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

Keywords or topics to analyse, one per line, e.g. "coffee". Each term gets one report with interest over time, interest by region and city, and related queries and topics. A Google topic ID such as "/m/07ykbs" also works.

## `compareAll` (type: `boolean`):

Put every search term on the same 0–100 scale, like a Google Trends comparison. More than 5 terms are compared in batches that share an anchor term and are rescaled, so any number of terms can be compared.

## `isMultiple` (type: `boolean`):

Treat a line such as "coffee,tea,matcha" as one comparison, like typing it into Google Trends. Each term still gets its own row. (Same option as apify/google-trends-scraper.)

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

Country or region code: US, GB, DE, IN, US-CA (California), GB-ENG (England). Leave empty for worldwide.

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

Optional: run every search term in several regions, e.g. \["US", "GB", "CA"]. Each region gets its own reports.

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

Period to analyse. For a custom period use "Custom time range".

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

Start and end date separated by a space, e.g. "2024-01-01 2024-12-31". Overrides "Time range".

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

Limit searches to a Google Trends category (helps with ambiguous words such as "apple" or "jaguar").

## `categoryId` (type: `integer`):

Any Google Trends category ID, including subcategories (e.g. 916 = Coffee & Tea). Overrides "Category". Find IDs in a Google Trends URL (\&cat=916).

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

Which Google search to measure interest in.

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

Paste Google Trends links: an explore URL (https://trends.google.com/trends/explore?q=coffee,tea\&geo=US) is analysed with its own terms, region, dates, category and search type; a Trending now URL (https://trends.google.com/trending?geo=GB) returns the trending searches.

## `spreadsheetId` (type: `string`):

ID or link of a Google Sheet shared as "Anyone with the link can view". Search terms are read from the first column.

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

The 0–100 timeline for each term, plus trend direction, change % and peak.

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

Where each term is searched most: countries (worldwide) or subregions (for a country).

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

Level of the region breakdown.

## `includeCities` (type: `boolean`):

Also return the city breakdown with coordinates when a region is set.

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

Also list regions with little search volume (Google hides them by default).

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

Top and rising related searches, with growth % and "Breakout" flags.

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

Top and rising related topics (entities such as brands or places). Google currently withholds related topics from automated sessions, so this is usually empty — related queries are always complete. Single-term searches only.

## `trendingGeos` (type: `array`):

Get what's trending right now, like trends.google.com/trending: e.g. \["US", "GB", "IN"]. Each trending search comes with search volume, growth %, start time, related queries and news articles.

## `trendingHours` (type: `integer`):

4, 24, 48 or 168 (7 days).

## `trendingCategory` (type: `string`):

Only trending searches in this category.

## `trendingSort` (type: `string`):

Order of the trending searches.

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

0 = all (Google lists up to a few hundred per country and time window).

## `includeNews` (type: `boolean`):

Add the news articles Google shows for each trending search.

## `newsPerTrend` (type: `integer`):

Up to 10.

## `onlyActiveTrends` (type: `boolean`):

Skip trending searches that Google marks as ended.

## `onlyNewTrends` (type: `boolean`):

Return only trending searches that earlier runs with the same country, time window and category didn't return. Schedule the Actor (e.g. hourly) to get alerts for new trends; repeats aren't charged.

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

Language for Google Trends labels, related topics and dates, e.g. en-US, en-GB, de, fr, es, ja.

## `timezoneOffset` (type: `integer`):

How Google buckets hours and days, in minutes behind UTC: 0 = UTC, 300 = New York (EST), -60 = Berlin (CET).

## `maxItems` (type: `integer`):

Stop after this many dataset rows (0 = no limit).

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

How many searches run at the same time.

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

Each retry uses a new IP address.

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

Apify Proxy is used by default, with automatic fallback to residential IPs if Google rate-limits. You normally don't need to change this.

## Actor input object example

```json
{
  "searchTerms": [
    "chatgpt",
    "gemini",
    "claude ai"
  ],
  "compareAll": false,
  "isMultiple": false,
  "geo": "US",
  "timeRange": "",
  "category": "",
  "searchType": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "auto",
  "includeCities": true,
  "includeLowVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": false,
  "trendingHours": 24,
  "trendingCategory": "",
  "trendingSort": "relevance",
  "trendingMaxItems": 50,
  "includeNews": true,
  "newsPerTrend": 3,
  "onlyActiveTrends": false,
  "onlyNewTrends": false,
  "language": "en-US",
  "timezoneOffset": 0,
  "maxItems": 0,
  "maxConcurrency": 10,
  "maxRequestRetries": 7,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `keywordTrends` (type: `string`):

One row per search term with trend direction, change and summary.

## `related` (type: `string`):

No description

## `regions` (type: `string`):

No description

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

No description

## `allData` (type: `string`):

No description

## `summary` (type: `string`):

Per-search status, warnings, retries and why the run stopped.

# 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",
        "gemini",
        "claude ai"
    ],
    "geo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("automationnation/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",
        "gemini",
        "claude ai",
    ],
    "geo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("automationnation/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",
    "gemini",
    "claude ai"
  ],
  "geo": "US"
}' |
apify call automationnation/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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