# Google Trends (`autofacts/google-trends`) Actor

Google Trends for any keyword — interest over time, top and rising related searches, interest by region — and the top and rising searches of any of Google's 928 categories, in any country or region, over any time range.

- **URL**: https://apify.com/autofacts/google-trends.md
- **Developed by:** [Richard Feng](https://apify.com/autofacts) (community)
- **Categories:** SEO tools, News, Marketing
- **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 lookups

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 — Keywords, Related Searches and Category Rankings

[![Google Trends for any keyword — interest over time, top and rising related searches, interest by region — and the top and rising searches of any of Google's 928 categories, in any country or region, over any time range.](https://api.apify.com/v2/key-value-stores/0vXQJsD673rpGxqvW/records/readme-hero-v1.png)](https://console.apify.com/actors/Gz1vwyQAJtNOCyJwF/input)

Google Trends for any keyword, in any country or region and over any of Google's time ranges: how
interest in it rose and fell, the top and rising searches related to it, and where it is searched
most. Or, with no keyword at all, the top and rising searches of any of Google's 928 categories —
what people search for in Shopping, in Autos & Vehicles, in Vehicle Brands — down to the third level
of Google's category tree. An independent tool, not affiliated with Google.

### 📖 What it does

- 🔍 **Keyword lookups**: one row per keyword, place and time range, with Google's interest over
  time, the top and rising related searches (Breakout ones marked), and interest by region or city.
- 📊 **Category rankings**: the top and rising searches of a category, one row per search, for
  any of the 928 categories down to the third level, all categories together, or a category with
  all its subcategories.
- 🌍 **Any place**: a country (`US`), a region inside one (`US-CA`, `GB-SCT`, `DE-BY`), a US metro
  area (`US-CA-807`), or worldwide — as many as you like in one run.
- 📈 **Every time range Google offers**: the past hour, 4 hours, 24 hours, 7 days, 30 days, 90 days,
  12 months, 5 years, or everything since 2004 — several in one run, each read on its own.
- 🗂️ **Ready for a history**: each lookup and each ranked search has an `itemKey` that stays the
  same from run to run, so scheduled runs add up to a timeline.
- 📦 **A run summary that tells "no data" from "failed"**: every lookup and every ranking is listed
  with how it went and, where something went wrong, why.

### 🚀 Quick start

1. Put a keyword in **Keywords**, for example `bitcoin`.
2. Pick the **Countries** (the United States by default) and the **Time ranges** (the past 12
   months by default).
3. Run. Each keyword, place and time range is one row in the dataset.

For a category's top and rising searches instead, put the category in **Categories to rank**: its
name (`Shopping`), its path (`Shopping > Apparel`) or its id (`18`).

### 💡 What people use it for

- **SEO and content planning** — the rising searches around a topic, and the regions where it
  draws most, before writing for it.
- **Product and market research** — whether interest in a product, a brand or a category is
  growing, flat or seasonal, and where.
- **Category watch** — what people search for in Shopping, Travel or any niche, month after month,
  with the searches that are breaking out.
- **Data pipelines and dashboards** — scheduled lookups across keywords, markets and time ranges,
  in rows ready for a database.

### 📋 Input

| Field | Type | Default | What it does |
| :--- | :--- | :--- | :--- |
| `keywords` | array of strings | none | Searches to look up, each on its own, in every place and time range. |
| `keywordCategory` | string | all categories | Look the keywords up within one category, to tell one meaning from another: `jaguar` in `Autos & Vehicles`. |
| `categories` | array of strings | none | Categories whose top and rising searches to read: a name (`Shopping`), a path (`Shopping > Apparel`), an id (`18`), or `0` for all categories together. |
| `subcategories` | boolean | `false` | Rank each category's subcategories too, down to the third level. |
| `allCategories` | boolean | `false` | Rank all 928 categories down to the third level, and all categories together: 929 rankings for each place and time range, about an hour and a half, so give the run a timeout of two hours or more. |
| `countries` | array of strings | `["US"]` | Where to look: a country code (`US`), a region (`US-CA`), a US metro area (`US-CA-807`), or `worldwide`. |
| `windows` | array | `["12m"]` | `1h`, `4h`, `24h`, `7d`, `30d`, `90d`, `12m`, `5y` or `all` (since 2004). |
| `maxItemsPerList` | integer | `0` | At most this many searches from each top or rising list. `0` keeps all Google gives. |
| `maxItems` | integer | `0` | Stop after this many results in the whole run, lookups and ranked searches together. `0` means no limit. |
| `proxy` | object | Apify residential proxy | Used for every request. |

Give keywords, categories or both; every place and time range applies to each. Two keywords and
Shopping's top and rising searches, in two countries, over the past 30 days and the past 12 months —
8 lookups and 4 rankings:

```json
{
    "keywords": ["bitcoin", "ethereum"],
    "categories": ["Shopping"],
    "countries": ["US", "GB"],
    "windows": ["30d", "12m"]
}
```

Category rankings exist only over the past 7 days, 30 days, 90 days and 12 months; a ranking asked
for over another range is listed in the run summary as `not_available`, and costs nothing.

### 📤 Output

#### Keyword lookup — `recordType: "lookup"`

`bitcoin` in the United States over the past 12 months, on 6 October 2026 (the lists are shortened
here; the full row had 53 weekly points, 25 top and 25 rising searches and 51 regions):

```json
{
    "recordType": "lookup",
    "platform": "google",
    "itemKey": "google|lookup|US|12m|all|bitcoin",
    "keyword": "bitcoin",
    "geo": "US",
    "geoScope": "country",
    "geoRequested": "US",
    "window": "12m",
    "category": null,
    "status": "ok",
    "reason": null,
    "points": [
        { "time": "2025-10-05T00:00:00.000Z", "value": 37, "hasData": true, "partial": false },
        { "time": "2025-10-12T00:00:00.000Z", "value": 41, "hasData": true, "partial": false },
        { "time": "2026-09-27T00:00:00.000Z", "value": 17, "hasData": true, "partial": false },
        { "time": "2026-10-04T00:00:00.000Z", "value": 17, "hasData": true, "partial": true }
    ],
    "relatedQueries": {
        "top": [
            { "query": "bitcoin price", "value": 100, "label": "100", "breakout": false },
            { "query": "bitcoin today", "value": 18, "label": "18", "breakout": false }
        ],
        "rising": [
            { "query": "how to buy bitcoin safely", "value": 10950, "label": "Breakout", "breakout": true },
            { "query": "spacex stock", "value": 1750, "label": "+1,750%", "breakout": false }
        ]
    },
    "regions": [
        { "code": "US-WY", "name": "Wyoming", "value": 100 },
        { "code": "US-NV", "name": "Nevada", "value": 49 }
    ],
    "observedAt": "2026-10-06T11:45:57.230Z",
    "url": "https://trends.google.com/trends/explore?date=today+12-m&geo=US&q=bitcoin"
}
```

#### Ranked search — `recordType: "trend"`

The first of Shopping's top searches in the United States over the past 12 months:

```json
{
    "recordType": "trend",
    "platform": "google",
    "list": "explore_top",
    "listKey": "google|explore_top|US|12m|18|2026-10-06T11:46:40.583Z",
    "itemKey": "google|explore_top|US|18|12m|amazon",
    "entityId": null,
    "rank": 1,
    "term": "amazon",
    "termLanguage": null,
    "kind": "search",
    "category": { "id": 18, "name": "Shopping", "path": [{ "id": 18, "name": "Shopping" }] },
    "categories": [],
    "metrics": [{ "name": "interest", "value": 100, "unit": "index", "label": "100", "nullReason": null }],
    "primaryMetric": "interest",
    "startedAt": null,
    "endedAt": null,
    "related": [],
    "geo": "US",
    "geoScope": "country",
    "geoRequested": "US",
    "window": "12m",
    "observedAt": "2026-10-06T11:46:40.583Z",
    "url": "https://trends.google.com/trends/explore?date=today+12-m&geo=US&q=amazon&cat=18",
    "extra": { "category": "Shopping", "value": "100", "breakout": false, "country": "United States" }
}
```

A rising search has `list: "explore_rising"` and an `increase` metric instead: `meta glasses` led
Shopping's rising searches with `+160%`.

The dataset has two views: **Keyword lookups** and **Category rankings**.

### 🗂️ Data fields

**Keyword lookups**

| Field | What it is |
| :--- | :--- |
| `itemKey` | The same for the same lookup in every run: place, time range, category and keyword. |
| `keyword` | The keyword, as you gave it. |
| `geo`, `geoScope` | The place (`""` for worldwide) and what it is: `country`, `region` or `worldwide`. |
| `window` | The time range. |
| `category` | The category the keyword was looked up in; `null` for all categories. |
| `status`, `reason` | `ok`, or `not_available` when Google has no data for the lookup, with why. |
| `points` | Interest over time, 0 to 100, relative to the highest point of the range, from a point a minute over the past hour to a point a month since 2004. Times are UTC. The last point of a range that reaches now is `partial`; `hasData` is false where Google had too few searches. |
| `relatedQueries` | `top`: the most searched related searches, valued 0 to 100. `rising`: the related searches that grew most, valued by their rise in percent; `breakout` marks those Google shows as Breakout. |
| `regions` | Where the keyword is searched most, 0 to 100, the highest first: countries worldwide, states or regions in a country, cities in a region. |
| `observedAt` | When the lookup was read. |
| `url` | The lookup's page on Google Trends. |

**Category rankings**

| Field | What it is |
| :--- | :--- |
| `list` | `explore_top` or `explore_rising`. |
| `listKey` | The same for every row of one list as read in this run; matches an entry of the run summary. |
| `itemKey` | The same for the same search in the same ranking in every run. |
| `rank` | Its place in Google's list, 1 first. |
| `term` | The search. |
| `category` | The category ranked, with its path from the top level. |
| `metrics` | `interest`, 0 to 100, for a top search; `increase`, in percent, for a rising one. `label` is the text Google shows, such as `+160%` or `Breakout`. |
| `geo`, `geoScope`, `window`, `observedAt` | As for lookups. |
| `url` | The search's page on Google Trends, in that category, place and time range. |
| `extra` | The same as text, for reading at a glance: `category` (its path), `value`, `breakout`, `country`. |

### 💳 Pricing

Pay per event: one price per keyword lookup stored with data, and one per ranked search stored. A
lookup Google has no data for is stored with the reason and costs nothing; so do a lookup or a
ranking that could not be read, an empty ranking, a ranking over a time range Google does not rank,
and the run summary. If Apify restarts a run, what it had stored is not stored or charged again.

| Event | Free | Starter | Scale | Business and up |
| :--- | ---: | ---: | ---: | ---: |
| Keyword lookup, per 1,000 | $3.00 | $2.60 | $2.30 | $2.00 |
| Ranked search, per 1,000 | $0.20 | $0.20 | $0.20 | $0.20 |
| Actor start, per run | $0.00005 | $0.00005 | $0.00005 | $0.00005 |

A ranking is two lists of up to 25 searches each; rising lists are often shorter. In our runs a
category's ranking came to between 31 and 50 rows, $0.006 to $0.01; Shopping and its 44
subcategories in Germany over 90 days to about 2,060 rows, about $0.41; and every category
worldwide over 7 days to about 44 rows a ranking, so about 41,000 rows and $8.20 for all 929. The
run's maximum cost caps what a run can charge; a run that reaches it stores what fits and marks the
rest `not_reached`.

### ⚠️ Limitations

- **The numbers are Google's relative interest**, 0 to 100 within each lookup, not search counts.
  Two lookups are not on the same scale, so a keyword's 50 and another keyword's 50 are not the
  same number of searches.
- **Related topics are not included**: Google returns them empty to automated requests.
- **Category rankings** exist only over the past 7 days, 30 days, 90 days and 12 months, and only
  down to the third level of Google's category tree: Google ranks no deeper.
- **Rare keywords** have no data in small places or short ranges; such a lookup is stored with
  `status: "not_available"`.

### ❓ FAQ

**Why is the highest point always 100?**
Google scales each lookup to its own highest point. A steady rise from 50 to 100 means interest
doubled over the range, whatever the number of searches.

**What is a Breakout?**
Google's mark, in place of a percentage, for a related search that grew by more than 5,000%. Its
`value` is the rise Google gives with it, such as 10950.

**Can I look up a city?**
Inside a region, `regions` lists cities. As a place to look in, use a region (`US-CA`) or a US metro
area (`US-CA-807`, San Francisco–Oakland–San Jose).

**Do I need a proxy?**
Residential proxies are the default: Google refuses more of these requests from datacenter
addresses. A refused request is sent again from another address, and a lookup or ranking still
refused after that is tried once more at the end of the run.

**How long does a run take?**
Three lookups took 7 seconds in our tests, and 45 category rankings about two minutes. A long run
goes slower, as Google turns more requests away: every category in one place over one time range is
929 rankings, which Apify read at 550 to 700 an hour on 9 October 2026, so about an hour and a half.
Give a run that large a timeout of two hours (7,200 seconds) or more; the default is one hour. A run
close to its time limit stops by itself, stores what it has and writes its summary, with the rest
marked `not_reached`.

### 🤖 Use with AI agents

This Actor is callable as a tool by any MCP-capable agent — Claude, Cursor, VS Code — or by your
own code, with no wrapper and nothing extra to deploy.

**Connect over MCP**

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

In a client that reads an `mcpServers` configuration block:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=autofacts/google-trends",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

The agent reads this Actor's parameters and their descriptions straight from the input
schema, and the hosted server infers the result field types from the dataset schema — so a
model knows what to send and what comes back before it ever calls anything.

**Or call the API directly**

```bash
curl -X POST "https://api.apify.com/v2/acts/autofacts~google-trends/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"keywords": ["bitcoin"], "categories": ["Shopping"], "countries": ["US"], "windows": ["12m"], "proxy": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}}'
```

The response body is the dataset rows described above, and nothing else: to tell a lookup Google
has no data for from one that failed, start the run through `/runs` instead and read its `SUMMARY`
record.

#### Run summary — `SUMMARY`

Every run that gets as far as reading writes a `SUMMARY` record to its default key-value store,
also when a lookup or a ranking could not be read. A run stopped by its input writes none, nor
does one that is aborted or being restarted by Apify.

```
GET https://api.apify.com/v2/key-value-stores/{defaultKeyValueStoreId}/records/SUMMARY?token=$APIFY_TOKEN
```

The run of the API call above:

```json
{
  "status": "SUCCESS",
  "note": "Everything asked for was read.",
  "itemsStored": 34,
  "lists": [
    {
      "listKey": "google|explore_top|US|12m|18|2026-10-06T11:46:40.583Z",
      "platform": "google",
      "list": "explore_top",
      "geoRequested": "US",
      "geo": "US",
      "geoScope": "country",
      "window": "12m",
      "windowStart": "2025-10-06T11:46:40.583Z",
      "windowEnd": "2026-10-06T11:46:40.583Z",
      "category": { "id": 18, "name": "Shopping", "path": [{ "id": 18, "name": "Shopping" }] },
      "sourceAsOf": null,
      "observedAt": "2026-10-06T11:46:40.583Z",
      "served": 25,
      "total": 25,
      "filtered": false,
      "status": "ok",
      "reason": null,
      "url": "https://trends.google.com/trends/explore?date=today+12-m&geo=US&cat=18"
    },
    {
      "listKey": "google|explore_rising|US|12m|18|2026-10-06T11:46:40.583Z",
      "platform": "google",
      "list": "explore_rising",
      "geoRequested": "US",
      "geo": "US",
      "geoScope": "country",
      "window": "12m",
      "windowStart": "2025-10-06T11:46:40.583Z",
      "windowEnd": "2026-10-06T11:46:40.583Z",
      "category": { "id": 18, "name": "Shopping", "path": [{ "id": 18, "name": "Shopping" }] },
      "sourceAsOf": null,
      "observedAt": "2026-10-06T11:46:40.583Z",
      "served": 8,
      "total": 8,
      "filtered": false,
      "status": "ok",
      "reason": null,
      "url": "https://trends.google.com/trends/explore?date=today+12-m&geo=US&cat=18"
    }
  ],
  "lookups": [
    {
      "itemKey": "google|lookup|US|12m|all|bitcoin",
      "keyword": "bitcoin",
      "geoRequested": "US",
      "geo": "US",
      "window": "12m",
      "category": null,
      "observedAt": "2026-10-06T11:45:57.230Z",
      "status": "ok",
      "reason": null,
      "url": "https://trends.google.com/trends/explore?date=today+12-m&geo=US&q=bitcoin"
    }
  ],
  "restarted": false,
  "startedAt": "2026-10-06T11:45:50.688Z",
  "finishedAt": "2026-10-06T11:46:40.707Z",
  "extra": {}
}
```

| `status` | Meaning | What to do |
| :--- | :--- | :--- |
| `SUCCESS` | Every lookup and ranking asked for was read, or stopped by a limit you set | Use the dataset |
| `PARTIAL_RESULTS` | Some could not be read | Use the dataset; run the rest again later |
| `NO_RESULTS` | The same, and nothing was stored | Run again in a few minutes |
| `RUN_FAILED` | The run stopped with an error | The rows already in the dataset are valid |

Each entry of `lookups` is one keyword in one place and time range, with its `status`:

| `status` | Meaning |
| :--- | :--- |
| `ok` | Read; its row is in the dataset. |
| `not_available` | Google has no data for it; its row is in the dataset with the reason. |
| `not_reached` | Not stored: the run had stopped at **Maximum results in total** or at the maximum charge you set, or the run was close to its time limit. |
| `failed` | Could not be read, also when tried again at the end of the run; `reason` says why. |

Each entry of `lists` is one top or rising list of one category in one place and time range: its
`listKey` (the rows' own), the `windowStart` and `windowEnd` it covers and when it was read
(`observedAt`) — all three `null` for a ranking Google was not asked for, could not be read, or was
not stored — the searches stored from it (`served`) and those in Google's list (`total`),
`filtered` (always false: a ranking is stored as Google gives it, up to your maximum per ranking),
the list's page on Google Trends (`url`), and its `status`, with a `reason` where there is something
to say:

| `status` | Meaning |
| :--- | :--- |
| `ok` | Read. `served` may be less than `total` for your limits; `reason` says which. |
| `empty` | Google lists no searches there. |
| `not_available` | Google has no such ranking, such as over the past 24 hours. |
| `not_reached` | Not stored: the run had stopped at **Maximum results in total** or at the maximum charge you set, or the run was close to its time limit. |
| `failed` | Could not be read, also when tried again at the end of the run; `reason` says why. |

`stoppedBy`, only when the run stopped before reading everything, says why: `maxItems`, `chargeLimit` or `timeLimit`. `restarted` says whether the run picked up after Apify restarted it; a restarted run does not
store a lookup or a list twice.

### 🧰 Other Actors by autofacts

Apify only auto-recommends Actors in the same category, so here are the ones that actually pair with this one:

| Actor | What it's for |
| :--- | :--- |
| [Google Trends Trending Now](https://apify.com/autofacts/google-trends-trending-now) | What is trending on Google Search right now, in each of 125 countries, with search volumes |
| [Schema Markup Scraper & SEO Auditor](https://apify.com/autofacts/metadata-scraper) | What the pages that rank for a keyword say about themselves to search engines |
| [Google Ads Scraper](https://apify.com/autofacts/google-ads-scraper) | The ads the brands behind a search run on Google |
| [YouTube Subtitle & Transcript Scraper](https://apify.com/autofacts/youtube-subtitle-transcript-scraper) | What the videos about a topic say, as clean text |
| [Shopify Scraper](https://apify.com/autofacts/shopify) | The products and prices behind a rising shopping search |

All of them: [apify.com/autofacts](https://apify.com/autofacts)

# Actor input Schema

## `keywords` (type: `array`):

Searches to look up, each on its own, in every place and time range below: its interest over time, its top and rising related searches, and where it is searched most.

## `keywordCategory` (type: `string`):

Look the keywords up within one category, to tell one meaning from another: jaguar the car in Autos & Vehicles. Its id, name or path, such as 47, Autos & Vehicles or Shopping > Apparel. Empty: all categories.

## `categories` (type: `array`):

The categories whose top and rising searches to read, with no keyword: an id, a name or a path, such as 18, Shopping or Shopping > Apparel, down to the third level of Google's category tree; 0 for all categories together.

## `subcategories` (type: `boolean`):

Rank each category's subcategories too, down to the third level.

## `allCategories` (type: `boolean`):

Rank all 928 categories down to the third level, and all categories together, whatever Categories to rank says. That is 929 rankings for each place and time range, about an hour and a half: give the run a timeout of two hours or more.

## `countries` (type: `array`):

Where to look: a two-letter country code (US, GB, DE …), a region inside a country (US-CA, GB-SCT), or Worldwide. Each keyword and each category is read for every place.

## `windows` (type: `array`):

How far back to look, each range read on its own. Category rankings exist only over the past 7 days, 30 days, 90 days and 12 months.

## `maxItemsPerList` (type: `integer`):

At most this many searches from each top or rising list, the first ones first. 0 keeps all that Google gives.

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

Stop after this many results in the whole run: lookups and ranked searches together. 0 means no limit.

## `proxy` (type: `object`):

Used for every request. Apify's residential proxies by default: Google refuses keyword and category requests from datacenter addresses more often. A refused request is sent again from another address, and what is still refused is tried once more at the end of the run.

## Actor input object example

```json
{
  "keywords": [
    "bitcoin"
  ],
  "categories": [
    "Shopping"
  ],
  "subcategories": false,
  "allCategories": false,
  "countries": [
    "US"
  ],
  "windows": [
    "12m"
  ],
  "maxItemsPerList": 0,
  "maxItems": 0,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per keyword lookup (interest over time, related searches, regions) and one row per search in a category's top or rising list.

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

How each lookup and each ranking went: read, empty, without data at Google, not reached, or failed with the reason.

# 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 = {
    "keywords": [
        "bitcoin"
    ],
    "categories": [
        "Shopping"
    ],
    "countries": [
        "US"
    ],
    "windows": [
        "12m"
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("autofacts/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 = {
    "keywords": ["bitcoin"],
    "categories": ["Shopping"],
    "countries": ["US"],
    "windows": ["12m"],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("autofacts/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 '{
  "keywords": [
    "bitcoin"
  ],
  "categories": [
    "Shopping"
  ],
  "countries": [
    "US"
  ],
  "windows": [
    "12m"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call autofacts/google-trends --silent --output-dataset

```

## MCP server setup

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