YouTube captions API — fetch caption tracks over HTTP
Access YouTube auto-generated and manual captions through a stable HTTP API. Built for subtitle tools, search indexing, and LLM pipelines.
- Auto-generated and manual caption tracks
- Plain text or JSON output formats
- 1,000 free credits on signup
YouTube exposes captions as timed text tracks: manual subtitles uploaded by creators, or auto-generated speech recognition in many languages. A captions API wraps those tracks behind HTTP so your backend can fetch them without embedding a browser. FreeTranscriptAPI returns both track types when YouTube makes them available on a public video.
Manual vs auto-generated captions
Manual captions are usually higher quality: proper punctuation, speaker intent, and fewer homophone errors. Auto-generated tracks update quickly for livestreams and long uploads but can mis-hear names and jargon. Your application should treat caption type as metadata, not a guarantee of accuracy. The languages endpoint indicates whether a track was auto-generated so you can branch UI copy or fallback logic.
Some videos only have auto-generated English; others ship manual translations for dozens of locales. If you build multilingual search, list languages first, then fetch the best match per video rather than assuming en always exists.
Caption API endpoints
Use GET /transcript to retrieve caption text. Use GET /languages to discover tracks before spending credits on the wrong locale. Both accept the same video_url formats. Responses are JSON by default; plain text is one query parameter away when you only need a string for grep or token counting.
Building subtitle and search products
Subtitle editors need segment boundaries. The JSON transcript array maps directly to timeline rows: adjust start and duration when shifting cues, or merge short segments before export to SRT or VTT in your own formatter layer.
Search products benefit from captions because titles and descriptions miss spoken keywords. Ingest transcripts into your index with the video ID and language code stored alongside each document. Re-fetch when creators update captions; cache responses in your pipeline according to your freshness needs.
LLM and RAG pipelines
Models do not watch video; they read text. Captions are the cheapest path from a YouTube URL to tokens. Chunk by time or token count, embed segments, and retrieve relevant passages at question time. Timestamps let the UI link answers back to moments in the player. See transcripts for AI summarization for a full walkthrough.
Rate limits and costs
Anonymous traffic is capped at 20 requests per hour per IP so you can validate the API quickly. Authenticated calls consume one credit per transcript lookup, including cases where no captions exist, so your billing stays predictable. Signup grants 1,000 credits without a card.
Example request
curl "https://api.freetranscriptapi.com/v1/transcript?video_url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"Operational expectations
Caption availability depends on YouTube. Private, age-restricted, or region-blocked videos may return errors your app should surface clearly. The API documents standard HTTP status codes and error bodies in the reference. Use GET /health for uptime checks in your status page.
Anonymous callers get 20 requests per hour per IP without an API key.
More guides
Other topics on the same API: