# YouTube Rank Checker & Search Scraper (`siteacs/youtube-search-scraper`) Actor

Check where your videos and channel rank on YouTube for each keyword, by country and language, and scrape the full search results: position, video rank, page, title, channel, views, duration and publish time on every row. YouTube's own filters. No API key.

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

## Pricing

$0.50 / 1,000 search 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

## YouTube Rank Checker & Search Scraper

Find where your videos and your channel rank in YouTube search for each keyword, by country and language, and get
the full results list behind it. List your keywords and, optionally, your own videos, channels or playlists. Each
result comes back as a row with the query, its **position** on the page, its **rank among videos**, the **page** it
was on, the country and language, and the video's title, channel, views, duration and publish time. Rows that are
yours are flagged, and one free summary row per keyword gives each of your targets its best position, or "not in the
top 100".

**Quick start**

- **In:** keywords (`queries`), optionally your own videos, channels or playlists (`rankTargets`), a country and a language.
- **Out:** one row per search result (`position`, `videoPosition`, `page`, `title`, `channelName`, `viewCount`, `duration`,
  `publishedTimeText`, `isTarget`) and one free summary row per keyword with the best position of each target.
- **Price:** $0.50 per 1,000 result rows, summary rows free, no start fee. 100 results for one keyword cost $0.05.

```json
{ "queries": ["python tutorial"], "rankTargets": ["@freecodecamp"], "maxResults": 100, "country": "US", "language": "en" }
```

Three fields of one output row: `{"position": 8, "title": "Learn Python - Full Course for Beginners [Tutorial]", "isTarget": true}`.

Use it as a YouTube keyword rank tracker for your channel or your clients' (schedule it daily and chart the
positions), to see which videos and channels own a keyword before you make a video on it, to compare rankings
between countries, or as a YouTube search results scraper with YouTube's own filters. No API key, no quota.

**You pay only for result rows: $0.50 per 1,000.** Summary rows are free. No start fee.

- **Em português:** verificador de posição no YouTube: em que posição seus vídeos e seu canal aparecem na busca do
  YouTube para cada palavra-chave, por país e idioma, com a lista completa de resultados.
- **En español:** comprobador de ranking de YouTube: en qué posición aparecen tus vídeos y tu canal en la búsqueda de
  YouTube para cada palabra clave, por país e idioma, con la lista completa de resultados.
- **Auf Deutsch:** YouTube-Ranking-Checker: auf welcher Position deine Videos und dein Kanal in der YouTube-Suche für
  jedes Keyword stehen, nach Land und Sprache, mit der vollständigen Ergebnisliste.

### Rank check

Put your keywords in **Search queries** and your videos, channels or playlists in **Rank check**:

```json
{
  "queries": ["python tutorial", "learn python", "python for beginners"],
  "rankTargets": ["@freecodecamp", "https://www.youtube.com/watch?v=rfscVS0vtbw"],
  "maxResults": 100,
  "country": "US",
  "language": "en"
}
```

A target can be a video URL or 11-character id, a channel URL, `@handle` or `UC...` id, or a playlist URL. A channel
matches every result of that channel: its videos, its playlists, its own channel card, and collaboration videos it is
part of (byline "freeCodeCamp.org and CS50"; the row lists every channel in `collaboratorChannelIds`). Handles match
with or without accents and in any case. Two spellings of one target (`@FreeCodeCamp` and
`youtube.com/@freecodecamp/videos`) are checked once, under the first; the log says so and the summary lists the other
spelling in `alsoGivenAs`.

Every result row gets `isTarget` (`true` for yours) and `matchedTargets`. After the last result of each keyword
comes a summary row (`type: "summary"`, free) like this one, from a test run:

```json
{
  "query": "learn python",
  "type": "summary",
  "status": "ok",
  "country": "US",
  "language": "en",
  "resultCount": 50,
  "pagesRead": 4,
  "resultsPerPage": [22, 16, 16, 10],
  "maxResults": 50,
  "estimatedResults": 9784572,
  "targetsFound": 2,
  "bestPosition": 2,
  "targets": [
    {
      "target": "@freecodecamp",
      "targetType": "channel",
      "found": true,
      "rank": "2",
      "position": 2,
      "videoPosition": 2,
      "page": 1,
      "matchCount": 4,
      "type": "video",
      "videoId": "rfscVS0vtbw",
      "title": "Learn Python - Full Course for Beginners [Tutorial]",
      "url": "https://www.youtube.com/watch?v=rfscVS0vtbw"
    },
    {
      "target": "https://www.youtube.com/watch?v=rfscVS0vtbw",
      "targetType": "video",
      "found": true,
      "rank": "2",
      "position": 2,
      "videoPosition": 2,
      "page": 1,
      "matchCount": 1,
      "type": "video",
      "videoId": "rfscVS0vtbw",
      "title": "Learn Python - Full Course for Beginners [Tutorial]",
      "url": "https://www.youtube.com/watch?v=rfscVS0vtbw"
    }
  ],
  "scrapedAt": "2026-11-12T00:04:57+00:00"
}
```

For a channel, `rank` is its best result and `matchCount` how many of its results are in the list: 4 here, at
places 2, 17, 32 (a collaboration with CS50) and 49.

`rank` is the position as text, or "not in the top N" (N is the number of results read). When YouTube has fewer
results than you asked for, it says "not in the N results YouTube returned"; when it has none, "not found: YouTube
returned no results".

**Rank samples.** YouTube's order shifts a little on every load (see Accuracy below). Set **Rank samples per query**
to 2–5 and each keyword is searched that many times, to the same depth, each time from a fresh session (new IP, no
cookies). Rows and charges come from the first search only; the repeats are free. Each target in the summary then
also gets `samplePositions` (e.g. `[4, 6, 4]`, `null` where a sample missed it), `foundInSamples` (`"3/3"`),
`positionMedian`, `positionBest` and `positionWorst`. A run with 3 samples takes about three times as long.

### What you get

One row per search result, in YouTube's order:

| Field | What it holds |
|---|---|
| `query` | The keyword the row belongs to |
| `position` | Place on the results page, 1-based, counted on across pages (see **How positions are counted**) |
| `videoPosition` | Rank among the videos listed on their own, leaving out playlists, channels and shelves |
| `shortPosition` | Rank among Shorts |
| `page` | The results page (YouTube sends about 20 places per page) |
| `shelfTitle`, `positionInShelf` | For a video inside a shelf (a row of Shorts, "Latest from ..."): the shelf's title and the video's place in it |
| `isTarget`, `matchedTargets` | Whether the result is one of your rank-check targets, and which |
| `type` | `video`, `short`, `playlist`, `channel` or `movie` |
| `videoId`, `playlistId`, `url`, `title` | The result's id, link and title (a channel's name for a channel) |
| `channelId`, `channelName`, `channelHandle`, `channelUrl`, `isVerified` | The channel behind the result |
| `viewCount`, `viewCountText`, `viewCountIsEstimate` | Views: exact for videos; rounded (estimate) for Shorts in shelves, as YouTube shows them |
| `concurrentViewers` | People watching now, for a live stream |
| `durationSeconds`, `duration` | Length in seconds and as `m:ss` / `h:mm:ss` |
| `publishedTimeText`, `publishedAt`, `publishedAtIsEstimate` | "3 weeks ago" as shown, and the date it stands for (English only) |
| `liveStatus`, `scheduledStartAt` | `none`, `live`, `upcoming` or `ended`; start time of an upcoming stream |
| `isShort` | `true` for a Short |
| `descriptionSnippet` | The line of description YouTube shows under the result |
| `badges` | New, 4K, CC, LIVE, Course, Mix and the like |
| `thumbnailUrl` | The largest thumbnail |
| `videoCount`, `subscriberCount`, `subscriberCountText` | For playlists and channels |
| `country`, `language` | The country (gl) and language (hl) of the search |
| `status`, `scrapedAt` | `ok` on every result row; when the row was made (UTC) |

Example result row (from a test run, shortened):

```json
{
  "query": "python tutorial",
  "type": "video",
  "status": "ok",
  "position": 8,
  "videoPosition": 7,
  "page": 1,
  "shelfTitle": null,
  "positionInShelf": null,
  "isTarget": true,
  "matchedTargets": ["@freecodecamp", "https://www.youtube.com/watch?v=rfscVS0vtbw"],
  "videoId": "rfscVS0vtbw",
  "url": "https://www.youtube.com/watch?v=rfscVS0vtbw",
  "title": "Learn Python - Full Course for Beginners [Tutorial]",
  "channelId": "UC8butISFwT-Wl7EV0hUK0BQ",
  "channelName": "freeCodeCamp.org",
  "channelHandle": "@freecodecamp",
  "channelUrl": "https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ",
  "isVerified": true,
  "viewCount": 49576408,
  "viewCountText": "49,576,408 views",
  "viewCountIsEstimate": false,
  "durationSeconds": 16012,
  "duration": "4:26:52",
  "publishedTimeText": "8 years ago",
  "publishedAt": "2018-11-12T00:04:54Z",
  "publishedAtIsEstimate": true,
  "liveStatus": "none",
  "isShort": false,
  "descriptionSnippet": "This course will give you a full introduction into all of the core concepts in python. ...",
  "badges": ["CC"],
  "thumbnailUrl": "https://i.ytimg.com/vi/rfscVS0vtbw/hq720.jpg?...",
  "country": "US",
  "language": "en",
  "scrapedAt": "2026-11-12T00:04:54+00:00"
}
```

Here `position` is 8 and `videoPosition` 7 because a playlist sits above it.

The summary row adds `resultCount`, `pagesRead`, `resultsPerPage`, `estimatedResults` (YouTube's own estimate),
`correctedQuery` (when YouTube searched a corrected spelling, "Showing results for ..."), `targetsFound`,
`bestPosition`, `targets` and, with rank samples, `rankSamples`. Its `status` is `ok`, `no_results`, `partial` (a later page failed or the query
reached its 15-minute limit; the results end there), `capped` (stopped at your maximum cost), `blocked` or `error` (the first page failed), `timeout` or
`not_started`.

Download the results as JSON, CSV, Excel or HTML, or read them through the Apify API. The **Results** view shows the
list; **Rank check** shows positions, targets and the summary rows.

### How positions are counted

`position` counts what a logged-out visitor sees on youtube.com/results, top to bottom, page after page: every video,
Short, playlist, channel and movie listed on its own takes one place. A shelf (a row of Shorts, "Latest from ...", an
artist's official card) takes one place too, and the videos in it share that place, with `positionInShelf` giving
their order inside it. Ads, spelling notes and "People also search for" cards are not results and take no place. A
result YouTube repeats on a later page is listed once, at its first place.

`videoPosition` counts only videos (and Shorts) listed on their own.
`shortPosition` counts Shorts wherever they appear.

**Shelves.** By default the videos inside shelves are not saved as rows: Shorts shelves come back on every page with
mostly the same Shorts, and would fill your results. The shelf still takes its place in `position`, so the numbers
match the page, and rank-check targets inside shelves are still found (the summary gives their shelf and place). Turn
on **Save the videos inside shelves** to get them as rows. A **Shorts** search always saves them: for some keywords
YouTube lists the Shorts on their own, for others in shelves.

**Shorts searches.** With an upload date, YouTube's Shorts filter answers "No results" to US IPs for many keywords
that have Shorts in that period, while it lists them to IPs in Germany, Brazil or France. When the Shorts filter finds
nothing, the Actor asks again through a residential IP in Germany, with the same country and language settings, at no
extra charge to you (set **Retry refused pages through residential proxy** off to skip it). If that finds nothing
either, it reads the All results with the same filters and saves only their Shorts (`position` then counts every
place on that page). The summary's `reason` says which was used. YouTube's Popularity order leaves Shorts out, so a
Shorts search is always in relevance order.

### How to use it

1. Type your keywords into **Search queries**, one per line. Optionally add your videos or channels under
   **Rank check**.
2. Set **Max results per query** (default 100: about 5 pages), the country and the language, and any filters.
3. Click **Start**. In testing, 50 keywords at 100 results each (about 4,900 rows) took 4 minutes at the default 256
   MB and 5 keywords at a time. A run stops after 10 hours by default.

#### Filters

These are YouTube's own search filters:

- **Result type**: all, videos, Shorts, channels, playlists, live now, movies.
- **Upload date**: last hour, today, this week, this month, this year.
- **Duration**: under 3 minutes, 3 to 20 minutes, over 20 minutes.
- **Sort by**: relevance (YouTube's default) or popularity. YouTube no longer sorts search by upload date or rating;
  use the Upload date filter for recent videos. Shorts come only in relevance order (see Shorts searches above).
- **Country (gl)** and **Language (hl)**: results and their order follow the country; view counts and dates are
  written in the language.

### Accuracy: YouTube's order moves

YouTube does not give every visitor the same order, not even the same visitor twice. In a test on 10 keywords, two
logged-out loads of youtube.com/results a few seconds apart had the same result at the same place for only a third
of the first 20 places; 77 of 100 top-10 results were in both top 10s, and a result moved 1.8 places on average. The
actor's first page agreed with the search page as closely as the page agreed with itself (79 of 100 in
common, 2.0 places on average), and every result type on the page was read.

So treat a position as a measurement with a margin of a few places, or set **Rank samples per query** to read
each keyword several times and take the median. For tracking, run the same keywords on a
schedule and follow the trend; a video that moves from 15 to 4 has moved, a video that moves from 4 to 5 may not have.

### How it works

The actor sends the same requests YouTube's website sends when you search and scroll: the search call, then the
continuation call for each further page, logged out, with no cookies. From cloud servers YouTube sometimes refuses a
request; the actor then repeats it from another datacenter IP, up to six times, and then through residential proxy
(at no extra charge to you).

### Pricing

**$0.50 per 1,000 result rows** ($0.0005 per row), no start fee. Summary rows are free. 100 results for one keyword
cost $0.05. Set **Maximum cost per run** in the run options and the run stops before going over it.

### Limits

- Logged-out results: no personal history, no watch-based personalisation. That is the neutral view most rank
  trackers use, but your own signed-in YouTube may show a different order.
- YouTube decides how many results a keyword has. For many keywords it sends 20 places on the first page and fewer on
  later pages (mostly Shorts shelves); some keywords end after a few pages. The summary's `resultsPerPage` shows what
  it sent. With **Result type: Videos** YouTube sends 20 videos per page.
- Shorts in shelves carry no channel in YouTube's search answer, so a channel target does not match them; list the
  Short's URL as a target to track it.
- `publishedAt` is an estimate from "3 weeks ago" (the latest time it can stand for), and only in English; other
  languages keep YouTube's text in `publishedTimeText`.
- Up to 1,000 results per keyword.

### FAQ

**Is this a YouTube Data API alternative for search?** It returns what the API's `search.list` returns (video,
channel and playlist ids, titles, channels, publish times) plus views, durations and the page position, without a key
or a quota. The official API also costs 100 quota units per search call, so 10,000 units a day cover about 100 pages.

**How do I track rankings over time?** Save your input as a task and schedule it daily (Apify Schedules). Each run's
summary rows give the positions for that day.

**Why is my video not found?** Either it is below the depth you asked for (raise **Max results per query**), it ranks
in another country (set **Country**), or it is in a Shorts shelf and you tracked the channel: track the Short's URL.

**Can I get more details on each video?** Feed the `url` column into
[YouTube Video Details](https://apify.com/siteacs/youtube-video-details) for exact likes, comment count, tags and
category, or into [YouTube Transcript Scraper](https://apify.com/siteacs/youtube-transcript-scraper) for the
transcripts. To list everything a channel you found has published, use
[YouTube Channel Scraper](https://apify.com/siteacs/youtube-channel-scraper).

# Changelog

This Actor's version history is a separate document: https://apify.com/siteacs/youtube-search-scraper/changelog.md

# Actor input Schema

## `queries` (type: `array`):

Keywords or phrases, one per line, typed as you would type them into YouTube's search box. Each query is searched on its own. Use Bulk edit to paste a long list. Duplicates are searched once.

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

How many result rows to save for each query, in YouTube's order. YouTube sends about 20 results per page; 100 results is about 5 pages. A query stops earlier when YouTube has no more results. For a rank check, this is the depth: a target below it is reported as "not in the top N".

## `rankTargets` (type: `array`):

Optional. The videos, channels or playlists whose rank you want for every query: a video URL or 11-character id, a channel URL, @handle or UC... id, or a playlist URL. Rows that match get isTarget: true, and a free summary row per query gives each target's best position, or "not in the top N". A channel matches every video, playlist and channel result of that channel, including collaboration videos it is part of. Two spellings of the same target (@Name and youtube.com/@name/videos) are checked once; the summary lists the other spelling in alsoGivenAs.

## `rankSamples` (type: `integer`):

YouTube shuffles its order a little on every load. Above 1, each query is searched this many times in all, to the same depth, from fresh sessions (new IP, no cookies), and the summary gives each target its median, best and worst position over the samples, the position in each sample and how many samples found it. Only the first search saves rows and is charged; the repeats are free. Used only with rank-check targets.

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

YouTube's own Type filter. Live now is YouTube's Live filter: streams that are on air.

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

YouTube's Upload date filter.

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

YouTube's Duration filter.

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

YouTube's Prioritize setting. YouTube no longer offers sorting by upload date or rating; for recent videos use the Upload date filter. Shorts searches are always in relevance order: YouTube's Popularity order leaves Shorts out.

## `country` (type: `string`):

Two-letter country code whose results you want, as YouTube's gl setting: US, GB, DE, BR, IN, ... Results and their order differ by country.

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

Interface language code, as YouTube's hl setting: en, de, pt, es, pt-BR, ... It sets the language of view counts and dates in the rows. Exact view counts are read in any language; publishedAt (an estimate from "3 weeks ago") is filled for English only, other languages keep YouTube's text in publishedTimeText.

## `includeShelves` (type: `boolean`):

YouTube mixes shelves into the results, mostly rows of Shorts. Off: a shelf takes its place in the position count, as on the page, but its videos are not saved (they repeat on later pages and would fill your results). On: they are saved too, with shelfTitle and positionInShelf. A Shorts search (Result type: Shorts) always saves them: for some keywords YouTube lists Shorts on their own, for others only in shelves. Rank-check targets are found inside shelves either way.

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

How many queries are searched in parallel. The pages of one query are always read in order.

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

Apify datacenter proxy (the default) works for search; a request YouTube refuses is retried on another IP.

## `residentialFallback` (type: `boolean`):

On: a page YouTube still refuses after 6 datacenter IPs is tried through Apify residential proxy, at no extra charge to you; a Shorts search that finds no Shorts is asked again from a residential IP in Germany. Off: the query ends there and its summary row says why.

## Actor input object example

```json
{
  "queries": [
    "python tutorial",
    "learn python"
  ],
  "maxResults": 100,
  "rankTargets": [
    "@freecodecamp",
    "https://www.youtube.com/watch?v=rfscVS0vtbw"
  ],
  "rankSamples": 1,
  "type": "all",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "country": "US",
  "language": "en",
  "includeShelves": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# Actor output Schema

## `overview` (type: `string`):

One item per search result in YouTube's order: query, position, video rank, page, type, link, title, channel, views, duration and publish time (every field in the full item), plus one summary item per query.

## `ranks` (type: `string`):

Positions, matched rank-check targets and shelf places, with the summary items that give each target's best rank per query.

# 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 = {
    "queries": [
        "python tutorial",
        "learn python"
    ],
    "rankTargets": [
        "@freecodecamp",
        "https://www.youtube.com/watch?v=rfscVS0vtbw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("siteacs/youtube-search-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 = {
    "queries": [
        "python tutorial",
        "learn python",
    ],
    "rankTargets": [
        "@freecodecamp",
        "https://www.youtube.com/watch?v=rfscVS0vtbw",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("siteacs/youtube-search-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 '{
  "queries": [
    "python tutorial",
    "learn python"
  ],
  "rankTargets": [
    "@freecodecamp",
    "https://www.youtube.com/watch?v=rfscVS0vtbw"
  ]
}' |
apify call siteacs/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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