# Google Trends Country Comparison RSS (`bin_ai_tools/google-trends-country-compare`) Actor

Google Trends Country Comparison RSS bounded public-source results with success-only PPE.

- **URL**: https://apify.com/bin_ai_tools/google-trends-country-compare.md
- **Developed by:** [Bin Bin](https://apify.com/bin_ai_tools) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.80 / 1,000 country trend comparison results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Trends Country Comparison — Public RSS

Compare trending search terms from the **public Google Trends RSS top subset** for 2–6 countries. This Actor is independent, not affiliated with Google, and **does not** provide full Explore data, keyword volume estimates, search rankings, or an exhaustive country trend list.

### First run

```json
{"countries":["US","GB"],"mode":"all","maxResults":10,"onlyNew":false}
```

Input `countries` contains two to six two-letter country codes. `mode` can be `all`, `shared` or `unique`:

- `all` lists terms seen in any returned country's RSS subset; one row can belong to only one country, even when **both** requested country feeds loaded successfully.
- `shared` lists only terms observed in all requested RSS country subsets. It may return no rows because popular terms seldom appear simultaneously in small top subsets.
- `unique` lists terms observed in only one country's RSS subset.

`shared` and `unique` require successful data from **every** requested country; otherwise no comparison is delivered or billed, avoiding false classifications. In `all` mode a failed country may produce `partialCoverage=true`. **`partialCoverage=false` means the requested feeds were successfully checked, not that every trend appeared in every country.**

Results contain `query`, the countries where that term was observed, `countryCount`, `countryDetails` with dates, `comparedCountries`, `partialCoverage`, and `retrievedAt`. The bounded output limit `maxResults` is 1–60.

For scheduled incremental runs, set `onlyNew=true` and provide a unique named `stateStoreName` (4–70 characters). Reuse that named Key-Value Store for the same job; do not share a store across customers.

### Pricing and billing

Official Apify PAY_PER_EVENT pricing is **$0.0008 per successfully delivered `trend-comparison-result` row**. There is only one custom result event, with **no additional automatic Dataset charge**. Empty/failed sources, skipped duplicates and failed Dataset writes do not generate successful paid events. The Actor records delivered/billed counts, billing failures and warnings in `OUTPUT`.

Private verification: Build `0.1.1`, Run `yXbIvjRwftjybCRFF` produced one US-observed term from the US/GB comparison, with Dataset=1, `OUTPUT.delivered=1`, `OUTPUT.billed=1`, `billingFailures=0` and `chargedEventCounts.trend-comparison-result=1`. This developer test is not an external customer purchase.

This document describes the updated **release candidate**; the Actor was still **Private** without a production `latest` build when this validation was recorded.

# Actor input Schema

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

Two to six distinct country codes whose public Google Trends RSS subsets are compared.

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

Whether to return all observed trends, only shared trends, or only country-unique trends.

## `onlyNew` (type: `boolean`):

Whether to emit only trend keys not seen in the named persistent state store.

## `stateStoreName` (type: `string`):

Required if onlyNew=true; reuse the same name across runs and do not share names between customers.

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

Maximum number of comparison rows emitted by this run.

## Actor input object example

```json
{
  "countries": [
    "US",
    "GB"
  ],
  "mode": "all",
  "onlyNew": false,
  "maxResults": 30
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "countries": [
        "US",
        "GB"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bin_ai_tools/google-trends-country-compare").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 = { "countries": [
        "US",
        "GB",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bin_ai_tools/google-trends-country-compare").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 '{
  "countries": [
    "US",
    "GB"
  ]
}' |
apify call bin_ai_tools/google-trends-country-compare --silent --output-dataset

```

## MCP server setup

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

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/DkQHIhn5eXKvvu7di/builds/ARPkxE2eBxbjBzVm0/openapi.json
