Skip to main content

Path Parameters

video_id
string
required
The YouTube video id (e.g. dQw4w9WgXcQ).

Query Parameters

lang
string
Preferred transcript language code (e.g. en, de). Falls back to the default available track.
type
string
Track type preference: manual (human-authored) or asr (auto-generated).

Response

video_id
string
The video the transcript belongs to.
language
string
Language code of the returned transcript (nullable).
language_name
string
Human-readable language name (nullable).
type
string
Track type: manual or asr (auto-generated) (nullable).
is_translatable
boolean
Whether the track can be machine-translated (nullable).
available_transcripts
array
Other available transcript tracks (with language metadata).
translation_languages
array
Languages the transcript can be translated into.
segments
array
Timed transcript lines.
full_text
string
The entire transcript as a single plain-text string (nullable).
srt
string
The transcript formatted as a ready-to-use SubRip (.srt) file (nullable).
vtt
string
The transcript formatted as a ready-to-use WebVTT (.vtt) file (nullable).

Example Response

{
  "video_id": "dQw4w9WgXcQ",
  "language": "en",
  "language_name": "English",
  "type": "manual",
  "is_translatable": true,
  "available_transcripts": [
    { "language": "en", "language_name": "English", "type": "manual" },
    { "language": "es", "language_name": "Spanish", "type": "asr" }
  ],
  "segments": [
    { "start_ms": 18000, "end_ms": 21000, "duration_ms": 3000, "start_time_text": "0:18", "text": "Never gonna give you up" },
    { "start_ms": 21000, "end_ms": 24000, "duration_ms": 3000, "start_time_text": "0:21", "text": "Never gonna let you down" }
  ],
  "full_text": "Never gonna give you up Never gonna let you down ...",
  "srt": "1\n00:00:18,000 --> 00:00:21,000\nNever gonna give you up\n\n2\n00:00:21,000 --> 00:00:24,000\nNever gonna let you down\n",
  "vtt": "WEBVTT\n\n00:00:18.000 --> 00:00:21.000\nNever gonna give you up\n\n00:00:21.000 --> 00:00:24.000\nNever gonna let you down\n"
}

Available Caption Tracks

To list the caption tracks for a video without downloading the full transcript, call:
curl "https://scrapebadger.com/v1/youtube/videos/dQw4w9WgXcQ/captions" \
  -H "X-API-Key: YOUR_API_KEY"
This returns a CaptionsResponse with video_id, a tracks array (each with language, language_name, type, is_translatable, base_url), and translation_languages. The captions endpoint costs 2 credits.
A transcript request costs 5 credits; the /captions listing costs 2 credits. Failed requests are not charged.