Skip to main content
GET
https://api.scriptbase.app
/
api
/
v1
/
transcript
/
{videoId}
curl "https://api.scriptbase.app/api/v1/transcript/dQw4w9WgXcQ?format=json" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videoId": "dQw4w9WgXcQ",
    "format": "json",
    "segments": [
      {
        "text": "We're no strangers to love",
        "offset": 0,
        "duration": 2500
      },
      {
        "text": "You know the rules and so do I",
        "offset": 2500,
        "duration": 3000
      }
    ]
  },
  "meta": {
    "creditsUsed": 2,
    "creditsRemaining": 998,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Overview

Extract the transcript (captions/subtitles) from a YouTube video. Supports multiple output formats including JSON with timestamps, plain text, SRT subtitles, and WebVTT.

Authentication

X-API-Key
string
required
Your API key

Path Parameters

videoId
string
required
YouTube video ID (11 characters)

Query Parameters

format
string
default:"json"
Output format: json, text, srt, or vtt
lang
string
default:"en"
Preferred language code for transcript (ISO 639-1)

Credits

  • Cost: 2 credits per request

Response

success
boolean
Whether the request was successful
data
object
meta
object
curl "https://api.scriptbase.app/api/v1/transcript/dQw4w9WgXcQ?format=json" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videoId": "dQw4w9WgXcQ",
    "format": "json",
    "segments": [
      {
        "text": "We're no strangers to love",
        "offset": 0,
        "duration": 2500
      },
      {
        "text": "You know the rules and so do I",
        "offset": 2500,
        "duration": 3000
      }
    ]
  },
  "meta": {
    "creditsUsed": 2,
    "creditsRemaining": 998,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Format Comparison

FormatUse CaseTimestampsOutput Field
jsonProgrammatic processing, analysisYes (offset/duration in ms)segments
textSimple text extraction, searchNotext
srtVideo subtitles, editing softwareYes (SRT format)content
vttWeb video players (HTML5)Yes (WebVTT format)content

Error Codes

StatusCodeDescription
400INVALID_INPUTInvalid video ID or format parameter
401INVALID_API_KEYAPI key is missing or invalid
404TRANSCRIPT_UNAVAILABLEVideo has no transcript/captions
429QUOTA_EXCEEDEDMonthly quota exhausted
429RATE_LIMIT_EXCEEDEDToo many requests
  • Not all videos have transcripts. Handle TRANSCRIPT_UNAVAILABLE errors gracefully.
  • Auto-generated transcripts may have lower accuracy than manual captions.
  • Language codes follow ISO 639-1 (e.g., ‘en’, ‘es’, ‘fr’, ‘de’).
  • Timestamps in JSON format are in milliseconds.