# Google Trends Scraper & API + Trending Now (`mitp1997/google-trends-scraper-reliable`) Actor

Google Trends scraper and pytrends alternative: interest over time, by region, state and city, related queries (top + rising), compare up to 5 keywords, and Trending now for any country. No browser, 256 MB. 97.5% of queries complete in a 160-query test; failed queries are never charged.

- **URL**: https://apify.com/mitp1997/google-trends-scraper-reliable.md
- **Developed by:** [Mit Parekh](https://apify.com/mitp1997) (community)
- **Categories:** SEO tools, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 keyword 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 & API + Trending Now

**Google Trends Scraper** gets Google Trends data as clean JSON, CSV or Excel, with no browser and no Google API key. It returns **interest over time**, **interest by region, state, metro and city**, **related queries (top and rising)**, **keyword comparisons of up to 5 terms**, and **Trending now** searches for any country. You can run it from the Apify Console, call it as a **Google Trends API** from Python or JavaScript, or plug it into n8n, Make, Zapier and AI agents.

It is built for reliability rather than speed alone. In a 160-query test on the Apify platform (India, US and UK, mixed time ranges, categories and comparisons):

- ✅ **156 of 160 queries (97.5%) returned every requested data block.** The other 4 were partial and **none failed**.
- ⚡ **Median time per query: about 13 seconds** (p90: 45 s), with 3 queries running in parallel.
- 💸 **Error records are never charged.** You pay only for results that contain data.
- 🪶 **Runs on 256 MB of memory**, because it makes small JSON requests instead of loading pages in a headless browser.

### What Google Trends data can you scrape?

| Data | What you get |
|---|---|
| **Interest over time** | The 0–100 timeline for 1 keyword, or up to 5 keywords compared, plus the average per keyword |
| **Interest by region** | Countries (worldwide), states and subregions (for example every **Indian state** or US state), US metros (DMA), or cities |
| **Interest by city** | An optional separate city list, sorted by interest (for example Mumbai, Delhi, Bengaluru) |
| **Related queries** | Top and Rising queries for each keyword, including "Breakout" values |
| **Trending now** | Trending searches for any country: search volume, % increase, start and end time, categories, related searches, and optional news links |
| Related topics | **Currently empty.** Google returns no related topics to automated requests (see [Limitations](#limitations)) |

Every filter from the Google Trends website is supported:

- **Location:** worldwide, any country, subregions such as `IN-MH` (Maharashtra) or `US-CA`, and US metros such as `US-NY-501`
- **Time range:** past hour, 4 hours, day, 7 days, 30 days, 90 days, 12 months, 5 years, 2004 to present, or a **custom range** such as `2024-01-01 2024-12-31`
- **Category:** all 25 top-level Google Trends categories
- **Search type:** Web search, Image search, News search, **YouTube search** or Google Shopping
- **Topics:** Knowledge Graph topic IDs such as `/m/0d6lp` instead of plain keywords
- **URLs:** paste `trends.google.com/trends/explore?...` links directly

### Why use this Google Trends scraper?

- **No headless browser.** Nothing waits for slow pages to load, so there are no page timeouts, and the low memory use keeps platform costs down.
- **Designed for Google's rate limits.** The Actor paces requests per session, backs off with jitter when Google answers HTTP 429, honors `Retry-After`, rotates sessions and proxy IPs, retries each data block up to 3 times and each query up to 3 times, and switches to residential proxies if your chosen proxy group keeps getting blocked.
- **One bad query never kills the run.** Each query becomes its own dataset item with `status: ok | partial | error`. Partial results keep the data blocks that worked and list the failed ones in `errors`.
- **Clear data-quality flags.** Every item has `warnings` and `googleUserType`, so you can see when Google had too little search volume or withheld data.
- **India-friendly.** Interest by Indian state and city, state-level locations such as `IN-MH` and `IN-KA` (both in the test set), and IST timestamps via `timezoneOffset: -330`.
- **Spending cap.** Set **Maximum cost per run** and the Actor stops cleanly when it reaches the limit.

### How to scrape Google Trends

1. Click **Try for free** (or **Start**).
2. Enter keywords in **Search terms**, one query per line. To compare keywords like the **Compare** button on the website, put up to 5 comma-separated terms on one line: `tea, coffee`.
3. Pick a **location**, a **time range** and, optionally, a category or search type (for example YouTube).
4. Optionally turn on **Trending now** and pick a country.
5. Click **Start** and download the results as JSON, CSV, Excel or HTML, or read them via the API.

The prefilled example finishes in well under a minute.

### Popular use cases

- **Keyword research and SEO:** check seasonality, rising queries and which regions search most before you write content.
- **Product and market research:** compare brands or products (for example `zomato, swiggy, zepto`) across countries and states.
- **Content calendars and newsjacking:** pull **Trending now** every hour or day with a schedule and send it to Slack or Google Sheets.
- **Data science and dashboards:** feed weekly time series into BigQuery, Snowflake or a notebook without maintaining a pytrends script.
- **AI agents:** give an agent live Google Trends data through the Apify MCP server.

💡 **Need keywords to check first?** [Keyword Ideas](https://apify.com/mitp1997/keyword-ideas-autocomplete) collects thousands of long-tail and question keywords from Google, YouTube, Bing and Amazon autocomplete, and saves the best ones as a ready-made input for this Actor.

### Input examples

**Compare keywords in India over the past 12 months**

```json
{
  "searchTerms": ["tea, coffee", "zomato, swiggy, zepto"],
  "geo": "IN",
  "timeRange": "today 12-m"
}
```

Each line is one query. Comma-separated terms on a line are compared against each other (up to 5, Google's limit).

**The same keywords in several countries, with a custom date range, category and city breakdown**

```json
{
  "searchTerms": ["electric scooter", "home loan"],
  "geos": ["IN", "US", "GB", "IN-MH"],
  "customTimeRange": "2025-01-01 2025-12-31",
  "category": "7",
  "regionResolution": "CITY"
}
```

**From Google Trends URLs (YouTube search and a 7-day range)**

```json
{
  "startUrls": [
    { "url": "https://trends.google.com/trends/explore?q=iphone&geo=US&gprop=youtube" },
    { "url": "https://trends.google.com/trends/explore?q=cricket&geo=IN&date=now%207-d" }
  ]
}
```

**Trending now in India, past 24 hours, Sports and Technology only**

```json
{
  "includeTrendingNow": true,
  "trendingGeo": "IN",
  "trendingHours": "24",
  "trendingCategories": ["17", "18"],
  "trendingMaxItems": 100
}
```

### Output example

You get one dataset item per query (shortened here):

```json
{
  "type": "keyword",
  "status": "ok",
  "searchTerm": "tea, coffee",
  "terms": ["tea", "coffee"],
  "geo": "IN",
  "timeRange": "today 12-m",
  "resolvedTimeRange": "2025-10-20 2026-10-20",
  "categoryName": "All categories",
  "searchProperty": "web",
  "trendsUrl": "https://trends.google.com/trends/explore?q=tea%2Ccoffee&date=today%2012-m&hl=en-US&geo=IN",
  "interestOverTime": {
    "averages": [{ "term": "tea", "value": 45 }, { "term": "coffee", "value": 61 }],
    "timeline": [
      { "timestamp": 1791676800, "date": "2026-10-11T00:00:00.000Z", "formattedTime": "Oct 11 – 17, 2026",
        "values": { "tea": 41, "coffee": 62 }, "hasData": true, "isPartial": false }
    ]
  },
  "interestByRegion": [
    { "geoCode": "IN-NL", "geoName": "Nagaland", "values": { "tea": 63, "coffee": 37 }, "hasData": true }
  ],
  "regionResolution": "REGION",
  "relatedQueries": [
    { "term": "tea",
      "top": [{ "query": "green tea", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=green+tea&date=today+12-m&geo=IN" }],
      "rising": [{ "query": "madhur virli casual tea", "value": 1100, "formattedValue": "+1,100%", "link": "..." }] }
  ],
  "relatedTopics": [{ "term": "tea", "top": [], "rising": [] }],
  "errors": [],
  "warnings": ["Google does not provide related topics for comparisons; run terms separately to get them."],
  "googleUserType": "USER_TYPE_SCRAPER",
  "attempts": 1,
  "durationMs": 9268,
  "scrapedAt": "2026-10-20T10:45:56.069Z"
}
```

A Trending now item:

```json
{
  "type": "trendingNow", "status": "ok", "rank": 2, "title": "happy dussehra wishes", "geo": "IN",
  "startedAt": "2026-10-19T12:40:00.000Z", "endedAt": null, "isActive": true,
  "searchVolume": 200000, "increasePercentage": 1000, "categories": ["Hobbies and Leisure"],
  "relatedSearches": ["happy dussehra wishes", "dussehra wishes", "happy dasara"],
  "exploreLink": "https://trends.google.com/trends/explore?q=happy%20dussehra%20wishes&geo=IN&date=now%201-d"
}
```

A failed query (free, not charged):

```json
{ "type": "keyword", "status": "error", "searchTerm": "pune weather", "geo": "XX",
  "error": "explore: HTTP 400 Error 400 (Bad Request)!!1 - Google rejected the query parameters (check the location code, time range and category).",
  "attempts": 1 }
```

The dataset has ready-made views: **Overview**, **Interest over time**, **Interest by region**, **Related queries & topics** and **Trending now**. A `RUN_SUMMARY` record in the key-value store shows how many queries succeeded, were partial or failed, plus request and HTTP 429 counts.

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

This Actor uses pay-per-event pricing. You pay only for results with data. There is no start fee, and proxy and compute usage are included in the price.

| Event | What counts as one event | Price |
|---|---|---|
| `trend-result` | One successful or partial keyword result. One result = one line of search terms (a single keyword or a comparison of up to 5) × one location × one time range, with all selected data blocks. | **$2.00 per 1,000** ($0.002 each) |
| `trending-topic` | One Trending now topic | **$0.50 per 1,000** ($0.0005 each) |
| Error record | A query that failed after all retries | **Free** |

**Cost examples**

| Job | Results | Cost |
|---|---|---|
| 50 keywords in one country | 50 `trend-result` | $0.10 |
| 20 comparisons × 5 countries (IN, US, GB, DE, BR) | 100 `trend-result` | $0.20 |
| 1,000 keywords | 1,000 `trend-result` | $2.00 |
| Top 100 Trending now topics for one country, daily for 30 days | 3,000 `trending-topic` | $1.50 |

Apify's free plan includes monthly platform credit you can use to try the Actor.

### Use Google Trends as an API (Python, JavaScript, n8n, Make, AI agents)

You need an [Apify API token](https://console.apify.com/settings/integrations).

**Python** (`pip install apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("mitp1997/google-trends-scraper-reliable").call(run_input={
    "searchTerms": ["tea, coffee"],
    "geo": "IN",
    "timeRange": "today 12-m",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["searchTerm"], item["status"], item.get("interestOverTime", {}).get("averages"))
```

**JavaScript / Node.js** (`npm install apify-client`)

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('mitp1997/google-trends-scraper-reliable').call({
    searchTerms: ['tea, coffee'],
    geo: 'IN',
    timeRange: 'today 12-m',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**A single HTTP call** (runs the Actor and returns the items when it finishes; best for small jobs)

```bash
curl -X POST "https://api.apify.com/v2/acts/mitp1997~google-trends-scraper-reliable/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["tea, coffee"], "geo": "IN"}'
```

**n8n:** add the **Apify** node, choose the *Run an Actor* operation, select `mitp1997/google-trends-scraper-reliable`, paste the JSON input, then read the run's dataset items in the next step. You can also use the HTTP Request node with the URL above.

**Make:** use the Apify app's **Run an Actor** module, then **Get Dataset Items**, and map the results to Google Sheets, Airtable or Slack.

**Zapier, Google Sheets, Slack and webhooks:** use the **Integrations** tab of the Actor or a saved task. To track trends over time, add a **Schedule**, for example daily Trending now for your country.

**AI agents (MCP):** connect Claude, Cursor or another MCP client to `https://mcp.apify.com?tools=mitp1997/google-trends-scraper-reliable` and ask for Google Trends data in plain language.

### FAQ

**Is this a pytrends alternative?**
Yes. pytrends is an unofficial Python library (its GitHub repository is now archived) that calls the same Google Trends endpoints from your own machine, so heavy use often hits HTTP 429 "Too Many Requests" errors, and you have to manage proxies and retries yourself. This Actor runs in the cloud with Apify Proxy, retries and session rotation built in, and returns structured JSON or CSV. You can call it from Python with a few lines (see above) instead of maintaining your own scraper.

**Is there an official Google Trends API?**
Google announced an official Google Trends API in July 2025, but it is still an alpha with access by application only. This Actor works today for anyone and also covers Trending now, region and city breakdowns, and related queries.

**Do I need a proxy?**
Yes, because Google rate-limits single IP addresses aggressively. The default is Apify **RESIDENTIAL** proxy, and it is included in the price. In our tests, Apify datacenter proxies were blocked within the first minute. If you choose another group, the Actor switches to residential automatically when it keeps getting blocked (you can turn this off).

**How many keywords can I compare?**
Up to 5 per query, which is Google's limit. With *Compare all terms together*, longer lists are split into groups of 5. Values are only comparable within one group, because Google scales each query to 0–100 on its own.

**Why are the values 0–100 and not search volumes?**
Google Trends Explore returns relative interest only: 100 is the peak for your terms, location and time range. Trending now *does* include Google's approximate search volume, such as `200000` (shown as "200K+" on the website).

**What does `isPartial: true` mean?**
The last time period has not finished yet. This matches the dotted line on the Trends chart.

**Which timezone is used?**
Set `timezoneOffset` in minutes west of UTC, like Google's `tz` parameter: `-330` for India (IST) or `300` for US Eastern. The default is `0` (UTC).

**Can I get YouTube, News or Shopping trends?**
Yes. Set **Search type** to YouTube search, News search, Image search or Google Shopping.

**What happens if Google blocks a query?**
The Actor retries it with new sessions and IPs. If it still fails, you get a free `status: "error"` record that explains why, and the rest of the run continues.

### Limitations

- **Related topics:** in our tests (October 2026), Google labelled every automated request `USER_TYPE_SCRAPER` and returned **empty related topics**. This happened on datacenter IPs, on residential IPs and even from a real headless Chrome browser. Related **queries** (top and rising) are not affected. The `warnings` field flags it, and the Actor will return topics again if Google starts sending them. Google also never provides related topics when you compare 2 or more terms.
- **Low-volume keywords:** Google returns zeros and empty lists when there isn't enough data. You get a warning and the result is still `ok`.
- **City-level data** is sparse for some countries. Cities with no data are dropped unless you enable *Include low search volume regions*.
- **News in Trending now** comes from Google's public RSS feed, so it is only attached to topics that also appear in that feed (usually a handful).
- This Actor reads public, aggregated, non-personal data. Google may change its internal endpoints. If that happens, the Actor will be updated. Please report problems in the **Issues** tab.

### More data Actors

- [Keyword Ideas](https://apify.com/mitp1997/keyword-ideas-autocomplete): long-tail and question keywords from Google, YouTube, Bing and Amazon autocomplete.
- [Google Ads Transparency Scraper](https://apify.com/mitp1997/google-ads-transparency-scraper): every ad a competitor runs on Google Search, Display and YouTube, with ad text, images, videos, dates and regions.
- [Google Jobs Scraper](https://apify.com/mitp1997/google-jobs-scraper): job listings with salaries and direct apply links.
- [Telegram Channel Scraper](https://apify.com/mitp1997/telegram-channel-scraper): posts, views, reactions, media and exact subscriber counts from public Telegram channels, no login.

# Actor input Schema

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

One query per line. To compare up to 5 terms against each other (like the Trends 'Compare' button), put them on one line separated by commas, e.g. <code>tea, coffee</code>. Topic IDs such as <code>/m/0d6lp</code> also work.

## `compareAllTerms` (type: `boolean`):

Put every term from the list into one comparison (Google allows max 5 per comparison; more terms are split into groups of 5).

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

Optional. Paste trends.google.com/trends/explore URLs; the q, geo, date, cat and gprop parameters are used as-is.

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

Country to get data for. Leave 'Worldwide' for global data.

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

Optional extra location codes; every query is run for every location. Supports sub-regions, e.g. <code>IN</code>, <code>US</code>, <code>IN-MH</code> (Maharashtra), <code>US-CA</code>, <code>US-NY-501</code> (metro).

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

Preset time range. Hourly presets return minute/hour resolution; 5 years and 2004-present return monthly/weekly data.

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

Overrides Time range. Format <code>YYYY-MM-DD YYYY-MM-DD</code>, e.g. <code>2024-01-01 2024-12-31</code>. For hourly data within the last 7 days use <code>YYYY-MM-DDTHH YYYY-MM-DDTHH</code>.

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

Restrict interest to a Google Trends category.

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

Which Google property the interest comes from (same as the Trends 'Web search' dropdown).

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

Timeline of interest (0-100) for each term.

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

Countries (Worldwide), states/subregions (country), or metros/cities depending on Region resolution.

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

Granularity for 'Interest by region'.

## `includeInterestByCity` (type: `boolean`):

Adds a separate interestByCity list (requires a location).

## `includeLowSearchVolumeGeos` (type: `boolean`):

Also return regions with low search volume (same as the checkbox on the Trends website).

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

Top and rising related search queries for each term.

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

Note: Google only provides related topics for single-term queries, not for comparisons.

## `maxRelatedItems` (type: `integer`):

0 = everything Google returns (usually up to 25).

## `includeTrendingNow` (type: `boolean`):

Also scrape currently trending searches (trends.google.com/trending) for a country. Each trending topic is one result.

## `trendingGeo` (type: `string`):

Country for Trending now.

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

How far back Trending now looks.

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

Empty = all categories.

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

Only return trends that Google still marks as active.

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

Adds news articles from Google's trending RSS feed where available (usually only the top ~10-20 topics).

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

0 = all (can be 1,000+ for 48 h / 7 days).

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

Language for topic names and labels, e.g. en-US, hi, de.

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

Same as Google's tz parameter: minutes WEST of UTC. 0 = UTC, -330 = India (IST), 300 = US Eastern (EST).

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

Stop after this many keyword results. 0 = no limit.

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

Google rate-limits aggressively. RESIDENTIAL (default) worked best in our tests; Apify datacenter proxies were blocked within the first minute. If you choose another group, the Actor falls back to RESIDENTIAL automatically when blocked.

## `fallbackToResidentialProxy` (type: `boolean`):

If the selected proxy keeps getting HTTP 429 from Google, new sessions switch to Apify RESIDENTIAL proxy automatically (if your plan has it).

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

Parallel queries. Higher is faster but triggers Google rate limits sooner.

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

Retries per HTTP request (with exponential backoff and session/IP rotation on HTTP 429). Each query is additionally retried up to 3 times as a whole.

## `requestTimeoutSecs` (type: `integer`):

Timeout for a single HTTP request to Google.

## `queryTimeoutSecs` (type: `integer`):

Upper bound for one query including all retries. When it is reached the query is saved as an error record (not charged) and the run moves on.

## `failIfAllQueriesFail` (type: `boolean`):

If every query fails (e.g. Google blocks all IPs), finish the run as FAILED so your integrations notice. Otherwise the run succeeds with error records.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping",
    "tea, coffee"
  ],
  "compareAllTerms": false,
  "geo": "",
  "geos": [],
  "timeRange": "today 12-m",
  "category": "",
  "searchProperty": "",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "AUTO",
  "includeInterestByCity": false,
  "includeLowSearchVolumeGeos": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "maxRelatedItems": 0,
  "includeTrendingNow": false,
  "trendingGeo": "US",
  "trendingHours": "24",
  "trendingCategories": [],
  "trendingActiveOnly": false,
  "trendingIncludeNews": false,
  "trendingMaxItems": 100,
  "language": "en-US",
  "timezoneOffset": 0,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "fallbackToResidentialProxy": true,
  "maxConcurrency": 3,
  "maxRequestRetries": 6,
  "requestTimeoutSecs": 30,
  "queryTimeoutSecs": 180,
  "failIfAllQueriesFail": true
}
```

# Actor output Schema

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

All dataset items (keyword results, trending topics and free error records), with the Overview view selected.

## `interestOverTime` (type: `string`):

Timeline (0-100) per term and averages for each keyword query.

## `interestByRegion` (type: `string`):

Interest per country, subregion, metro or city for each keyword query.

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

Top and rising related queries per term (related topics are currently returned empty by Google).

## `trendingNow` (type: `string`):

Trending searches for the selected country with search volume, increase %, categories and related searches.

## `runSummary` (type: `string`):

JSON summary: queries succeeded / partial / failed, trending topics, stop reason, request and HTTP 429 statistics.

# 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": [
        "web scraping",
        "tea, coffee"
    ],
    "geos": [],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mitp1997/google-trends-scraper-reliable").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": [
        "web scraping",
        "tea, coffee",
    ],
    "geos": [],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mitp1997/google-trends-scraper-reliable").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": [
    "web scraping",
    "tea, coffee"
  ],
  "geos": [],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call mitp1997/google-trends-scraper-reliable --silent --output-dataset

```

## MCP server setup

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

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/JiShRkqLz6hWcurzU/builds/QJEWPfHiuvjAVbKn7/openapi.json
