Endpoint
Request body
YouTube video URL. Supported formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/shorts/VIDEO_ID
ISO 639-1 language codes for caption preference (e.g.,
["en", "es", "fr"]). The first available language will be used.Response
Response status:
"ok" on success, "error" on failureFull transcript text with timestamps in the format:Only present when
status is "ok".Normalized video URL
11-character YouTube video ID extracted from the URL
Video title (when available)
Language code of the returned transcript (e.g.,
"en", "es")Word count in the transcript
Extraction method used:
"yt-dlp" (fast) or "browser" (fallback)List of available caption languages when using browser fallback method
Error response
Whenstatus is "error":
Error code (e.g.,
404 for no captions available)Human-readable error description
Two-tier extraction approach
Fast path: yt-dlp
When yt-dlp is installed, the server uses it for fast, reliable caption extraction:- No browser needed
- Completes in 2-5 seconds
- Supports subtitle formats: JSON3, VTT, SRV3
- Auto-downloads and parses captions
Fallback: Browser intercept
If yt-dlp is not available, the server:- Launches a browser session
- Navigates to the video URL
- Mutes and plays the video
- Intercepts the caption network request (
/api/timedtext) - Parses the intercepted caption data
Language selection
Captions are requested in the order specified in thelanguages array. The first available language is returned.
ISO 639-1 codes: Use standard two-letter codes (en, es, fr, de, ja, etc.) or extended codes with region (en-US, pt-BR).
If the requested language is unavailable, the endpoint returns an error with available languages listed.
Error codes
| Code | Message | Cause |
|---|---|---|
400 | Could not extract YouTube video ID from URL | Invalid or malformed URL |
400 | Blocked URL scheme | Non-HTTP/HTTPS protocol |
404 | No captions available for this video | Video has no captions/subtitles |
404 | No captions loaded during playback | Browser fallback failed (ad blocked playback) |
404 | Caption data intercepted but could not be parsed | Unknown caption format |
500 | Internal server error | Unexpected failure |
Examples
Basic request
Multi-language request
Error response (no captions)
Error response (invalid URL)
Use cases
- Analyze video content without watching
- Generate summaries or key insights from video transcripts
- Index video content for search
- Accessibility: convert video content to text
- Multi-language content analysis
- Research and data extraction from educational videos
Performance
| Method | Typical Duration | Notes |
|---|---|---|
| yt-dlp | 2-5 seconds | Recommended for production |
| Browser fallback | 10-20 seconds | Can fail if YouTube shows ads |
Limitations
- Videos without captions will return a 404 error
- Private or age-restricted videos may fail
- Browser fallback can be interrupted by YouTube ads or anti-bot measures
- The endpoint does not bypass YouTube’s Terms of Service - use responsibly