Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vsmutok/ytscrape/llms.txt
Use this file to discover all available pages before exploring further.
YouTube.video() fetches detailed metadata for a single video and returns a VideoDetails dataclass. It accepts either a bare 11-character video id or any standard YouTube URL — no extra parsing needed on your side.
Calling yt.video()
Pass a video id or any URL that embeds one. The method extracts the id automatically from all common URL formats.
Supported URL formats
| Format | Example |
|---|---|
watch?v= | https://www.youtube.com/watch?v=dQw4w9WgXcQ |
youtu.be/ | https://youtu.be/dQw4w9WgXcQ |
/shorts/ | https://www.youtube.com/shorts/dQw4w9WgXcQ |
/embed/ | https://www.youtube.com/embed/dQw4w9WgXcQ |
Full example
The snippet below mirrors the official examples/03_video_details.py example and shows every commonly used field:Field reference
VideoDetails is a frozen dataclass. All fields are listed below.
| Field | Type | Description |
|---|---|---|
video_id | str | Unique 11-character YouTube video id |
title | str | None | Video title |
description | str | None | Full video description |
channel | str | None | Display name of the uploading channel |
channel_id | str | None | UC… id of the uploading channel |
length_seconds | int | None | Duration of the video in seconds |
views | int | None | Total view count as an integer |
keywords | tuple[str, ...] | Tags / keywords associated with the video |
is_live | bool | True if the video is currently a live stream |
thumbnail | str | None | URL of the highest-resolution available thumbnail |
url | str | Canonical https://www.youtube.com/watch?v=… URL (computed property) |
length_seconds is an int (e.g. 212), not a formatted string like "3:32". To display a human-readable duration, convert it yourself: f"{details.length_seconds // 60}:{details.length_seconds % 60:02d}".