Extract YouTube subtitles
Submits POST /api/subtitles. Cache hits return
200. Cache misses return 202 with a
job_id and the UI auto-polls
/api/job/{job_id}.
curl -X POST /api/subtitles \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","language":"en","clean_for_ai":true}'
Result
Raw JSON
Frequently Asked Questions
What subtitle formats are supported?
Why is my request taking longer than expected?
What does "Clean for AI" do?
Is there a rate limit?
Can I use this API programmatically?
API Documentation
Endpoints
POST /api/subtitles— extract or enqueueGET /api/subtitles/{video_id}— read cache-
GET /api/job/{job_id}— poll async job status
Production
- 3-tier cache: memory → Redis → Postgres
-
Rate limiting with
429+Retry-After - Metrics:
/metrics
Deploy the backend separately. Deploy this frontend to Cloudflare
Pages and proxy /api/* via Pages Functions so browsers
never see backend secrets.
Supported Formats
YouTube to SRT
Download subtitles as SubRip (.srt) format, compatible with most video players and editing software.
YouTube to VTT
Export subtitles as WebVTT (.vtt) format, ideal for web video players and HTML5 video.
YouTube to TXT
Extract plain text transcripts, perfect for content analysis, AI training, and documentation.