# YouTube Video Detail Scraper (`xtracto/youtube-video-detail-scraper`) Actor

Fetch a YouTube video's metadata — title, channel, views, likes label, description, upload date, keywords, thumbnails. No login.

- **URL**: https://apify.com/xtracto/youtube-video-detail-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.99 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## YouTube Video Detail Scraper

Extract rich metadata for any YouTube video in bulk — title, channel, view count, description, thumbnails, keywords, upload date, category, and country availability — in a clean structured JSON output.

### Why use this actor

- **No account / no login required** — just give it a YouTube video ID, watch URL, short URL, or Shorts URL.
- **No API key needed and no quota** — unlike the YouTube Data API, this actor has no daily request cap and no API key to manage.
- **Flexible input** — 11-character video IDs, full `youtube.com/watch?v=...` URLs, `youtu.be/...` short links, and `youtube.com/shorts/...` Shorts URLs are all accepted in the same list.
- **Live view count** — the `viewCount` reflects the count YouTube shows on the page at the moment of scraping, not a cached or aggregated number.
- **Bulk input** — pass a list of videos in one run; one clean dataset row per video.
- **Status-aware** — private, removed, age-restricted, and members-only videos surface as a structured `_error` envelope so you can triage failures.
- **Stable JSON output** suitable for pipelines, spreadsheets, and databases — every row carries `_input`, `_source`, `_scrapedAt` envelope fields so you can join results back to your input list.

### How it works

1. You provide a list of YouTube videos as IDs or URLs (any of the supported URL shapes).
2. The actor opens each video's public watch page and reads the metadata block the same way the YouTube web app does, then assembles a flat JSON record.
3. Unavailable videos (private, removed, age-restricted, region-blocked) return a structured `_error` instead of crashing the run.
4. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "videos": [
    "dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
````

| Field | Type | Description |
|---|---|---|
| `videos` | array | List of YouTube videos to scrape. Accepts 11-character IDs (`dQw4w9WgXcQ`), full watch URLs (`https://www.youtube.com/watch?v=...`), short URLs (`https://youtu.be/...`), and Shorts URLs (`https://www.youtube.com/shorts/...`). |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy is fine for most workloads. |

### Output

Input: `dQw4w9WgXcQ`

```json
{
  "_input": "dQw4w9WgXcQ",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T10:42:41.835602+00:00",
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "lengthSeconds": "213",
  "viewCount": "1773571537",
  "likesLabel": "",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelTitle": "Rick Astley",
  "channelUrl": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
  "isLive": false,
  "isPrivate": false,
  "shortDescription": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Autobiography OUT NOW! \nFollow this link to get your copy and listen to Rick’s ‘Never’ playlist ... (truncated)",
  "thumbnails": [
    { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=...", "width": 168, "height": 94 },
    { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=...", "width": 336, "height": 188 },
    { "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/maxresdefault.webp", "width": 1920, "height": 1080 }
  ],
  "keywords": [
    "rick astley",
    "Never Gonna Give You Up",
    "rick roll",
    "rickrolled",
    "80s music"
  ],
  "uploadDate": "2009-10-24T23:57:33-07:00",
  "publishDate": "2009-10-24T23:57:33-07:00",
  "category": "Music",
  "isFamilySafe": true,
  "availableCountries": ["AD", "AE", "AF", "AG", "AI", "... 240 more"]
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The video ID or URL exactly as you supplied it. Use this to join results back to your input list. |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-primary` means the fastest, richest path; values starting with `S2-` indicate a fallback was used. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `videoId` | string | The canonical 11-character YouTube video ID. |
| `title` | string | Video title. |
| `lengthSeconds` | string | Video duration in seconds (numeric string, as returned by YouTube). |
| `viewCount` | string | Total view count at the moment of scraping (numeric string). |
| `likesLabel` | string | Accessibility label for the like button (e.g. "like this video along with 1.2K other people"). Empty string if the video has no public like count. YouTube no longer exposes the raw integer publicly. |
| `channelId` | string | Channel ID (the `UC...` slug). Stable across channel renames. |
| `channelTitle` | string | Channel display name. |
| `channelUrl` | string | Canonical channel URL (`https://www.youtube.com/channel/UC...`). |
| `isLive` | boolean | `true` if the video is or was a live stream. |
| `isPrivate` | boolean | `true` if the video is private. |
| `shortDescription` | string | Video description text (preserves line breaks). |
| `thumbnails` | array | List of thumbnail variants. Each item has `url`, `width`, `height`. The largest is usually `maxresdefault.webp` (1920x1080). |
| `keywords` | array | List of video tags / keywords set by the uploader. May be empty. |
| `uploadDate` | string | ISO-8601 timestamp the video was uploaded. |
| `publishDate` | string | ISO-8601 timestamp the video was published (often equal to `uploadDate`; differs for premiered videos). |
| `category` | string | YouTube category name (e.g. "Music", "Gaming", "Education"). |
| `isFamilySafe` | boolean | `true` if YouTube classifies the video as family-safe. |
| `availableCountries` | array | ISO 3166-1 alpha-2 country codes where the video is viewable. |

#### Error envelope

Videos that are private, removed, age-restricted, or otherwise unavailable return a structured error instead of crashing the run:

```json
{
  "_input": "abc123XYZ45",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T10:42:43.123456+00:00",
  "_error": "login_required",
  "_errorDetail": "Sign in to confirm your age"
}
```

Common `_error` values: `invalid_input`, `fetch_failed`, `parse_failed`, `login_required` (age-restricted), `unplayable` (removed by uploader / copyright), `error` (private or deleted).

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$3.50 per 1,000 videos**. Each successful video record = 1 result. Errors (not-found, removed, age-restricted) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| YouTube | [YouTube Channel Scraper](https://apify.com/xtracto/youtube-channel-scraper) | Channel profile, subscriber count, video list |
| YouTube | [YouTube Video Comments Scraper](https://apify.com/xtracto/youtube-video-comments-scraper) | Top-level + replies for any video |
| Twitch | [Twitch Video Detail Scraper](https://apify.com/xtracto/twitch-video-detail) | VOD / clip metadata + streamer info |
| Bluesky | [Bluesky Post Detail Scraper](https://apify.com/xtracto/bluesky-post-detail-scraper) | Single post + author + thread context |
| Instagram | [Instagram Post Detail Scraper](https://apify.com/xtracto/instagram-post-detail-scraper) | Reel / image post + author + caption |
| X (Twitter) | [X Post Detail Scraper](https://apify.com/xtracto/x-post-detail-scraper) | Tweet + author + engagement counters |
| Reddit | [Reddit Post Detail Scraper](https://apify.com/xtracto/reddit-post-detail-scraper) | Post + subreddit + score + comment count |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- YouTube removed exact like counts in 2021; `likesLabel` returns the labeled string ("like this video along with 1.2K other people") which you can parse to an approximate integer. It is empty when YouTube does not surface a label for the video.
- `viewCount` is the live count at scrape time, not a real-time tick — it lags actual views by seconds to a few minutes.
- Age-restricted videos return `_error: "login_required"` — they require an authenticated session this actor does not provide.
- Private or deleted videos return `_error: "error"` with the YouTube-supplied reason in `_errorDetail`.
- Live streams in progress return partial data — view count and duration may not be finalized.
- Region-blocked videos may succeed but with `availableCountries` excluding your proxy location. Switch proxy region if you need a specific market.

# Actor input Schema

## `videos` (type: `array`):

List of YouTube videos to fetch. Accepts 11-character video IDs (e.g. dQw4w9WgXcQ), full watch URLs (https://www.youtube.com/watch?v=...), short URLs (https://youtu.be/...), and Shorts URLs (https://www.youtube.com/shorts/...).

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

Apify Proxy settings. Datacenter proxy is fine for most workloads; switch to residential if you scrape large batches or hit region-blocked content.

## Actor input object example

```json
{
  "videos": [
    "dQw4w9WgXcQ",
    "9bZkp7q19f0"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "videos": [
        "dQw4w9WgXcQ",
        "9bZkp7q19f0"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/youtube-video-detail-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 = { "videos": [
        "dQw4w9WgXcQ",
        "9bZkp7q19f0",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/youtube-video-detail-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videos": [
    "dQw4w9WgXcQ",
    "9bZkp7q19f0"
  ]
}' |
apify call xtracto/youtube-video-detail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtracto/youtube-video-detail-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video Detail Scraper",
        "description": "Fetch a YouTube video's metadata — title, channel, views, likes label, description, upload date, keywords, thumbnails. No login.",
        "version": "1.0",
        "x-build-id": "x8UvOHxYGhfQ5syMx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~youtube-video-detail-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-youtube-video-detail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xtracto~youtube-video-detail-scraper/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-youtube-video-detail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xtracto~youtube-video-detail-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-youtube-video-detail-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "videos"
                ],
                "properties": {
                    "videos": {
                        "title": "YouTube videos",
                        "type": "array",
                        "description": "List of YouTube videos to fetch. Accepts 11-character video IDs (e.g. dQw4w9WgXcQ), full watch URLs (https://www.youtube.com/watch?v=...), short URLs (https://youtu.be/...), and Shorts URLs (https://www.youtube.com/shorts/...).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Datacenter proxy is fine for most workloads; switch to residential if you scrape large batches or hit region-blocked content.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
