Getting Started
Learn how to integrate the YouTube Transcript API into your application.
Quick Start
Get up and running in less than 5 minutes with these simple steps.
Create an Account
Sign up for a free account to get your API key. No credit card required.
Create accountGet Your API Key
Generate an API key from your dashboard. Your key will start with yt_.
Make Your First Request
Use your API key to fetch a transcript. Here is a quick example:
curl -X GET "https://api.fetchtranscript.com/v1/transcripts/dQw4w9WgXcQ" \
-H "Authorization: Bearer yt_your_api_key"Base URL
All API requests should be made to the following base URL:
https://api.fetchtranscript.com/v1Authenticate every request with your API key, sent in one of two headers: X-API-Key: yt_... or Authorization: Bearer yt_.... Keep the key on your server: anyone who has it can spend your credits.
Rate Limits
To ensure fair usage and maintain service quality, the API has the following rate limits:
| Limit Type | Value |
|---|---|
| Requests per minute | 500 |
| Free tier monthly calls | 25 |
Pricing
Simple pay-as-you-go pricing with no monthly commitments:
Free Tier
25 calls/month
No credit card required
Pay As You Go
$1 / 1,000 calls
Only successful calls are billed
Available Endpoints
The API provides the following endpoints:
/v1/transcripts/{video_id}Get the transcript for a YouTube video/v1/transcripts/{video_id}/languagesList available transcript languages/v1/videos/{video_id}Get video metadata (title, views, etc.)/v1/videos/{video_id}/chaptersGet video chapters/timestamps/v1/videos/{video_id}/commentsGet video comments/v1/channels/{channel_id}Get channel metadata/v1/channels/{channel_id}/videosList videos from a channel/v1/searchSearch YouTube videosWhat You Can Build
One API key and one credit balance cover every endpoint. Each line links to a guide with use cases and to the matching section of the API reference.
- -Transcripts and subtitles. Fetch the captions of a public video with timestamps, as plain text or as an SRT file, in any language the video offers. Guide · API reference
- -Video metadata and chapters. Get the title, description, duration, view, like and comment counts, tags and the chapter list of a video. Guide · API reference
- -Comments. Read up to 500 top-level comments per call, sorted by top or newest, for sentiment analysis or audience research. Guide · API reference
- -Channels. Resolve a channel ID or @handle to its details and list its videos in pages of up to 100, with or without Shorts. Guide · API reference
- -Search. Find up to 50 videos per query by keyword, then pass their IDs to the transcript endpoint. Guide · API reference
Choosing a Format
The transcript endpoint takes a format query parameter with three values. Pick the one that matches what your code does next.
| format | Returns | Best for |
|---|---|---|
json | A segments array: each segment has text, start and duration in seconds (default) | Searching inside a video, linking to timestamps, splitting long videos into chunks for an LLM |
text | The whole transcript as one string in the text field | Summaries, embeddings, prompts and full-text indexing |
srt | SRT subtitles (numbered cues with HH:MM:SS,mmm timings) in the text field | Video players, editors and subtitle workflows |
Every format comes back in the same JSON envelope with video_id, language (the code of the track you got), is_generated and video metadata such as title, author and duration. A call costs 1 credit whatever the format.
curl "https://api.fetchtranscript.com/v1/transcripts/dQw4w9WgXcQ?lang=en&format=text" \
-H "X-API-Key: yt_your_api_key"Choosing a Language
Pass lang with a language code such as en, es or de. To see which tracks a video has, call /v1/transcripts/{video_id}/languages (1 credit): it returns each track's language_code, language name, is_generated and is_translatable.
- -If you omit lang, the API returns the first available track and tells you which one in the language field of the response.
- -is_generated: true means the captions were made by YouTube's automatic speech recognition; false means the creator uploaded them, and they are usually more accurate.
- -If the video has no track in the language you ask for, the API answers 404 no_transcript_found and the call costs nothing.
Handling Errors and Retries
Errors come back as JSON with an error code and a human-readable message. Whether to retry depends on the status:
| Status | What to do |
|---|---|
400 / 401 / 404 | Do not retry: the video ID is malformed, the API key is missing or invalid, or the video, channel or transcript does not exist (video_not_found, transcripts_disabled, no_transcript_found, comments_disabled). The same request will fail again. |
402 | insufficient_credits: top up before retrying. A key that keeps retrying (20 refusals within 10 minutes) is paused with a 429. |
429 | Wait the number of seconds in the Retry-After header, then retry. It is sent when you exceed 500 requests per minute and when a key with no credits is paused (60 seconds, then 300, then 900; a top-up lifts the pause within seconds). |
503 | A temporary problem reaching YouTube: retry with exponential backoff, for example after 1, 2 and 4 seconds. |
Failed calls (any 4xx or 5xx) cost 0 credits, so retrying never charges you for the failures. Full error reference
Credits and Response Headers
Every successful call costs 1 credit, and so does each page of up to 100 channel videos. Comments cost 1 credit per 100 comments returned, rounded up (minimum 1). The response headers tell you where you stand:
- -
X-Credits-Remainingyour balance after this call. - -
X-Credits-Usedwhat a comments call cost. - -
X-RateLimit-Remainingrequests left in the current minute, alongside X-RateLimit-Limit and X-RateLimit-Reset.
You get 25 free calls every month; after that it is $1 per 1,000 calls. Purchased credits never expire and there is no subscription. See pricing
Next Steps
Official SDKs
Type-safe clients for Python and TypeScript
MCP Server
Connect to Claude, Cursor, and Claude Code
Authentication
Learn how to authenticate your API requests
Code Examples
See examples in cURL, Python, and JavaScript
Error Handling
Every error code, with example responses
Free Transcript Generator
Try any video in the browser, no API key needed