Get video
getVideo(id, query?, options?): Video
Two lookup depths share this path. mode=fast (default) reads the player response only: title, views, duration, thumbnails, caption languages, and basic channel attribution. Typically under a second, 1 credit.
mode=full also fetches the watch-next payload: like count, chapters, engagement heatmap, publish time, subscriber text, and channel avatar. 2 credits. Cache keys are separate, so a fast hit does not satisfy a full request.
Credits
Successful mode=fast responses deduct 1 credit. Successful mode=full responses deduct 2 credits. Failed lookups are not billed.
Security
API Token
The preferred authorization scheme for the YouTube Transcript API. Create a key with videos:read in the developer dashboard.
Example: Authorization: Bearer YOUR_API_KEY
See Authentication for scopes and rate limits.
Accepted permissions (at least one required)
ParametersExpand Collapse
id:stringPath param:
11-character YouTube video ID.
mode?:stringQuery param:
fast (default) or full.
required_country?:stringQuery param:
ISO country hint used when region availability matters. Alias: country.
Returns (mode=fast)Expand Collapse
video_id:stringEchoed YouTube video ID.
title:stringVideo title.
author:stringChannel display name. Same value as channel.title.
channel_id:stringCanonical channel ID. Same value as channel.id.
channel:objectChannel attribution from the player response.
id:stringCanonical channel ID.
title:stringChannel display name.
url:stringChannel URL.
description?:stringPlayer description / short description.
length_seconds:numberDuration in seconds.
view_count:numberView count at request time.
keywords?:string[]Creator tags when the player returns them.
thumbnails?:Thumbnail[]Player thumbnail ladder.
url:stringImage URL.
width:numberWidth in pixels.
height:numberHeight in pixels.
available_languages?:AvailableLanguage[]Caption tracks advertised on the player. Present in both modes.
code:stringISO language code, for example en.
name?:stringPlayer display name.
kind?:stringasr or manual.
variant?:stringTrack variant when YouTube exposes one, for example gemini.
is_translatable?:booleanWhether YouTube marks the track as translatable.
mode:stringEchoed lookup mode. fast in this response.
Returns (mode=full)Expand Collapse
All mode=fast fields, plus:
published?:numberUnix timestamp (seconds) for the upload / publish date.
like_count?:numberLike count from the watch page.
channel.subscribers?:stringSubscriber text from the watch page, for example 1.69M subscribers.
channel.avatar_url?:stringBest channel avatar URL from the watch page.
chapters?:Chapter[]Timestamped chapters when YouTube exposes them (overlay, description, or pinned comment). Omitted when none exist.
title:stringChapter title.
start_time_seconds:numberStart offset in seconds.
time_description?:stringDisplay timestamp, for example 0:00.
thumbnails?:Thumbnail[]Chapter thumbnail ladder when present.
heatmap?:HeatmapMost-replayed waveform from the watch page. Omitted when YouTube does not provide one.
markers:HeatmapMarker[]Normalized intensity samples along the timeline (often ~100 points).
start_seconds:numberSample start offset.
duration_seconds:numberSample width.
intensity:numberNormalized 0.0–1.0.
peaks?:HeatmapPeak[]High-intensity spans.
most_replayed?:HeatmapPeakThe single highest-intensity span, when labeled.
start_seconds:numberSpan start.
end_seconds:numberSpan end.
intensity:numberNormalized 0.0–1.0.
label?:stringFor example Most replayed.
mode:stringfull.
Full-mode responses keep every fast field. heatmap.markers is typically about 100 points; truncated:
{
"video_id": "kCc8FmEb1nY",
"title": "Let's build GPT: from scratch, in code, spelled out.",
"author": "Andrej Karpathy",
"channel_id": "UCXUPKJO5MZQN11PqgIvyuvQ",
"channel": {
"id": "UCXUPKJO5MZQN11PqgIvyuvQ",
"title": "Andrej Karpathy",
"url": "https://www.youtube.com/@AndrejKarpathy",
"subscribers": "1.69M subscribers",
"avatar_url": "https://yt3.ggpht.com/..."
},
"length_seconds": 6980,
"view_count": 7850809,
"published": 1673913600,
"like_count": 169183,
"chapters": [
{
"title": "intro: ChatGPT, Transformers, nanoGPT, Shakespeare",
"start_time_seconds": 0,
"time_description": "0:00"
}
],
"heatmap": {
"markers": [
{ "start_seconds": 0, "duration_seconds": 69.8, "intensity": 0.12 },
{ "start_seconds": 1047, "duration_seconds": 69.8, "intensity": 1 }
],
"peaks": [
{
"start_seconds": 1047,
"end_seconds": 1465.8,
"intensity": 1,
"label": "Most replayed"
}
],
"most_replayed": {
"start_seconds": 1047,
"end_seconds": 1465.8,
"intensity": 1,
"label": "Most replayed"
}
},
"mode": "full"
}