# Google Trends API & Scraper - pytrends alternative (`alom/google-trends-scraper`) Actor

Google Trends API and pytrends alternative without 429 errors: interest over time, by country, state, city and US metro, related queries and topics, Trending Now with search volume. Compare 50+ terms on one scale, daily data for years. From $0.50 per 1,000.

- **URL**: https://apify.com/alom/google-trends-scraper.md
- **Developed by:** [Alom Dev](https://apify.com/alom) (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 $0.50 / 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

## Google Trends Scraper & API

Get **Google Trends data as JSON, CSV or Excel**: interest over time, interest by country, state, **city and US metro
area (DMA)**, top & rising related queries, and the live **Trending Now** list with search volume, growth and news. Any search term, any country, any time range, from the past hour back to 2004. Compare up to 5 terms on one chart, or **up to 50 terms on one common
scale**, get **daily data for multi-year ranges**, and measure **Web, YouTube, News, Image or Shopping** search.

✅ **Finishes cleanly, no hanging runs.** Rate limits are retried on fresh IPs automatically. If you set a short timeout,
the run stops in time and keeps every result it collected.
✅ **$1.50 per 1,000 results, compute and proxies included.** No surprise platform-usage charges.
✅ **Drop-in compatible** with the most popular Google Trends scraper's input and output field names.
✅ **Pytrends alternative that works in 2026**: no 429 errors to handle, no cookies, no code needed.

### What can you use Google Trends data for?

- **SEO & content planning:** find rising queries and seasonal peaks before you write.
- **Local marketing:** see which **US metro areas (DMA)** and cities search for your product most, and plan ads by region.
- **E-commerce & product research:** compare demand for products or brands over 5 years, per country.
- **YouTube strategy:** measure interest on **YouTube search** specifically, not just web search.
- **Finance & research:** track attention around brands, tickers, crypto and macro topics, daily or hourly.
- **AI agents & dashboards:** feed clean JSON to LLM workflows, Google Sheets, Looker Studio or your database.

### Two modes

- **Explore** (default): the classic Google Trends chart for your search terms. Interest over time, by region, city and
  metro, plus related queries.
- **Trending Now**: what people are searching for **right now**, per country or US state. Every trending topic comes
  with its search volume, growth %, start time, whether it's still trending, category, related searches, and news
  articles for the top stories. Turn on **"Only new trends since my last run"** and schedule it hourly or daily to get
  **alerts about new trends only**.

### What data does Google Trends Scraper extract?

| Field | What it is |
|---|---|
| `interestOverTime_timelineData` | Interest 0-100 per hour/day/week/month for the selected range |
| `interestOverTime_averages` | Average interest per term (comparisons) |
| `interestBy` | Interest by country (Worldwide searches) |
| `interestBySubregion` | Interest by state / region |
| `interestByCity` | Interest by city |
| `interestByMetro` | Interest by **US metro area (DMA)**. Most Google Trends scrapers don't offer this. |
| `relatedQueries_top` / `relatedQueries_rising` | Related searches with their score or growth; rising ones carry `isBreakout` (growth above +5,000%) |
| `summary` | Per term: `peakValue`, `peakDate`, `latestValue`, `latestDate`, `average`, `trendDirection` (rising / falling / flat), `trendChangePercent` |
| `winner` | The term with the highest average interest (comparisons) |
| `regionLeaders` | Which term leads in each country / state (comparisons) |
| `normalization` | Only for > 5 terms: anchor, groups, scale factors, precision flag |
| `dailyStitching`, `interestOverTime_coarse` | Only with daily stitching: windows, scale factors, agreement with Google's own weekly series |
| `searchTerm`, `geo`, `timeRange`, `category`, `property`, `trendsUrl` | The query, echoed for easy filtering |

#### Trending Now fields

| Field | What it is |
|---|---|
| `title`, `rank`, `geo` | The trending search, its position and location |
| `searchVolume`, `searchVolumeFormatted` | Searches in the window, e.g. `200000` / `"200K+"` |
| `increasePercentage` | Growth vs normal, e.g. `1000` |
| `startedAt`, `endedAt`, `isActive` | When it started trending and whether it still is |
| `categories` | e.g. Sports, Health, Politics (19 categories) |
| `relatedQueries` | Related searches that belong to the same trend |
| `news`, `picture` | News articles and an image, for the top ~10 trends per location |
| `exploreUrl` | Open the topic in Google Trends Explore |

```json
{ "mode": "trendingNow", "trendingGeos": ["US", "GB", "US-CA"], "trendingHours": "24",
  "trendingCategories": ["Sports", "Technology"], "trendingSort": "volume", "onlyNewSinceLastRun": true }
```

### Ready-made answers: summary, winner, leaders per region

Every result comes with a small **summary** you don't have to compute yourself, at no extra cost:

```json
"summary": [
  { "term": "coffee", "peakValue": 100, "peakDate": "2026-04-12", "latestValue": 69, "latestDate": "2026-09-20",
    "average": 75.4, "trendDirection": "flat", "trendChangePercent": 9.45 },
  { "term": "matcha", "peakValue": 8, "peakDate": "2026-04-05", "latestValue": 5, "latestDate": "2026-09-20",
    "average": 6.13, "trendDirection": "rising", "trendChangePercent": 30.65 }
],
"winner": "coffee",
"regionLeaders": [{ "geoCode": "US-WY", "geoName": "Wyoming", "leader": "coffee", "leaderValue": 54.3 }]
```

- `trendDirection` compares the average of the last quarter of the period with the first quarter: **rising** or
  **falling** when it changed by at least 10% and 1 point, otherwise **flat**. An incomplete last period (Google's
  `isPartial`) is left out, so a half-finished week doesn't look like a crash.
- `winner` is the term with the highest average; `regionLeaders` names the leading term in every region of a comparison.

### Compare more than 5 terms on one scale

Google Trends compares at most 5 terms, and each chart is scaled to its own peak, so two separate charts can't be
compared. Turn on **"Compare more than 5 terms on one scale"** (`normalizeAcrossQueries`) and all your terms (up to
50\) come back on **one 0-100 scale**, as if Google drew one big chart:

```json
{ "searchTerms": ["coffee", "tea", "matcha", "espresso", "latte", "cappuccino", "chai", "kombucha",
                  "hot chocolate", "green tea", "cold brew", "mocha"],
  "normalizeAcrossQueries": true, "anchorTerm": "coffee", "geo": "US" }
```

How it works: the terms are fetched in groups of 4 plus a shared **anchor term** (your first term by default). The
anchor's real interest is the same in every group, so the ratio of its values converts each group to the same scale;
finally everything is rescaled so the highest point is 100. Interest by state/country is rebuilt the same way, and
`summary`, `winner` and `regionLeaders` cover all terms. Each point keeps Google's original number in `rawValue`.

- **Accuracy (measured):** we compared the method with Google's own 5-term chart for the same terms. With the most
  popular term as anchor the averages matched (0.0% difference for terms averaging 6+, within 0.02 points for terms
  averaging 1 or less). With a weak anchor (average ~1) the error reached 8% for a mid-sized term and more for tiny
  ones, because Google rounds to whole numbers. Such results are flagged `"lowPrecision": true`.
- **Tip:** use your most searched term as `anchorTerm`.
- One result per normalized comparison, plus $0.003 per extra group of 4 terms (see pricing). City and metro
  breakdowns are not included in this mode. Terms with
  different locations or time ranges (e.g. from different URLs) are normalized separately.

### Daily data for years, not just 9 months

Google returns **daily** points only for ranges up to ~9 months; longer ranges come back weekly or monthly. Turn on
**"Daily data for long ranges"** (`dailyStitching`) with a custom range, **Past 12 months** or **Past 5 years** (up
to 10 years) and you get one continuous daily series, scaled 0-100:

```json
{ "searchTerms": ["bitcoin"], "customTimeRange": "2023-10-01 2025-09-30", "dailyStitching": true }
```

The range is fetched as overlapping 250-day windows (40+ days of overlap); each window is rescaled so the overlap
matches, then the whole series is rescaled to a maximum of 100. Google's own weekly/monthly series for the full range
stays in `interestOverTime_coarse`, and `dailyStitching.coarseCheck` reports how well the daily series matches it for
**every** result: `correlation`, `meanAbsError` (points) and `maxDriftPercent` (how much the scale wanders across the
range; near 0 is best).

- **Accuracy (measured):** stitched from two windows, a 250-day series matched Google's direct daily answer with a mean
  error of 0.46 points (max 4). Over 2 years (10 terms, 4 windows each), the stitched series averaged per week was
  within ~0.9-1.8 points of Google's weekly series, with a scale drift of 1-4.5% across the range. Correlation is
  0.97-0.996 for terms with real ups and downs; very flat terms (coffee, pizza) show ~0.945 purely from day-to-day noise.
- Small errors can add up over many windows, and days with very low interest carry Google's rounding (whole numbers).
- Comparisons (up to 5 terms) can be stitched too. Stitching and >5-term normalization can't be combined in one run.

### Why this Google Trends scraper?

| | This Actor | Typical browser-based Trends scrapers |
|---|---|---|
| How it works | Lightweight HTTP, no browser | Headless Chrome |
| Speed | ~4 s per term at default settings (measured on 192 terms) | Slower: a full browser loads each page |
| Short timeouts | Stops in time and keeps its results | Can time out and lose the status |
| Price | **$1.50 / 1,000, all-inclusive** | Per-result price **plus** browser compute |
| City + US metro (DMA) data | ✅ | Rarely |
| YouTube / News / Images / Shopping search | ✅ | Usually web only |
| Rate-limit (429) handling | Automatic retry on a fresh IP + a second pass | Varies |
| Trending Now + "only new" monitoring | ✅ | Some |
| Flat CSV (one row per data point) at no extra cost | ✅ | Some, usually billed per row |
| More than 5 terms on one comparable scale | ✅ up to 50 | ❌ |
| Daily data for multi-year ranges | ✅ stitched and self-checked | ❌ weekly/monthly only |
| Summary: peak, trend direction, winner, leader per region | ✅ free | ❌ |

Every release is tested end to end on the Apify platform across 17 scenarios before it ships: worldwide, US, US
states, non-Latin terms, comparisons, every time range, custom dates, all search types, 190+ terms at once, and short-timeout runs.

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

**From $0.50 per 1,000 results**, and platform usage is included, so there's no extra charge for compute or proxies.
One result = one search term or comparison with all its data, or one trending topic. You pay nothing for a term that
failed.

The two advanced options need several Google comparisons for one result, so each extra comparison is billed as an
**extended query at $0.003**, only when you turn them on:

- **More than 5 terms on one scale:** one extended query per extra group of 4 terms (12 terms = 3 groups = 2 extended
  queries = $0.006 on top of the result).
- **Daily data for long ranges:** one extended query per 250-day window (2 years = 4 windows = $0.012 on top of the
  result).

| Apify plan | Price per 1,000 results |
|---|---|
| Free | $1.50 |
| Starter (Bronze) | $1.00 |
| Scale (Silver) | $0.75 |
| Business (Gold) and above | $0.50 |

Examples on the Free plan: 20 keywords = **$0.03**; top 25 trending topics in 3 countries = **$0.11**; 200 keywords
tracked daily for a month = 6,000 results = **$9** (or $3 on Business).

### Switching from another Google Trends scraper?

It takes one minute:

1. Keep your existing input. `searchTerms`, `isMultiple`, `timeRange`, `geo`, `category`, `customTimeRange`,
   `startUrls`, `spreadsheetId`, `maxItems` and `viewedFrom` work the same way.
2. Change the Actor ID in your API call, schedule or integration to `alom/google-trends-scraper`.
3. Your downstream code keeps working: output field names such as `interestOverTime_timelineData`,
   `interestBySubregion`, `interestByCity` and `relatedQueries_top` are identical.

What changes: **no browser compute on your bill, no hanging runs, and extra data** (US metro areas, YouTube/News/
Shopping search, Trending Now, a free flat CSV). Browser-only settings like `pageLoadTimeoutSecs` are accepted and
ignored.

### How to use it

1. Click **Try for free**.
2. Enter search terms, or paste Google Trends URLs, or give a public Google Sheet ID.
3. Pick the location, time range, category and search type.
4. Click **Start**, then download the dataset as JSON, CSV, Excel or HTML, or read it via API.

#### Spreadsheet-ready CSV, free

Every run also saves **`RESULTS_FLAT.csv`**: one row per data point (timeline point, state, city, metro, related
query, or trending topic), ready for Excel, Google Sheets or pandas. Open it from the **Output** tab. It costs
nothing extra, and billing stays per search term.

#### Input example

```json
{
    "searchTerms": ["web scraping", "tea, coffee"],
    "isMultiple": true,
    "geo": "US",
    "timeRange": "today 3-m",
    "property": "youtube"
}
```

#### Output example (shortened)

```json
{
    "inputUrlOrTerm": "web scraping",
    "searchTerm": "web scraping",
    "interestOverTime_timelineData": [
        { "time": "1759017600", "formattedTime": "Sep 28 – Oct 4, 2025", "value": [66], "hasData": [true], "formattedValue": ["66"] }
    ],
    "interestBySubregion": [{ "geoCode": "US-MD", "geoName": "Maryland", "value": [100], "formattedValue": ["100"] }],
    "interestByMetro": [{ "geoCode": "511", "geoName": "Washington DC (Hagerstown MD)", "value": [88] }],
    "relatedQueries_top": [{ "query": "ai web scraping", "value": 100, "formattedValue": "100", "link": "/trends/explore?q=ai+web+scraping" }],
    "geo": "US",
    "timeRange": "today 12-m",
    "trendsUrl": "https://trends.google.com/trends/explore?date=today+12-m&q=web+scraping&geo=US"
}
```

### Google Trends API in Python, JavaScript, Make, Zapier, n8n and AI agents

Run it from the Apify API with the Python or JavaScript client, schedule it daily, or connect it to Make, Zapier, n8n
and Google Sheets. AI agents can call it through the Apify MCP server. See the **API** tab for ready-made code.

```python
from apify_client import ApifyClient  # pip install "apify-client>=3"

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("alom/google-trends-scraper").call(run_input={"searchTerms": ["web scraping"], "geo": "US"})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["searchTerm"], item["interestOverTime_timelineData"][-1])
```

### Limitations

- **Related topics are empty.** Google shows them only to signed-in users, so every logged-out tool gets an empty
  list. We return `[]` rather than inventing data. Related **queries** are complete.
- **Rising queries are Google's own list** and can look surprising (e.g. "pet care tips" rising for "coffee"). They
  match what the Google Trends website shows. We cross-check them on two independent sessions.
- Values are relative (0-100) within one query. To compare terms fairly, put them in the same comparison (up to 5),
  or turn on **Compare more than 5 terms on one scale**.
- Normalized (>5 terms) and stitched (daily) values are our computation from Google's whole-number answers, with the
  precision limits described above. Everything else is Google's data as returned.

### FAQ

**Is there an official Google Trends API?** Google has announced an official Trends API in limited alpha, with access by
application only. This Actor gives you the same data the Trends website shows, today, without an application.

**Is pytrends still working?** The pytrends library was archived in 2025 and often fails with 429 errors. This Actor
handles rate limits for you and returns the same kinds of data.

**Is it legal to scrape Google Trends?** Google Trends publishes aggregated, anonymous statistics, with no personal
data. You are responsible for how you use the data.

**Can I track keywords every day?** Yes. Create a schedule in Apify Console and get fresh data daily in your dataset,
Google Sheet or webhook.

### More scrapers from the same developer

- [YouTube Scraper](https://apify.com/alom/youtube-scraper): videos, channels, Shorts, comments, subtitles and community posts without the API quota
- [Threads Scraper](https://apify.com/alom/threads-scraper): posts, profiles, replies and keyword search on Meta Threads, no login
- [Bilibili Scraper](https://apify.com/alom/bilibili-scraper): videos, creators, full comment threads and danmaku from B站, no login
- [Google Hotels Scraper](https://apify.com/alom/google-hotels-scraper): hotel prices from every booking site across dates, room rates and reviews
- [Google Ads Transparency Scraper](https://apify.com/alom/google-ads-transparency-scraper): every Google ad a competitor runs, with the real ad copy
- [Threads Account Finder](https://apify.com/alom/threads-lead-finder): Threads accounts by keyword with followers, bio links and the contacts they list
- [Threads Hashtag & Keyword Monitor](https://apify.com/alom/threads-keyword-monitor): only the new posts for your keywords and #hashtags, for scheduled runs

### Feedback

Missing a field, found a bug, or need a feature? Open an issue in the **Issues** tab and I'll take a look. If this
Actor saved you time, a short review on the Store page helps other people find it.

# Actor input Schema

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

<strong>Explore</strong> = the classic Google Trends chart for your search terms. <strong>Trending Now</strong> = the live list of trending searches per country or US state, with search volume, growth and news.

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

Terms to look up. Each term becomes one result. Turn on <strong>Compare terms</strong> to put up to 5 comma-separated terms on one chart (e.g. <code>tea, coffee</code>), or <strong>Compare more than 5 terms on one scale</strong> (below) for up to 50.

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

Treat commas in a search term as separators and compare up to 5 terms on one chart, exactly like typing them into Google Trends.

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

Or paste Google Trends explore URLs. Their own settings (terms, geo, date, category, property) are used.

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

Optional: ID of a <strong>public</strong> Google Sheet with one search term per row in the first column (row 1 is a header).

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

Period to analyse.

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

Overrides the time range. Format: <code>2024-01-01 2024-12-31</code>.

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

Country or region code: <code>US</code>, <code>GB</code>, <code>US-CA</code>... Leave empty for Worldwide.

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

Limit interest to one Google Trends category.

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

Which Google search to measure: Web, YouTube, News, Images or Shopping.

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

Stop after this many results (0 = no limit).

## `extraGeoResolutions` (type: `boolean`):

For a country or region, also return interest by city (and by metro area / DMA for the US). One extra request each.

## `includeRelated` (type: `boolean`):

Top and rising related queries.

## `verifyRelatedQueries` (type: `boolean`):

Fetch related queries from a second independent session and keep only a version both agree on. Slower, more reliable.

## `normalizeAcrossQueries` (type: `boolean`):

Put <strong>all</strong> your search terms (up to 50) on one comparable 0-100 scale, like one big Google Trends chart. Google compares only 5 terms at once, so the terms are fetched in groups of 4 plus a shared <strong>anchor term</strong> and each group is rescaled through the anchor. Terms with the same location, time range, category and search type become <strong>one result</strong>. Raw per-group values are kept in <code>rawValue</code>. City/metro breakdowns are not included in this mode.

## `anchorTerm` (type: `string`):

Term shared by every group when comparing more than 5 terms. Defaults to your first term. Tip: a popular term (your biggest one) gives the most precise scale; a rarely searched anchor makes the result approximate (flagged as <code>lowPrecision</code>). Added to the comparison if it is not one of your terms.

## `dailyStitching` (type: `boolean`):

Google returns daily points only for ranges up to ~9 months (weekly or monthly beyond). Turn this on to get a continuous <strong>daily</strong> series for a longer <strong>custom time range</strong>, <strong>Past 12 months</strong> or <strong>Past 5 years</strong> (up to 10 years): overlapping ~8-month windows are fetched and rescaled on their overlap. Google's own weekly/monthly series is kept in <code>interestOverTime\_coarse</code> and every result reports how well the two agree. Takes ~2 extra requests per 7 months of range; still one result.

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

Country or US-state codes, e.g. <code>US</code>, <code>GB</code>, <code>US-CA</code>. Defaults to <code>US</code> (or the Location field).

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

How far back to look. The past 7 days can return ~2,000 trends for the US.

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

Keep only these categories (empty = all).

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

Skip topics whose trend has already ended.

## `trendingMinVolume` (type: `integer`):

Skip topics with fewer searches (e.g. <code>10000</code>).

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

Order of results per location.

## `maxTrendsPerGeo` (type: `integer`):

Each trend is one result.

## `includeTrendNews` (type: `boolean`):

News articles and an image for the top ~10 trends of each location (Google's own selection).

## `onlyNewSinceLastRun` (type: `boolean`):

Skip trends this monitor already returned. Pair with a daily or hourly Schedule to get alerts about new trends only.

## `monitorName` (type: `string`):

Keep separate memories for different monitors (e.g. <code>us-sports</code>). Defaults to <code>default</code>.

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

Queries processed in parallel, each on its own IP session.

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

Retries on a fresh IP after a rate limit or block.

## `viewedFrom` (type: `string`):

Optional 2-letter country code. Requests then go through residential IPs in that country (slower). Leave empty for the fastest default.

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

Default Apify datacenter proxy works well and is included in the price.

## Actor input object example

```json
{
  "mode": "explore",
  "searchTerms": [
    "web scraping"
  ],
  "isMultiple": false,
  "timeRange": "",
  "geo": "",
  "category": "0",
  "property": "",
  "maxItems": 0,
  "extraGeoResolutions": true,
  "includeRelated": true,
  "verifyRelatedQueries": true,
  "normalizeAcrossQueries": false,
  "dailyStitching": false,
  "trendingGeos": [
    "US"
  ],
  "trendingHours": "24",
  "trendingActiveOnly": false,
  "trendingMinVolume": 0,
  "trendingSort": "relevance",
  "maxTrendsPerGeo": 50,
  "includeTrendNews": true,
  "onlyNewSinceLastRun": false,
  "maxConcurrency": 10,
  "maxRequestRetries": 7,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `flatCsv` (type: `string`):

Flat copy of all results for Excel / Google Sheets: one row per timeline point, region, city, metro, related query or trend.

# 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"
    ],
    "trendingGeos": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alom/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": ["web scraping"],
    "trendingGeos": ["US"],
}

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

```

## MCP server setup

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