Fetch a transcript

Fetch one transcript synchronously and return it in the requested format. A successful response costs 1 credit.

GET/api/v1/transcript/:videoId

Path parameters

NameTypeDescription
videoIdrequiredstringExactly 11 characters matching [a-zA-Z0-9_-].

Query parameters

NameTypeDescription
langstringPreferred 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.
formatstringOne 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_id and language are always strings.
  • transcript is always an array of segment objects.
  • metadata.title, author_name, author_url, and thumbnail_url are always strings.
  • metadata.channel_id and metadata.duration_seconds are populated when available; they may be absent for some videos.
  • is_auto_generated and available_tracks are 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

StatusTypeWhen
400bad_requestvideoId not 11 characters matching [a-zA-Z0-9_-], or invalid format value
402insufficient_quotaNot enough credits
403forbiddenFree plan requesting srt/csv/docx/markdown; OR video unavailable, age-restricted, geo-blocked, or live-stream offline
404not_foundVideo has no captions in any reachable language

Global 401, 429, and 5xx also apply. See Errors.

We use Google Analytics cookies and note which site referred you, so we know how people find us. Nothing personal, nothing sold. See our Privacy Policy.