Fetch a transcript
Fetch one transcript synchronously and return it in the requested format. A successful response costs 1 credit.
GET
/api/v1/transcript/:videoIdPath parameters
| Name | Type | Description |
|---|---|---|
videoIdrequired | string | Exactly 11 characters matching [a-zA-Z0-9_-]. |
Query parameters
| Name | Type | Description |
|---|---|---|
lang | string | Preferred language code (e.g. en, es, de). If absent, the default caption track is returned. If the requested language isn't available, the default track is returned and language in the response reflects what was actually served. |
format | string | One of json (default), txt, srt, csv, docx, markdown. See Export formats for shape details. |
Request
bash
curl -H "Authorization: Bearer yvt_live_..." \
"https://api.youtubevideotranscript.io/api/v1/transcript/dQw4w9WgXcQ"JSON response (default)
Content-Type: application/json
json
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [
{ "text": "We're no strangers to love", "start": 0.08, "duration": 3.28 },
{ "text": "You know the rules and so do I", "start": 1.64, "duration": 4.28 }
],
"metadata": {
"title": "Rick Astley - Never Gonna Give You Up",
"author_name": "Rick Astley",
"author_url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
"thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"duration_seconds": 213
},
"is_auto_generated": false,
"available_tracks": [
{ "language_code": "en", "language_name": "English", "is_auto_generated": false, "vss_id": "..." }
]
}Field guarantees
video_idandlanguageare always strings.transcriptis always an array of segment objects.metadata.title,author_name,author_url, andthumbnail_urlare always strings.metadata.channel_idandmetadata.duration_secondsare populated when available; they may be absent for some videos.is_auto_generatedandavailable_tracksare present when YouTube exposes them; they may be absent.
Non-JSON formats
With ?format=txt, ?format=srt, ?format=csv, ?format=docx, or ?format=markdown, the response is the raw file with the appropriate Content-Type and Content-Disposition: attachment; filename="<videoId>.<ext>".
bash
# Save as <videoId>.txt
curl -OJ -H "Authorization: Bearer yvt_live_..." \
"https://api.youtubevideotranscript.io/api/v1/transcript/dQw4w9WgXcQ?format=txt"
# Save as <videoId>.md
curl -OJ -H "Authorization: Bearer yvt_live_..." \
"https://api.youtubevideotranscript.io/api/v1/transcript/dQw4w9WgXcQ?format=markdown"Errors
| Status | Type | When |
|---|---|---|
| 400 | bad_request | videoId not 11 characters matching [a-zA-Z0-9_-], or invalid format value |
| 402 | insufficient_quota | Not enough credits |
| 403 | forbidden | Free plan requesting srt/csv/docx/markdown; OR video unavailable, age-restricted, geo-blocked, or live-stream offline |
| 404 | not_found | Video has no captions in any reachable language |
Global 401, 429, and 5xx also apply. See Errors.