# Google Trends Scraper + Trending Now (`mattwensey/google-trends-scraper`) Actor

Get Google Trends data for any search term: interest over time, interest by region, related queries and topics, and comparisons of up to 5 terms. Plus Trending Now searches in 125 countries with search volume and news.

- **URL**: https://apify.com/mattwensey/google-trends-scraper.md
- **Developed by:** [Matt](https://apify.com/mattwensey) (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 $1.80 / 1,000 trend 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 gets Google Trends data for any search term: **interest over time, interest by region, related queries and related topics**, with up to 5 terms compared on one scale. It also returns the **Trending Now** list for 125 countries, with search volume, growth, start time and news articles. Type your terms or paste Google Trends URLs, and download clean JSON, CSV or Excel. No Google account or API key needed.

### What you can extract

**Explore mode** (one report per search term):

- **Interest over time**: 0-100 values with ISO dates, at Google's resolution (minutes for the past hours, then hours, days, weeks or months), with the incomplete current period flagged.
- **Interest by region**: countries, regions/states, US metro areas (DMA) or cities, with region codes. Low search volume regions are optional.
- **Related queries**: top and rising, including "Breakout" queries, each with a link back to Google Trends.
- **Related topics**: top and rising Knowledge Graph topics with topic ids (`/m/02vqfm`) and types ("Beverage").
- **Comparisons**: up to 5 terms on one shared scale, plus each term's share of searches in every region.
- **Summary values**: average interest, date of the peak, latest complete value.
- **One CSV file** with every interest-over-time series of the run.

**Trending Now mode** (one result per trending search):

- Title, **search volume** ("200K+" and 200000), **percent increase**, start and end time, active status
- Categories, the **trend breakdown** (the related searches that make up the trend)
- **News articles** with title, source, publish time, URL and image

**Filters**: worldwide, country, region or metro; past hour to 2004-present, or your own dates; 1,100+ categories; Web, Image, News, Shopping or YouTube search; language and timezone. Trending Now: past 4 hours, 24 hours, 48 hours or 7 days, category, active trends only, and four sort orders.

### Why this Google Trends scraper

- **Same numbers as the Google Trends website.** We compared the output with the CSV files the Google Trends website exports: for "bitcoin" (Worldwide, past 5 years) all 262 weekly values and all 67 countries matched exactly, and so did "coffee" (United States, past 12 months).
- **Built for Google's rate limits.** Google Trends answers new visitors with HTTP 429 and throttles anything that looks automated. The scraper handles Google's cookie check, gives every query its own residential IP, paces requests, and retries from a fresh IP when Google pushes back. In our test runs on the Apify platform (15 runs in October 2026, mostly batches of 24 terms), 175 of 175 term reports came back with data.
- **Related topics whenever Google serves them.** Google often returns empty related topics to scrapers. This Actor also asks the endpoint that powers embedded Trends widgets, which returns topics when Google's quota allows (see the FAQ for how often). If Google withholds them, the report says so in `warnings` instead of silently returning nothing.
- **Clean, stable output.** camelCase fields, ISO 8601 dates, numbers as numbers, `null` for anything missing, and the same keys in every item.
- **Pay only for data.** Reports and trending searches are charged only when they contain data. Failed or empty results are saved with an explanation and are free.

### Use cases

- **SEO and content planning**: find seasonal peaks and rising queries, and plan articles before the demand arrives.
- **Market and brand research**: compare up to 5 brands, products or competitors on one scale, by region and over time.
- **E-commerce**: spot seasonal demand per state or country for products and categories (use Search type: Shopping).
- **Newsrooms and social media teams**: pull what is trending right now in any of 125 countries, with the news behind each trend.
- **Finance and crypto**: track attention around tickers, tokens and companies.
- **AI agents and dashboards**: feed structured trend data to LLM workflows, Google Sheets, BI tools or databases on a schedule.

### How to use it

1. Click **Try for free** (or **Start**) on this page.
2. Keep **What to scrape** on *Explore search terms* and type one or more search terms (or paste Google Trends URLs). For trending searches, pick *Trending Now* instead.
3. Set the **Location** and **Time range**. Optionally choose a category, search type, region level, or turn sections on and off.
4. Click **Start**. A single term usually takes 25 to 40 seconds.
5. Open the **Output** tab to view tables or download JSON, CSV or Excel. Schedule the Actor to build your own trend history.

### Input examples

Compare three terms in the United States over the past 12 months:

```json
{
    "searchTerms": ["coffee", "tea", "matcha"],
    "compareTerms": true,
    "geo": "US",
    "timeRange": "today 12-m"
}
```

Interest by US state for a product, with a custom date range and the Shopping search type:

```json
{
    "searchTerms": ["air fryer"],
    "geo": "US",
    "startDate": "2025-01-01",
    "endDate": "2025-12-31",
    "property": "shopping",
    "regionResolution": "REGION"
}
```

Paste Google Trends URLs (comparisons, locations, categories and search types in the URL are kept):

```json
{
    "startUrls": [
        { "url": "https://trends.google.com/trends/explore?q=bitcoin,ethereum&date=today%205-y" },
        { "url": "https://trends.google.com/trending?geo=GB&hours=4" }
    ]
}
```

Trending Now in Germany, past 24 hours, sports only, sorted by search volume:

```json
{
    "mode": "trendingNow",
    "geo": "DE",
    "trendingHours": "24",
    "trendingCategory": "17",
    "trendingSortBy": "searchVolume",
    "newsArticlesPerTrend": 3,
    "maxItems": 25
}
```

All fields are described in the **Input** tab. Topic ids such as `/m/02vqfm` work as search terms too.

### Output examples

A trend report (Explore mode) from a real run comparing "coffee" and "tea" in the US over 90 days. Arrays are shortened to two entries:

```json
{
    "status": "ok",
    "searchTerm": "coffee",
    "termName": "coffee",
    "termType": "Search term",
    "comparedWith": ["tea"],
    "geo": "US",
    "geoName": "United States",
    "timeRange": "today 3-m",
    "timeRangeName": "Past 90 days",
    "startDate": "2026-07-13",
    "endDate": "2026-10-13",
    "resolution": "DAY",
    "category": 0,
    "categoryName": "All categories",
    "property": "web",
    "language": "en-US",
    "timezone": "UTC",
    "averageInterest": 56.25,
    "peakInterestDate": "2026-07-19T00:00:00.000Z",
    "latestInterest": 51,
    "interestOverTime": [
        { "date": "2026-07-13T00:00:00.000Z", "formattedTime": "Jul 13, 2026", "value": 62, "hasData": true, "isPartial": false },
        { "date": "2026-07-14T00:00:00.000Z", "formattedTime": "Jul 14, 2026", "value": 60, "hasData": true, "isPartial": false }
    ],
    "interestByRegion": [
        { "geoCode": "US-HI", "geoName": "Hawaii", "value": 100, "formattedValue": "100", "comparisonShare": 72, "coordinates": null },
        { "geoCode": "US-KS", "geoName": "Kansas", "value": 97, "formattedValue": "97", "comparisonShare": 70, "coordinates": null }
    ],
    "interestByRegionResolution": "REGION",
    "relatedQueries": {
        "top": [
            { "query": "coffee near me", "value": 100, "formattedValue": "100", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=coffee+near+me&date=today+3-m&geo=US" },
            { "query": "coffee shops", "value": 80, "formattedValue": "80", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=coffee+shops&date=today+3-m&geo=US" }
        ],
        "rising": [
            { "query": "flyers mascot", "value": 18050, "formattedValue": "Breakout", "isBreakout": true, "link": "https://trends.google.com/trends/explore?q=flyers+mascot&date=today+3-m&geo=US" }
        ]
    },
    "relatedTopics": {
        "top": [
            { "topicId": "/m/02vqfm", "title": "Coffee", "type": "Beverage", "value": 100, "formattedValue": "100", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=/m/02vqfm&date=today+3-m&geo=US" },
            { "topicId": "/m/020fb2", "title": "Cafe", "type": "Topic", "value": 13, "formattedValue": "13", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=/m/020fb2&date=today+3-m&geo=US" }
        ],
        "rising": [
            { "topicId": "/g/11qh_lmty0", "title": "National Coffee Day", "type": "Celebration", "value": 3650, "formattedValue": "+3,650%", "isBreakout": false, "link": "https://trends.google.com/trends/explore?q=/g/11qh_lmty0&date=today+3-m&geo=US" }
        ]
    },
    "warnings": [],
    "trendsUrl": "https://trends.google.com/trends/explore?date=today%203-m&geo=US&q=coffee,tea&hl=en-US",
    "inputUrl": "https://trends.google.com/trends/explore?q=coffee,tea&geo=US&date=today%203-m",
    "errorMessage": null,
    "scrapedAt": "2026-10-13T12:55:48.739Z"
}
```

A trending search (Trending Now mode, United States, past 24 hours), from a real run:

```json
{
    "status": "ok",
    "rank": 4,
    "title": "guardians vs rays",
    "searchVolume": 200000,
    "searchVolumeFormatted": "200K+",
    "percentIncrease": 1000,
    "startedAt": "2026-10-12T21:20:00.000Z",
    "endedAt": null,
    "isActive": true,
    "categories": [{ "id": 17, "name": "Sports" }],
    "trendBreakdown": ["guardians vs rays", "rays vs guardians", "tampa bay rays", "rays"],
    "newsArticles": [
        {
            "title": "Chase DeLauter, José Ramírez lead Guardians' win in Game 1 of ALCS vs. Rays",
            "url": "https://www.espn.com/mlb/story/_/id/50170936/guardians-come-beat-rays-game-1-alcs",
            "source": "ESPN",
            "publishedAt": "2026-10-13T03:23:00.000Z",
            "imageUrl": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQQ4K9jPF4Y3p92I928dQlL10kqmXmQWpheDWDzYSWaFME2Sn5Utt_7EfAEkns"
        }
    ],
    "geo": "US",
    "geoName": "United States",
    "hours": 24,
    "language": "en-US",
    "trendsUrl": "https://trends.google.com/trending?geo=US&hl=en-US&hours=24",
    "exploreUrl": "https://trends.google.com/trends/explore?q=guardians%20vs%20rays&date=now%201-d&geo=US&hl=en-US",
    "dataSource": "trending-now",
    "inputUrl": null,
    "warnings": [],
    "errorMessage": null,
    "scrapedAt": "2026-10-13T12:54:25.315Z"
}
```

**Other files in the key-value store**

- `INTEREST_OVER_TIME.csv`: all interest-over-time series in one table (term, date, value, partial flag), ready for Excel or Google Sheets.
- `RUN_SUMMARY`: how many results had data, had no data or failed, plus request statistics.

**Status values**: `ok` (data delivered, charged), `no_results` (Google has too little data for this term, location and period; free), `error` (failed after retries or invalid URL; free, see `errorMessage`).

### Pricing

This Actor uses pay-per-event pricing. On the Apify Free plan it costs:

- **about $2.50 per 1,000 trend reports** (one report = one search term with all four sections), and
- **about $0.40 per 1,000 trending searches**,

with lower prices on paid Apify plans. Apify platform usage (compute and proxies) is included. You only pay for results that contain data, and "Max results" plus the maximum cost per run you set in Apify limit what a run can spend. The **Pricing** tab on this page always shows the current prices.

Examples: comparing 5 brands over 12 months is 5 reports, about $0.0125. The top 50 trending searches in a country is about $0.02.

### Use it from your code

**JavaScript / TypeScript** (`npm install apify-client`):

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('mattwensey/google-trends-scraper').call({
    searchTerms: ['coffee', 'tea'],
    compareTerms: true,
    geo: 'US',
    timeRange: 'today 12-m',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const report of items) console.log(report.searchTerm, report.averageInterest, report.relatedQueries?.rising.length);
```

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

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("mattwensey/google-trends-scraper").call(run_input={
    "mode": "trendingNow",
    "geo": "US",
    "trendingHours": "24",
    "maxItems": 50,
})
for trend in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(trend["rank"], trend["title"], trend["searchVolumeFormatted"])
```

**AI agents (MCP)**: connect the Actor through the [Apify MCP server](https://mcp.apify.com) and ask in plain language, for example "Compare Google Trends interest for ChatGPT, Gemini and Claude in the US over the past 12 months and list the rising related queries for each" or "What is trending in Japan right now?". The input fields are described for agents, and every item links back to the matching Google Trends page in `trendsUrl`.

You can also connect the Actor to Make, Zapier, n8n, Google Sheets or webhooks from the **Integrations** tab.

### FAQ

**Is it legal to scrape Google Trends?**
This Actor reads public, aggregated and anonymized statistics that Google Trends shows to every visitor. It does not log in and does not collect personal data. You are responsible for how you use the data; check Google's Terms of Service and the rules that apply to you. This Actor is not affiliated with or endorsed by Google.

**How do I read the numbers?**
Google Trends values are relative, from 0 to 100, where 100 is the highest point within the request. When terms are compared (Compare the terms with each other), they share one scale; otherwise each term is scaled on its own. Values from different runs are separately scaled, and Google computes Trends from a sample of searches, so repeated requests can differ by a point or two.

**Why does it need proxies?**
Google Trends rate-limits IP addresses quickly. The default residential proxy gives every query its own IP, which is what keeps runs reliable. Without a proxy, the Actor still works but goes much slower and fails more often.

**Why are related topics missing in some reports?**
Google only serves related topics to automated clients within a limited quota, which varies during the day. The Actor asks for them from several IPs, and when Google still withholds them, `relatedTopics` is `null` and `warnings` explains it. In our October 2026 test runs, related topics were included in 44 of 139 reports (interest over time, interest by region and related queries were included in more than 97%). Running again later often fills them in.

**Why can related queries differ from what I see on Google Trends?**
Google returns slightly different related-query lists to visitors it considers automated. The Actor prefers the embed endpoint used by embedded Trends widgets, which returns the full lists. When that endpoint is busy, it uses Google's standard endpoint and notes this in `warnings`.

**How many terms can I compare?**
Google compares at most 5 terms at once. With more terms and comparison switched on, terms are compared in groups of 5 (values are on a shared scale within each group).

**How far back does the data go?**
To 2004 for Web Search and 2008 for the other search types. Use the presets or Start date and End date for any range. Hourly custom ranges (e.g. `2026-10-01T10` to `2026-10-03T10`) are possible via the API for up to 7 days.

**Can I get exact search volumes?**
Google Trends shows relative interest, not search counts. Trending Now does include Google's search volume buckets (for example "200K+").

**How fast is it?**
In our tests a single term took 25 to 40 seconds, 24 terms took 4.5 to 8 minutes with the default of 3 parallel queries (Google's rate limiting varies during the day), and the top 50 trending searches with news took 14 seconds.

**Which countries have Trending Now?**
125 countries, including the United States, United Kingdom, Canada, Australia, India, Germany, France, Spain, Italy, Brazil, Mexico, Japan and South Korea. Regions such as `US-CA` work too.

**A result has status "error". What now?**
Read `errorMessage`. Rate-limit errors usually disappear on a second run; you can also raise "Retries per query". "Rejected the request parameters" means Google did not accept the location, category or time range combination. Error items are free.

### Changelog

See the [changelog](CHANGELOG.md).

### Support

Found a bug or missing a feature? Open an issue in the **Issues** tab and include the link to your run.

# Changelog

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

# Actor input Schema

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

"Explore search terms" returns one trend report per search term: interest over time, interest by region, related queries and related topics (like the Explore page on Google Trends). "Trending Now" returns the searches that are trending right now in a country (like the Trending Now page), one result per trending search.

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

Words or phrases to look up on Google Trends, one per line (Explore mode). Each term gets its own report. You can also use a Google Knowledge Graph topic id such as "/m/02vqfm" (the topic "Coffee").

## `compareTerms` (type: `boolean`):

When on, the search terms are requested together (up to 5 per comparison, like adding terms with "+ Compare" on Google Trends), so their values share one 0-100 scale and can be compared directly. Each term still gets its own report. When off, every term is scaled on its own.

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

Paste Google Trends page URLs instead of (or in addition to) search terms. Explore URLs (https://trends.google.com/trends/explore?q=coffee,tea\&geo=US\&date=today%2012-m) keep their terms, comparison, location, time range, category and search property. Trending Now URLs (https://trends.google.com/trending?geo=US\&hours=24) return that trending list.

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

Country code such as "US", "GB" or "DE". Leave empty for Worldwide (Explore mode only). You can also type a region ("US-CA") or a US metro area ("US-CA-807"). Trending Now needs a country (125 countries are supported).

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

Period to analyze (Explore mode). The data resolution follows Google: minutes for the past hours, hours for the past 7 days, days up to 90 days, weeks up to 5 years, months for 2004 to present. Ignored when Start date and End date are set.

## `startDate` (type: `string`):

Start of a custom time range, e.g. 2024-01-01. Set together with End date; overrides Time range. Data starts on 2004-01-01.

## `endDate` (type: `string`):

End of a custom time range, e.g. 2024-12-31. Set together with Start date.

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

Limit results to searches in one Google Trends category (Explore mode), e.g. 71 = Food & Drink. "0" means all categories. You can also type any sub-category id from Google Trends (the "cat" value in a Google Trends URL).

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

Which Google search to analyze (Explore mode): Web Search (default), Image Search, News Search, Google Shopping or YouTube Search.

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

Time series of search interest (0-100) for each term. Also saved as one CSV file for all terms in the key-value store (INTEREST_OVER_TIME.csv).

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

Where each term is most popular: countries (Worldwide) or regions of the selected country, with values from 0 to 100.

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

Level of detail for interest by region. Automatic uses Google's default: countries for Worldwide, regions/states for a country. Metro areas (DMA) exist for the United States only. If Google does not offer the chosen level for a location, the default level is used and the report says so.

## `includeLowSearchVolumeRegions` (type: `boolean`):

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

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

Top and rising searches related to each term, including "Breakout" queries.

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

Top and rising topics (Knowledge Graph entities) related to each term, with topic ids and types.

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

How far back to look for trending searches (Trending Now mode).

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

Only return trending searches in this category. Leave on "All categories" for everything.

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

Only return searches that are still trending (Google marks them "Active").

## `trendingSortBy` (type: `string`):

Order of the results. "Relevance" is Google's default order. The limit in "Max results" keeps the first results in this order.

## `newsArticlesPerTrend` (type: `integer`):

How many news articles to include for each trending search (0 to 10). Use 0 to skip news and finish faster.

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

Maximum number of results to save: term reports in Explore mode, trending searches in Trending Now mode. Use 0 for no limit. You are only charged for results with data.

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

Language for region names, topic titles and labels, as a code like "en-US", "de" or "fr" (the "hl" value in a Google Trends URL).

## `timezone` (type: `string`):

Timezone for dates in interest over time, as an IANA name such as "UTC" (default), "America/New_York" or "Europe/Berlin". Hourly and daily periods start at midnight in this timezone, as on Google Trends.

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

How many queries to run at the same time, each from a different proxy IP. The default of 3 is a good balance between speed and reliability.

## `maxRetries` (type: `integer`):

How many times to retry a query from a fresh IP when Google rate-limits or blocks it, before reporting it as failed.

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

Google Trends rate-limits shared IP addresses quickly. Residential proxies (default) give the most reliable results; every query uses its own IP.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "coffee"
  ],
  "compareTerms": false,
  "geo": "US",
  "timeRange": "today 12-m",
  "category": "0",
  "property": "web",
  "includeInterestOverTime": true,
  "includeInterestByRegion": true,
  "regionResolution": "",
  "includeLowSearchVolumeRegions": false,
  "includeRelatedQueries": true,
  "includeRelatedTopics": true,
  "trendingHours": "24",
  "trendingCategory": "",
  "trendingActiveOnly": false,
  "trendingSortBy": "relevance",
  "newsArticlesPerTrend": 3,
  "maxItems": 50,
  "language": "en-US",
  "timezone": "UTC",
  "maxConcurrency": 3,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Every item in the dataset as JSON: trend reports in Explore mode, trending searches in Trending Now mode.

## `trendReports` (type: `string`):

One row per search term with summary values and a link to Google Trends (Explore mode).

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

One row per term and period (Explore mode).

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

One row per term and region (Explore mode).

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

One row per trending search with volume, increase, start time and news (Trending Now mode).

## `interestOverTimeCsv` (type: `string`):

All interest-over-time series in one CSV file (Explore mode).

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

Counts of results with data, without data and failed, plus request 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 = {
    "mode": "explore",
    "searchTerms": [
        "coffee"
    ],
    "geo": "US",
    "timeRange": "today 12-m",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mattwensey/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 = {
    "mode": "explore",
    "searchTerms": ["coffee"],
    "geo": "US",
    "timeRange": "today 12-m",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mattwensey/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 '{
  "mode": "explore",
  "searchTerms": [
    "coffee"
  ],
  "geo": "US",
  "timeRange": "today 12-m",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call mattwensey/google-trends-scraper --silent --output-dataset

```

## MCP server setup

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