# Google Trends Scraper: Interest Over Time & Trending Searches (`humble-echidna/google-trends`) Actor

Google Trends data for any keyword: interest over time, interest by region, top and rising related queries, up to 5 terms compared on one scale. Plus trending searches by country (Trending Now) with the news behind them, and an only-new mode for schedules. Any country, time range or category.

- **URL**: https://apify.com/humble-echidna/google-trends.md
- **Developed by:** [Michael Costa](https://apify.com/humble-echidna) (community)
- **Categories:** SEO tools, Marketing, News
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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

### What does Google Trends Scraper do?

**Google Trends Scraper** gets **Google Trends data** for any keywords: **interest over time**, **interest by
region** and **top and rising related queries**, for one term or up to five compared on one 0-100 scale. It also
returns the **trending searches** in any country (Google's Trending Now), with the news behind each one. Live from
trends.google.com; no login, no API key.

[Input fields](https://apify.com/humble-echidna/google-trends/input-schema) ·
[API](https://apify.com/humble-echidna/google-trends/api) ·
[Use it from Claude, ChatGPT or Cursor (MCP)](#can-i-use-google-trends-scraper-from-an-ai-agent-mcp)

**Jump to:** [Monitor](#monitor-trending-searches-get-only-new-ones-in-slack-email-or-a-webhook) ·
[Fields](#what-data-does-google-trends-scraper-return) ·
[Price](#how-much-does-it-cost-to-scrape-google-trends) ·
[How to use](#how-to-scrape-google-trends) ·
[Input](#input) · [Output](#output) · [Switching](#switching-from-another-google-trends-actor) ·
[AI agents (MCP)](#can-i-use-google-trends-scraper-from-an-ai-agent-mcp) · [Limits](#limits) · [FAQ](#faq)

**Try it in one click:** the input comes pre-filled with `coffee, tea` in the US over the past 12 months. That's
1 result (both terms compared: timeline, regions, related queries), or about $0.002 (1 × $0.002, plus $0.00005 for
the run start). **Then replace it with what you actually want.**

### Monitor trending searches: get only new ones, in Slack, email or a webhook

With **Trending now: only new** on, each run returns (and charges for) only the searches that started trending
since the last run for that country. A run with nothing new costs only the $0.00005 start fee.

1. Clear **Search terms**, put your countries in **Trending now: countries** (`"trendingCountries": ["US", "GB"]`),
   turn on **Trending now: only new** (`"onlyNewTrending": true`), and click **Start**. This first run returns
   everything trending now and is the baseline.
2. Click **Save as a new task** (top right of the actor page). What has been returned is remembered per country, in
   a store in your account, for 14 days.
3. In Apify Console, open **Schedules**, click **Create new**, set how often in **Schedule setup** (for example every
   hour), then **Add** your task.
4. On the task, open the **Integrations** tab and pick where the new searches go:
   - **Slack**: click **Configure**, sign in, pick the workspace and channel, and the "run succeeded" event. A
     useful message: `{{resource.statusMessage}}` and a link,
     `<https://console.apify.com/storage/datasets/{{resource.defaultDatasetId}}|new trending searches>`.
   - **Gmail**: click **Connect with Google**, set the subject and body, and attach the dataset. It sends after each
     successful run.
   - **HTTP webhook**: event `ACTOR.RUN.SUCCEEDED`, your URL. Apify POSTs `{"eventType": ..., "resource": {...}}`;
     `resource.defaultDatasetId` is the run's dataset, and
     `GET https://api.apify.com/v2/datasets/<defaultDatasetId>/items?format=json` (with your API token) returns the
     new searches.

Apify's integrations fire after every successful run, including quiet ones: a quiet run's dataset is empty.

To track keywords instead, schedule a task with your **Search terms** (weekly with `past-12-months`, or daily with
`past-7-days`): each run returns the latest numbers for every line.

### What data does Google Trends Scraper return?

One result per **search line** (`"type": "search"`):

| Field | Example | Notes |
|---|---|---|
| `title` | `coffee vs tea` | The terms on the line |
| `terms` | `["coffee", "tea"]` | Up to 5, compared on one 0-100 scale |
| `interestOverTime` | `[{"date": "Oct 5, 2025", "values": {"coffee": 63, "tea": 33}, "isPartial": false}, ...]` | One point per week (12 months), day, hour or minute, by time range |
| `averages` | `{"coffee": 78, "tea": 37}` | Average over the whole range |
| `interestByRegion` | `[{"geoCode": "US-WY", "name": "Wyoming", "values": {"coffee": 70, "tea": 30}}, ...]` | States/regions in a country, countries worldwide |
| `relatedQueries` | `{"coffee": {"top": [...], "rising": [...]}}` | Per term: `query`, `value`, `formattedValue` (`+250%`, `Breakout`), `link` |
| `geo`, `timeRange`, `category`, `searchType` | `US`, `past-12-months`, `0`, `web` | The settings used |
| `url` | `https://trends.google.com/trends/explore?q=coffee,tea&date=today%2012-m&geo=US` | The same chart on Google Trends |

One result per **trending search** (`"type": "trending"`): `title`, `approxTraffic` (`200K+`), `startedAt`,
`picture`, `news` (title, url, source of the stories behind it), `geo` and `url`.

Every result also has a stable `id` and `scrapedAt`. The full list is under [Output](#output).

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

You pay per result: **$2.00 per 1,000 results** on the Free plan, $1.50 on Starter, $1.20 on Scale and $1.00 on
Business, plus $0.00005 each time a run starts. A result is one search line (all the parts you asked for, up to 5
terms) or one trending search.

- **The example below:** 1 result × $2.00/1,000 = $0.002, plus the start fee.
- **A month, for example:** 50 keywords checked weekly = 200 results ≈ **$0.40**. Trending searches in the US every
  hour with only new on: if 20 are new each day, 600 a month ≈ **$1.20**, plus $0.04 of start fees.
- **Caps:** **Max results per run** in the input, and **Maximum cost per run** in the run options. The run stops
  cleanly at whichever comes first.

**Never charged:** searches that fail (each is retried, then reported with the reason), and trending searches already
returned when only new is on.

### How to scrape Google Trends

1. Open Google Trends Scraper and click **Try for free** (or **Start** if you're signed in).
2. Put your keywords in **Search terms**, one search per line. To compare terms, put up to 5 on one line, separated
   by commas.
3. Pick the **Country or region**, **Time range** and, if you want, the **Data to get**, **Search type** (web,
   images, news, YouTube, Google Shopping) and **Category**.
4. Optionally add countries to **Trending now: countries**.
5. Click **Start**, then open the **Output** tab and export as JSON, CSV or Excel.

### Example: coffee vs tea in the US

The pre-filled input:

```json
{"searchTerms": ["coffee, tea"], "geo": "US", "timeRange": "past-12-months"}
```

It returned 1 result in 24 seconds ([run](https://console.apify.com/view/runs/QACU8gppET8iFgrND) on
2026-10-08): 53 weekly points for both terms, 51 states, and 25 top and rising related queries per term. It cost
$0.002 at the price below. Long lists shortened:

```json
{
  "id": "b761562ca230db86",
  "type": "search",
  "title": "coffee vs tea",
  "query": "coffee, tea",
  "terms": ["coffee", "tea"],
  "geo": "US",
  "timeRange": "past-12-months",
  "category": 0,
  "searchType": "web",
  "url": "https://trends.google.com/trends/explore?q=coffee,tea&date=today%2012-m&geo=US",
  "interestOverTime": [
    {"date": "Oct 5, 2025", "time": 1759622400, "values": {"coffee": 63, "tea": 33}, "isPartial": false},
    {"date": "Oct 12, 2025", "time": 1760227200, "values": {"coffee": 64, "tea": 35}, "isPartial": false},
    "... 53 weekly points in all, the last one:",
    {"date": "Oct 4, 2026", "time": 1791072000, "values": {"coffee": 69, "tea": 31}, "isPartial": true}
  ],
  "averages": {"coffee": 78, "tea": 37},
  "interestByRegion": [
    {"geoCode": "US-WY", "name": "Wyoming", "values": {"coffee": 70, "tea": 30}},
    {"geoCode": "US-HI", "name": "Hawaii", "values": {"coffee": 71, "tea": 29}},
    "... 51 in all"
  ],
  "relatedQueries": {
    "coffee": {
      "top": [{"query": "coffee near me", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=coffee+near+me&date=today+12-m&geo=US"}, "..."],
      "rising": [{"query": "top songs this week", "value": 5650, "formattedValue": "Breakout", "link": "https://trends.google.com/trends/explore?q=top+songs+this+week&date=today+12-m&geo=US"}, "..."]
    },
    "tea": {
      "top": [{"query": "green tea", "value": 100, "formattedValue": "100", "link": "https://trends.google.com/trends/explore?q=green+tea&date=today+12-m&geo=US"}, "..."],
      "rising": [{"query": "how to make cold brew tea", "value": 2100, "formattedValue": "+2,100%", "link": "https://trends.google.com/trends/explore?q=how+to+make+cold+brew+tea&date=today+12-m&geo=US"}, "..."]
    }
  },
  "scrapedAt": "2026-10-08T22:18:52.524706Z"
}
```

Google ranks some odd rising queries for "coffee" (`top songs this week`, `home workout routines`); the Google Trends
page shows the same list for this search.

### Input

| Field | What it does |
|---|---|
| **Search terms** (`searchTerms`) | One search per line: a term, or up to 5 comma-separated terms compared on one scale. |
| Country or region (`geo`) | `US`, `GB`, `US-CA`...; empty = worldwide. |
| Time range (`timeRange`) | `past-hour` to `since-2004`, or `custom` with `customTimeRange` (`2025-01-01 2025-06-30`). |
| Data to get (`dataTypes`) | Any of `interestOverTime`, `interestByRegion`, `relatedQueries` (default: all). |
| Search type (`searchType`) | `web`, `images`, `news`, `youtube` or `shopping`. |
| Category (`category`) | Google Trends category number, e.g. `71` Food & Drink; `0` = all. |
| Trending now: countries (`trendingCountries`) | Country codes for today's trending searches. |
| Trending now: only new (`onlyNewTrending`) | Return only trending searches not returned before (per country). |
| Language (`language`) | Locale for names in the results, e.g. `en-US`, `de`. |
| Max results per run (`maxResults`) | Cap the total number of results. |

```json
{
  "searchTerms": ["coffee", "iphone, samsung galaxy, pixel"],
  "geo": "US",
  "timeRange": "past-90-days",
  "dataTypes": ["interestOverTime", "relatedQueries"],
  "trendingCountries": ["US"],
  "maxResults": 100
}
```

### Output

A search line looks like the [example above](#example-coffee-vs-tea-in-the-us). A trending search (real output,
2026-10-08, news list shortened):

```json
{
  "id": "4926b11b5a537e7e",
  "type": "trending",
  "geo": "US",
  "title": "new hampshire giant bluefin tuna",
  "approxTraffic": "500+",
  "picture": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTFjpIB9Hg-Ls28Y8yogr3QXiynuSbaLlsjVj75aLTuUnvM1iLGY1hSnA9EBxk",
  "pictureSource": "13WHAM-TV",
  "news": [
    {
      "title": "New Hampshire fisherman lands 1,116-pound bluefin tuna, breaking state record",
      "url": "https://13wham.com/news/nation-world/new-hampshire-fisherman-lands-1116-pound-atlantic-bluefin-tuna-breaking-state-record-fish-fishing-food-overnight-charter-boat-boating-offshore-anglers-rye-harbor-freshwater-saltwater",
      "source": "13WHAM-TV"
    }
  ],
  "startedAt": "2026-10-08T21:50:00Z",
  "url": "https://trends.google.com/trends/explore?q=new%20hampshire%20giant%20bluefin%20tuna&date=now%201-d&geo=US",
  "scrapedAt": "2026-10-08T22:19:19.098962Z"
}
```

Values are Google's: 0-100, relative to the highest point in that search (so two lines can't be compared with each
other; put the terms on one line for that). `isPartial: true` marks a period that isn't over yet. `id` is stable
across runs, so you can use it to deduplicate. The run's `RUN_STATS` record lists every search, what it returned and
anything that failed, with the reason.

### Switching from another Google Trends actor?

Most Google Trends tools take the same settings Google's own page does, just under other names. Here's where each one
goes:

| What you had | Put it here |
|---|---|
| A list of keywords, one search each | **Search terms** (`searchTerms`), one keyword per line |
| Keywords to compare on one chart | One line, comma-separated: `coffee, tea, matcha` (up to 5) |
| A `trends.google.com/trends/explore?...` link | `q=` → one **Search terms** line; `geo=`, `date=`, `cat=`, `gprop=` → the rows below |
| Country, `geo=` (`US`, `GB-ENG`, empty for worldwide) | **Country or region** (`geo`), same codes |
| Google's time codes, `date=` | **Time range** (`timeRange`): `now 1-H` → `past-hour`, `now 4-H` → `past-4-hours`, `now 1-d` → `past-day`, `now 7-d` → `past-7-days`, `today 1-m` → `past-30-days`, `today 3-m` → `past-90-days`, `today 12-m` → `past-12-months`, `today 5-y` → `past-5-years`, `all` → `since-2004` |
| Start and end dates | `timeRange: "custom"` and `customTimeRange: "2025-01-01 2025-06-30"` |
| Category number, `cat=` | **Category** (`category`), the same number |
| Property, `gprop=` (empty, `images`, `news`, `youtube`, `froogle`) | **Search type** (`searchType`): `web`, `images`, `news`, `youtube`, `shopping` |
| Daily or realtime trending searches for a country | **Trending now: countries** (`trendingCountries`), plus **only new** for schedules |
| Switches to skip parts of the data | **Data to get** (`dataTypes`) |

What's different in the output: each search line is **one result** holding the timeline, regions and related queries
together (not one row per date), so you pay once per search, not per data point. To get one row per date or region in
a sheet, run the dataset through [Dataset Transformer](https://apify.com/humble-echidna/dataset-transform). Related
topics aren't returned ([why](#limits)).

### Run it on a schedule, or from your own code

1. Save your input as a [task](https://docs.apify.com/platform/actors/running/tasks) (**Save as a new task**, top right
   of the actor page) and add it to a [schedule](https://docs.apify.com/platform/schedules) (Console → Schedules →
   **Create new**).
2. Collect results: download the dataset as JSON, CSV or Excel; fetch the latest run's results from the
   [API](https://apify.com/humble-echidna/google-trends/api)
   (`GET https://api.apify.com/v2/actor-tasks/<task id>/runs/last/dataset/items?status=SUCCEEDED&format=json`, with
   your API token); let a [webhook](https://docs.apify.com/platform/integrations/webhooks) tell your system when a
   run succeeds; or connect it to Make, Zapier or n8n through
   [Apify's integrations](https://docs.apify.com/platform/integrations).

#### Can I use Google Trends Scraper from an AI agent (MCP)?

Yes, through [Apify's MCP server](https://docs.apify.com/platform/integrations/mcp), from Claude, ChatGPT, Cursor or
any other MCP client. Add this to your client's MCP configuration (or let the agent find it with the server's actor
search); your client signs you in to Apify:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=humble-echidna/google-trends"
    }
  }
}
```

To use an [Apify API token](https://console.apify.com/settings/integrations) instead of signing in, add
`"headers": {"Authorization": "Bearer <APIFY_TOKEN>"}` next to `url`.

An agent should pass the terms and settings it needs, e.g.
`{"searchTerms": ["electric bike, e-scooter"], "geo": "DE", "timeRange": "past-5-years", "dataTypes": ["interestOverTime"]}`.

### Who it's for

SEO and content teams choosing topics, marketers timing campaigns, e-commerce sellers checking seasonality before
buying stock, analysts and journalists comparing interest across places, and anyone whose dashboard or AI agent needs
Google Trends numbers on a schedule instead of copying them from the website.

### Why this one?

- **It finishes.** It reads the data Google Trends' own page loads, with no browser, so a search takes a few
  seconds. Searches Google throttles are tried again from another IP before anything is reported as failed. On
  2026-10-08, a run of 12 searches and the US trending list took 65 s with no failures.
- **Comparisons and every search type.** Up to 5 terms on one scale per line, any country or region, any time range
  including custom dates, web, image, news, YouTube and Shopping search, and categories.
- **Trending now with only new.** Schedule it hourly and get just the searches that started trending since the last
  run, with the news behind them.
- **Low, simple price.** From $1.00 to $2.00 per 1,000 results by Apify plan, $0.00005 per run: a single check
  costs $0.002 at most.
- **Reliable.** One failing search never affects the others in your run. The run log and the `RUN_STATS` record say
  exactly which search had a problem and why.

### Limits

- **No related topics.** Google sends related topics only to a full browser; this actor uses none, to stay fast and
  cheap. Related queries are included.
- **Relative numbers only.** Google Trends gives 0-100 values relative to each search's peak, not search volumes.
- **Up to 5 terms per line,** Google's own limit for one comparison.
- **Trending now** is Google's list of the past day or so for a country (about 10 searches in the US feed on 2026-10-08), not an
  archive.
- If Google keeps throttling a search after the retry, it's reported as failed (and not charged); run it again later.

### FAQ

#### Is it legal to scrape Google Trends?

The actor reads public, logged-out Google Trends data, the same data trends.google.com loads in a browser, plus
Google's published Trending Now RSS feed. Google's Terms of Service ask that automated access follow the
machine-readable instructions on its pages (robots.txt); trends.google.com's robots.txt disallows only the `/explore`
web pages, which this actor never requests. It identifies itself honestly (User-Agent `HumbleEchidnaApify`), makes
one request at a time, and collects no personal data. How you use the data is up to you and the laws that apply to
you.

#### Is there an official Google Trends API?

Google announced a Trends API in 2025, but it's an alpha open only to approved testers. This actor works for anyone
now, through Apify's API, schedules and integrations.

#### Why are the numbers different from yesterday's run?

Google Trends computes its numbers from a sample of searches, so values can move a little between requests, and the
latest point (`isPartial: true`) keeps changing until its period ends.

#### Why did a search fail?

Usually Google throttled it, and it still did after the retry from another IP. The run log and the `RUN_STATS`
record name the search and the reason; every other search in the run is unaffected and a failed search isn't
charged. Please open an issue with the input you used if it keeps happening.

#### Can I get only new results since my last run?

For trending searches, yes: turn on **Trending now: only new**
([how](#monitor-trending-searches-get-only-new-ones-in-slack-email-or-a-webhook)). For keyword searches, each run
returns the current numbers; schedule it and compare runs in your sheet or database.

### Related actors

| Actor | Use it when |
|---|---|
| [AI Brand Visibility Tracker](https://apify.com/humble-echidna/ai-visibility) | You want to know whether ChatGPT-style AI answers mention your brand |
| [SEO Audit Crawler](https://apify.com/humble-echidna/seo-audit) | You want to check the pages you'll write about the trending topics |
| [Website Change Monitor](https://apify.com/humble-echidna/website-change-monitor) | You want to know when a competitor's page changes |
| [Dataset Transformer](https://apify.com/humble-echidna/dataset-transform) | You want the results flattened into a CSV or Excel sheet your way |

### Feedback and support

Found a bug, or need a field or setting that isn't here? Open an issue on the **Issues** tab with the input you used.

### Versions

Current version: **0.1**. See the Changelog tab for what changed in each version.

# Changelog

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

# Actor input Schema

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

One search per line. A line is one term (e.g. coffee) or up to 5 comma-separated terms compared on one 0-100 scale (e.g. coffee, tea, matcha). Each line becomes one result with the parts chosen in Data to get. Leave empty to fetch only Trending now.

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

Two-letter country code (US, GB, DE) or a region code (US-CA, GB-ENG). Leave empty for worldwide. Applies to every search line.

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

How far back to look: `past-hour`, `past-4-hours`, `past-day`, `past-7-days`, `past-30-days`, `past-90-days`, `past-12-months` (the default), `past-5-years`, `since-2004`, or `custom` (uses Custom time range). Shorter ranges give finer points: past hour is per minute, past 7 days hourly, past 12 months weekly.

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

Only with Time range 'custom': start and end dates as 'YYYY-MM-DD YYYY-MM-DD', e.g. '2025-01-01 2025-06-30'.

## `dataTypes` (type: `array`):

Which parts of Google Trends to fetch for each search line: `interestOverTime` (the timeline and averages), `interestByRegion` (0-100 per region) and `relatedQueries` (top and rising, per term). Fewer parts make a run faster. Default: all three.

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

Which Google search to measure: `web` (the default), `images`, `news`, `youtube` or `shopping`.

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

Google Trends category number to narrow the searches, e.g. 71 (Food & Drink) or 5 (Computers & Electronics); 0 is all categories. The number is the cat= value in a trends.google.com address.

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

Two-letter country codes (e.g. US, GB) to also fetch the searches trending there right now, from Google's Trending Now feed: title, approximate traffic, start time and the news stories behind each. One result per trending search.

## `onlyNewTrending` (type: `boolean`):

Return only trending searches this actor hasn't returned before for that country, so a scheduled run (e.g. hourly) gives just what started trending since the last one. Remembered for 14 days in a store in your account. The first run returns everything.

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

Language of names in the results (regions, topics), as a locale like en-US, de or fr. It doesn't change the numbers.

## `maxResults` (type: `integer`):

Stop after this many results in total, e.g. 20. A result is one search line or one trending search. Minimum 1; leave empty (the default) for no limit. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first.

## Actor input object example

```json
{
  "searchTerms": [
    "coffee, tea"
  ],
  "geo": "US",
  "timeRange": "past-12-months",
  "dataTypes": [
    "interestOverTime",
    "interestByRegion",
    "relatedQueries"
  ],
  "searchType": "web",
  "category": 0,
  "onlyNewTrending": false,
  "language": "en-US"
}
```

# Actor output Schema

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

No description

## `runStats` (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": [
        "coffee, tea"
    ],
    "geo": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("humble-echidna/google-trends").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": ["coffee, tea"],
    "geo": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("humble-echidna/google-trends").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": [
    "coffee, tea"
  ],
  "geo": "US"
}' |
apify call humble-echidna/google-trends --silent --output-dataset

```

## MCP server setup

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

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/uL8TKQ8lrJFotWb6S/builds/WESVxgPP29ulsqpkM/openapi.json
