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.

1

Create an Account

Sign up for a free account to get your API key. No credit card required.

Create account
2

Get Your API Key

Generate an API key from your dashboard. Your key will start with yt_.

Go to API Keys
3

Make Your First Request

Use your API key to fetch a transcript. Here is a quick example:

cURL
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/v1

Authenticate 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 TypeValue
Requests per minute500
Free tier monthly calls25

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:

GET/v1/transcripts/{video_id}
GET/v1/transcripts/{video_id}/languages
GET/v1/videos/{video_id}
GET/v1/videos/{video_id}/chapters
GET/v1/videos/{video_id}/comments
GET/v1/channels/{channel_id}
GET/v1/channels/{channel_id}/videos
GET/v1/search

What 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.

formatReturnsBest for
jsonA 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
textThe whole transcript as one string in the text fieldSummaries, embeddings, prompts and full-text indexing
srtSRT subtitles (numbered cues with HH:MM:SS,mmm timings) in the text fieldVideo 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
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:

StatusWhat to do
400 / 401 / 404Do 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.
402insufficient_credits: top up before retrying. A key that keeps retrying (20 refusals within 10 minutes) is paused with a 429.
429Wait 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).
503A 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-Remaining your balance after this call.
  • -X-Credits-Used what a comments call cost.
  • -X-RateLimit-Remaining requests 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