# YouTube Keyword Rank Tracker: Videos, Channels & Share of Voice (`xyrelith-data/youtube-keyword-rank-tracker`) Actor

Track YouTube search rankings for your videos and channels across countries and languages. Returns target positions, channel share of voice, the full ranked results, competitor stats and rank changes on repeat runs.

- **URL**: https://apify.com/xyrelith-data/youtube-keyword-rank-tracker.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** SEO tools, Videos, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## YouTube Keyword Rank Tracker

See where your videos and channels appear in YouTube search, across every country you care about, without logging in or configuring a proxy. One run returns the target positions, the full ranked result set, competitor channel statistics and each channel's share of voice. Repeat runs add rank movement, new entrants and dropped-out videos.

YouTube search results are personal. This actor reads the signed-out, country-level result page for the market and interface language you choose, so treat every position as a dated snapshot rather than a universal truth.

### What you can track

- **Keywords:** one or many search phrases. Duplicates and stray whitespace are removed.
- **Markets:** several two-letter country codes in the same run (US, GB, DE, JP, BR and more).
- **Languages:** auto follows the market, or pick an interface language explicitly.
- **Target videos:** watch, youtu.be, Shorts, embed and live links, or raw 11-character video IDs.
- **Target channels:** channel URLs, `@handles` or `UC...` IDs. A channel matches every video it owns in the results.
- **Competitor channels:** the same formats, reported beside your channels.
- **Result type:** video rankings, channel-search rankings, or both.
- **Shorts:** off by default. Turn on to let Shorts shelf items take positions.
- **Filters:** upload date, duration and sort order, matching YouTube's own search filters.
- **Depth:** 20 to 500 results per keyword and market.

### What each run returns

The dataset mixes three row types, all sharing `keyword`, `market` and `scrapedAt`.

#### Keyword summary

One row per keyword and market. It carries the applied filters, YouTube's estimated result count, how many results were actually scanned, the target-video results, target and competitor channel results, the channel share-of-voice table, and (in monitor mode) new entrants, dropped-out videos, the previous check time and whether this run created the baseline.

#### Video ranking

One row per ranked video or Short. Fields include:

`rank`, `videoRank`, `shortRank`, `resultType`, `videoId`, `title`, `url`, `channelName`, `channelId`, `channelUrl`, `channelHandle`, `channelVerified`, `viewCount`, `viewCountText`, `publishedTimeText`, `durationText`, `durationSeconds`, `isShort`, `isLive`, `isUpcoming`, `badges`, `thumbnailUrl`, `isTargetVideo`, `isTargetChannel`, `isCompetitorChannel`, `sourceUrl`.

With **Fetch exact video details** on, rows can also include `publishedAt`, exact `viewCount`, `likeCount` and `category`.

#### Channel ranking

One row per channel in YouTube's Channels result list: `rank`, `channelId`, `channelName`, `channelUrl`, `channelHandle`, `description`, `subscriberCount`, `subscriberCountText`, `videoCount`, `videoCountText`, `isVerified`, `thumbnailUrl`, `isTargetChannel`, `isCompetitorChannel`.

### How positions are counted

- A position is the order YouTube returned for organic video results, starting at 1.
- Channel cards, playlists, mixes and horizontal shelves do not take a video position.
- Shorts shelf items take a position only when **Include Shorts** is on. `isShort` marks those rows; regular short-duration videos keep `isShort` false.
- A video repeated on a later page is counted once.
- `rank` is the position in the returned stream you asked for. `videoRank` counts regular videos only, and `shortRank` counts Shorts only, so you can compare both views.
- A target channel's `bestVideoRank` is the highest position among its videos in the scanned depth. Its `channelRank` is its position in the separate channel search.
- `shareOfVoicePercent` is the channel's share of the scanned result rows. `shareOfVoiceCoveragePercent` says what portion of rows exposed a channel ID, because Shorts shelf cards sometimes do not.

### Monitor mode and history

Track mode returns a snapshot and stores nothing. Monitor mode saves the snapshot in a named key-value store under your **History key** and compares the next run with it:

- `previousRank`, `rankChange` and `isNewEntrant` on rows and target results. A positive `rankChange` means the target moved up.
- `dropped` marks a target that was present in the previous snapshot but is absent now.
- Summary lists `newEntrants` and `droppedOut`.
- Target results carry `bestRankEver`, `worstRankEver`, `averageRank`, `checkCount` and `rankedCheckCount`.
- The first monitor run creates the baseline and sets `baselineCreated` to true. The second and later runs compare against it.
- Use a different **History key** per client or project. **Reset history** clears the stored snapshots for that key before checking.
- History is kept separately for each keyword, market, language, result type, filter set and depth. Changing a filter starts a separate comparison series.

### Inputs

| Input | What it does |
|---|---|
| `mode` | Track a snapshot or monitor changes against stored history. |
| `keywords` | Search phrases, one per line. Required. |
| `markets` | Country codes for the YouTube results. Several codes per run. |
| `language` | Interface language, or auto from the market. |
| `targetVideos` | Your video URLs or IDs. |
| `targetChannels` | Your channel URLs, handles or IDs. |
| `competitorChannels` | Competitor channel URLs, handles or IDs. |
| `resultType` | Videos, Channels, or both. |
| `includeShorts` | Let Shorts shelf items take positions. |
| `uploadDate` | Any time, last hour, today, this week, this month or this year. |
| `duration` | Any, under 3 minutes, 3 to 20 minutes or over 20 minutes. |
| `sortBy` | Relevance or most viewed. |
| `depth` | How many results to inspect per keyword and market (20-500). |
| `includeVideoDetails` | Add exact publish date, views, likes and category per ranked video. |
| `stateKey` | Monitor history name. |
| `resetHistory` | Clear the history for the current key before the run. |

Only `keywords` is required. Every other input has a working default.

### Defaults

| Input | Default |
|---|---|
| `mode` | `track` |
| `keywords` | – (required) |
| `markets` | `["US"]` |
| `language` | `auto` |
| `targetVideos` | `[]` |
| `targetChannels` | `[]` |
| `competitorChannels` | `[]` |
| `resultType` | `videos` |
| `includeShorts` | `false` |
| `uploadDate` | `any` |
| `duration` | `any` |
| `sortBy` | `relevance` |
| `depth` | `20` |
| `includeVideoDetails` | `false` |
| `stateKey` | `default` |
| `resetHistory` | `false` |

### Example

```json
{
  "mode": "monitor",
  "keywords": ["video editing tips", "capcut tutorial"],
  "markets": ["US", "DE"],
  "targetVideos": ["Y0izFme1AwI"],
  "targetChannels": ["@TipsEditor"],
  "competitorChannels": ["@ThinkMedia"],
  "resultType": "both",
  "includeShorts": false,
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "depth": 20,
  "stateKey": "editing-client-a"
}
```

### Limits worth knowing

- Positions are signed-out, country-level snapshots. City, device and personalised results are not available from the public web search response.
- YouTube shuffles logged-out results over time, so a move of one or two places between runs is normal. Follow the trend.
- The search page may stop serving continuations before your requested depth. The summary reports how many rows were actually scanned.
- Channel search ignores upload-date and duration filters; only sort is applied. The run logs a note when those filters are combined with channel-only results.
- Shorts shelf cards do not expose a channel ID. Their positions count, but their channel cannot contribute to share of voice unless exact detail enrichment identifies it.
- Exact view counts are emitted only when YouTube displays an unrounded label, or when **Fetch exact video details** is on. Abbreviated labels stay as text; the actor never invents precision.
- An unknown market or language is replaced with a safe default and logged in the run.
- The actor is not affiliated with or endorsed by YouTube or Google.

### FAQ

**Do I need a YouTube account, cookie or API key?** No. The actor reads the public web search response.

**Why is my rank different from what I see in my browser?** Your browser is signed in and carries watch history. The actor uses a signed-out session for the chosen country and language.

**Can I track Shorts?** Yes. Turn on **Include Shorts**, or paste a Shorts link into **targetVideos**. The Short appears in the normal video stream when YouTube serves it.

**Can I compare several markets?** Yes. Add every country code to `markets`; each keyword gets one summary per market.

**Why did my target channel show `found: false` but still have a `channelRank`?** `found` is true when the channel or one of its videos appears. `channelRank` comes from the separate Channels result list, so a channel can rank there while none of its videos rank in the video depth you chose.

**Does monitor mode keep history forever?** The actor stores one snapshot per keyword, market and filter set under your history key. Reset it whenever you want a clean baseline.

# Actor input Schema

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

Track a fresh snapshot, or monitor changes against the previous run stored under your history key.

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

Search phrases to check, one per line. Each keyword is searched in every selected market for every target.

## `markets` (type: `array`):

Country codes for the YouTube search results (ISO 3166-1 alpha-2). Supported: US, GB, CA, AU, DE, FR, JP, KR, BR, IN, MX, IT, ES, NL, PL, RU, SE, NO, DK, FI, ZA, SG, HK, TW, ID, MY, TH, PH, AR, CO, CL.

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

Language of the YouTube search page. Auto uses the market's main language.

## `targetVideos` (type: `array`):

Your video URLs or 11-character video IDs. Watch, youtu.be, Shorts, embed and live links are accepted.

## `targetChannels` (type: `array`):

Your channel URLs, @handles or UC... channel IDs. A channel matches any of its videos in the results.

## `competitorChannels` (type: `array`):

Competitor channel URLs, @handles or UC... channel IDs. Their ranks, video counts and share of voice are reported beside yours.

## `resultType` (type: `string`):

Rank regular videos, channel search results, or both. Video rankings drive share of voice.

## `includeShorts` (type: `boolean`):

Include Shorts shelf items in video rankings. When off, only regular video results take positions.

## `uploadDate` (type: `string`):

Keep only videos uploaded in this period, matching YouTube's own filter. Channel searches ignore it.

## `duration` (type: `string`):

Keep only videos of this length, matching YouTube's own filter. Channel searches ignore it.

## `sortBy` (type: `string`):

Order of the search results. Relevance matches the default YouTube page.

## `depth` (type: `integer`):

How many results to inspect per keyword and market. YouTube returns about 20 per page; 20 is the cheapest useful check.

## `includeVideoDetails` (type: `boolean`):

Adds one small request per ranked video for the exact publish date, view count, like count and category. Slower and uses more requests; listings already include YouTube's displayed age and views.

## `stateKey` (type: `string`):

Monitor mode only. A name for this project's history, so separate clients or keyword sets keep separate baselines.

## `resetHistory` (type: `boolean`):

Monitor mode only. Clear the stored snapshots for this history key before checking, and start a new baseline.

## Actor input object example

```json
{
  "mode": "track",
  "keywords": [
    "video editing tips"
  ],
  "markets": [
    "US"
  ],
  "language": "auto",
  "targetVideos": [],
  "targetChannels": [],
  "competitorChannels": [],
  "resultType": "videos",
  "includeShorts": false,
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "depth": 20,
  "includeVideoDetails": false,
  "stateKey": "default",
  "resetHistory": false
}
```

# Actor output Schema

## `rankings` (type: `string`):

Dataset containing keyword summaries, video rankings and channel rankings.

# 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 = {
    "mode": "track",
    "keywords": [
        "video editing tips"
    ],
    "markets": [
        "US"
    ],
    "language": "auto",
    "targetVideos": [],
    "targetChannels": [],
    "competitorChannels": [],
    "resultType": "videos",
    "includeShorts": false,
    "uploadDate": "any",
    "duration": "any",
    "sortBy": "relevance",
    "depth": 20,
    "includeVideoDetails": false,
    "stateKey": "default",
    "resetHistory": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/youtube-keyword-rank-tracker").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 = {
    "mode": "track",
    "keywords": ["video editing tips"],
    "markets": ["US"],
    "language": "auto",
    "targetVideos": [],
    "targetChannels": [],
    "competitorChannels": [],
    "resultType": "videos",
    "includeShorts": False,
    "uploadDate": "any",
    "duration": "any",
    "sortBy": "relevance",
    "depth": 20,
    "includeVideoDetails": False,
    "stateKey": "default",
    "resetHistory": False,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/youtube-keyword-rank-tracker").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 '{
  "mode": "track",
  "keywords": [
    "video editing tips"
  ],
  "markets": [
    "US"
  ],
  "language": "auto",
  "targetVideos": [],
  "targetChannels": [],
  "competitorChannels": [],
  "resultType": "videos",
  "includeShorts": false,
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "depth": 20,
  "includeVideoDetails": false,
  "stateKey": "default",
  "resetHistory": false
}' |
apify call xyrelith-data/youtube-keyword-rank-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/youtube-keyword-rank-tracker"
        }
    }
}
```

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/6PPbPQilQqRptsqqm/builds/Hb06yJEvWbtpmh6Bj/openapi.json
