# Google Trends Universal Ranker (`trendbridge_tools/google-trends-universal-ranker`) Actor

Compare 2–1,000 keywords on one Google Trends scale. Discover SEO opportunities, product demand, and market gaps using search volume, universal trend scores, and data-quality metrics.

- **URL**: https://apify.com/trendbridge\_tools/google-trends-universal-ranker.md
- **Developed by:** [Bachir Saber](https://apify.com/trendbridge_tools) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Trends Universal Ranker

Rank multiple keywords on one comparable Google Trends scale.

Google Trends normally compares a maximum of five keywords on one shared 0–100 scale. Separate groups are normalized independently, so their scores cannot be compared directly.

This Actor uses search-volume ordering, rolling bridge keywords, and overlapping Google Trends requests to place larger keyword lists on one common scale.

### What the Actor does

1. Retrieves Google Ads search-volume estimates.
2. Sorts the keywords from high to low volume.
3. Selects two rolling bridge keywords for each adjacent group.
4. Requests Google Trends data in overlapping groups.
5. Calibrates every group through the rolling bridge chain.
6. Returns one ranked dataset.

### Input

#### `keywords`

A list containing between 2 and 1,000 keywords.

#### `locationCode`

A DataForSEO location code.

Default: `2840` — United States.

#### `languageCode`

The language used for Google Trends and Google Ads data.

Default: `en`.

### Example input

```json
{
  "keywords": [
    "chatgpt",
    "canva",
    "notion",
    "shopify",
    "air fryer",
    "walking pad"
  ],
  "locationCode": 2840,
  "languageCode": "en"
}
```

### Output

Every keyword produces one dataset item containing:

- `rank`
- `keyword`
- `universalTrendScore`
- `averageInterest`
- `searchVolume`
- `dataPoints`
- `nonZeroDataPoints`
- `dataCoveragePercent`
- `locationCode`
- `languageCode`
- `dateFrom`
- `dateTo`

### Understanding the results

`universalTrendScore` is normalized so that the highest keyword in the submitted list receives a score of `100`.

The remaining scores are relative to that winner. A score of `25` means that the calibrated average interest was approximately 25% of the highest keyword.

`dataCoveragePercent` shows how many returned timeline points were above zero. Very low-volume keywords can have low coverage and may therefore be less stable.

### How rolling bridges work

The first five keywords are compared on one Google Trends scale.

After that, every new group contains:

- two bridge keywords from the previous group;
- up to three new keywords.

The bridge keywords connect the new group to the existing universal scale. After calibration, two suitable keywords from the new group become the bridges for the following group.

This creates a gradual path from high-volume keywords to low-volume keywords and prevents smaller terms from being rounded down to zero when compared directly with extremely large terms.

### Required environment variables

This Actor requires your own DataForSEO API credentials:

- `DATAFORSEO_LOGIN`
- `DATAFORSEO_PASSWORD`

Store both values as secret environment variables in Apify.

### Costs

Each run uses:

- one DataForSEO Google Ads search-volume request;
- one Google Trends request for the first five keywords;
- approximately one additional Trends request for every three remaining keywords;
- normal Apify compute and storage.

Check current DataForSEO pricing before processing large lists.

### Current MVP limitations

- Results depend on Google Trends and DataForSEO availability.
- Very low-volume keywords may still be less stable than popular terms.
- Search-volume estimates and Trends values can fluctuate between runs.
- Rolling bridge calibration can accumulate small measurement differences across long keyword lists.
- This MVP does not yet calculate statistical confidence intervals.
- Lists approaching 1,000 keywords require further validation before production use.

### Privacy

API credentials are read only from secret environment variables. They are not written to the output dataset.

### Validation status

MVP validation completed with successful 8-keyword, 20-keyword, and 32-keyword cross-batch tests.

The 32-keyword test used ten overlapping Trends groups. Every transition contained 108 valid bridge data points, and all 32 keywords returned 100% data coverage.

# Actor input Schema

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

Enter between 2 and 1,000 keywords to compare.

## `locationCode` (type: `integer`):

DataForSEO location code. 2840 is the United States.

## `languageCode` (type: `string`):

Language used for Google Trends.

## Actor input object example

```json
{
  "keywords": [
    "youtube",
    "amazon"
  ],
  "locationCode": 2840,
  "languageCode": "en"
}
```

# Actor output Schema

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

Ranked keyword results stored in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("trendbridge_tools/google-trends-universal-ranker").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("trendbridge_tools/google-trends-universal-ranker").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 '{}' |
apify call trendbridge_tools/google-trends-universal-ranker --silent --output-dataset

```

## MCP server setup

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

```

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/Nb5KF1Zo649uccCCk/builds/4wv0MKpjPZcmWbWD4/openapi.json
