YouTube Video Transcript API
A YouTube video transcript API takes the link or video ID of one video and returns its spoken words as timed JSON text. You call it once per video, and the answer is a list of segments you can store, search or turn into subtitles.
›Get the transcript of this YouTube video
└GET /v1/youtube/transcript?video=dQw4w9WgXcQ&format=json
✓200 OK · 1 transcript
{ "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)", "language_code": "en", "transcript": [ { "text": "[♪♪♪]", "start": 1.36 }, … ] }
●YouTube · real sample

G2
4.8 out of 5
Capterra
4.7 out of 5
Trustpilot
4.6 out of 5
YouTube video transcript API: more details
Product Hunt
4.9 out of 5
Google Reviews
4.8 out of 5
Apify Store
4.7 out of 5
AppSumo
4.8 out of 5
GetApp
4.7 out of 5
TrustRadius
4.6 out of 5
Software Advice
4.8 out of 5
SourceForge
4.7 out of 5
Chrome Web Store
4.6 out of 5
Gartner Peer Insights
4.8 out of 5
AlternativeTo
4.7 out of 5
RapidAPI
4.8 out of 5
Quick answer
- You send one video link or ID per request, and you get one transcript back.
- The text comes from the caption track of the video, so a video with no captions returns nothing.
- Each response is a list of text segments with start times.
- The API returns transcript text, not video metadata like views or upload date.
- Billing is per transcript.
Endpoint
YouTube video transcript API: what data can I extract with YouTube Transcript API?
In practice, one endpoint covers it: send a link, get the transcript back as JSON for 1 transcript per successful call.
Try it live
Try YouTube Transcript API live
In fact, check the input, press Run and read the response. Besides, without an API key you see a response captured from the API, and nothing is billed.
{
"video": "dQw4w9WgXcQ",
"format": "json"
}{
"video_id": "dQw4w9WgXcQ",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"author": "Rick Astley",
"channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"length_seconds": 213,
"is_live_content": false,
"language_code": "en",
"language_name": "English",
"is_generated": false,
"available_languages": [
{
"language_code": "en",
"name": "English",
"is_generated": false,
"is_translatable": true
},
{
"language_code": "en",
"name": "English (auto-generated)",
"is_generated": true,
"is_translatable": true
},
{
"language_code": "de-DE",
"name": "German (Germany)",
"is_generated": false,
"is_translatable": true
},
{
"language_code": "ja",
"name": "Japanese",
"is_generated": false,
"is_translatable": true
},
{
"language_code": "pt-BR",
"name": "Portuguese (Brazil)",
"is_generated": false,
"is_translatable": true
},
{
"language_code": "es-419",
"name": "Spanish (Latin America)",
"is_generated": false,
"is_translatable": true
}
],
"transcript": [
{
"text": "[♪♪♪]",
"start": 1.36,
"duration": 1.68
},
... 60 more segments
],
"cached": false
}| video_id | dQw4w9WgXcQ |
|---|---|
| video_url | https://www.youtube.com/watch?v=dQw4w9WgXcQ |
| title | Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) |
| author | Rick Astley |
| channel_id | UCuAXFkgsw1L7xaCfnd5JJOw |
| length_seconds | 213 |
| is_live_content | false |
| language_code | en |
| language_name | English |
| is_generated | false |
| available_languages | [{"language_code":"en","name":"English","is_generated":false,"is_translatable":true},{"language_code":"en","name":"English (auto-generated)","is_generated":true,"is_translatable":true},{"language_code":"de-DE","name":"Ge |
| transcript | [{"text":"[♪♪♪]","start":1.36,"duration":1.68},... 60 more segments] |
| cached | false |
YouTube video transcript API: more details
Input
YouTube video transcript API: Input
Of course, every call takes the same kind of input: your API key in a header and the link of the video.
Overall, you have a link or a video ID: pass it as is.
// GET /v1/youtube/transcript // header: X-API-Key: YOUR_API_KEY { "video": "dQw4w9WgXcQ", "format": "json" }
Overview
What is a YouTube video transcript API?
Think of Dev, who runs a small research team. Furthermore, each week his team reviews fifty interview videos for a client. In practice, today they watch every video at double speed and type notes by hand. He wants the text to arrive in a spreadsheet before anyone presses play.
Besides, this guide shows how to do that with one request per video. Likewise, it covers the ID, the response, subtitle files, metadata, Python code, limits and cost.
Ready to test? Get a free TranscriptAPI key and send one video link while you read.
Overall, a YouTube video transcript API is a web service that answers one question: what is said in this video? Also, you pass the video, and it returns the words in order with the time each piece starts.
In fact, searches for this topic use many phrases. Moreover, people type "youtube video to text api", "youtube video transcription service" and "youtube video speech to text api" when they mean the same thing. Of course, they want text from a video without doing the typing.
Furthermore, one detail matters here. In practice, the words "speech to text" suggest the service listens to the audio. Besides, a caption-based API does not.
Likewise, it reads the caption track that YouTube already stores. In fact, that track is either uploaded by the creator or made by YouTube from the audio as auto-captions.
Why one video at a time
Overall, most projects begin with a single video. Moreover, you check that the text is good enough, then you loop over a list. Of course, the same call works for both, so the code you write for one video becomes the core of a bulk job later.
How it works
YouTube video transcript API: how to extract a transcript from a YouTube video with the API
If you searched for "extract transcript from youtube video api", these are the steps. Furthermore, they are the same in every language.
v=. In a short link, it follows the last slash. It has 11 characters.Getting the video ID right
Wrong IDs are the most common first error. In practice, copy the ID from the address bar, not from the page title. Remove extra parts like playlist numbers or tracking text. If the link has &t= at the end, that is a start time, and you can drop it.
Besides, your code can do this for you with a small pattern match. Accept the full link or the bare ID, then pull out the 11 characters.
Output
YouTube video transcript API: what the response contains
In fact, the response is JSON with a list of segments. Also, each segment has the text and a start time in seconds. Moreover, that is all you need for most jobs. If you search for "youtube transcript json", this is the shape you are looking for.
In fact, start times make the text useful beyond reading. Furthermore, you can link to the exact second, build chapters, or cut clips. Besides, the transcript timestamps guide explains the values in detail.
Turning segments into plain text
In short, join the segments with a space to get one block of text. If the captions lack punctuation, sentences will run together. Also, a simple way to read them is to break the block into lines every few segments.
YouTube video transcript API: Turning segments into subtitle files
Of course, subtitle files are the other common goal. Moreover, people search "youtube video to srt" to get a file for an editor or a player. Furthermore, you can build one from the segments.
SRT lists numbered cues with a start and end time and a comma before the milliseconds. VTT starts with WEBVTT and uses a period.
In practice, the W3C WebVTT specification gives the full rules for VTT. Besides, the SRT, VTT and JSON formats guide on this site compares the two types.
Because each segment has a start time, the end time of one cue can be the start of the next. Likewise, that is enough for a clean file.
Output
Output
In short, the one thing to know: the response is plain JSON with the same field names on every successful call. Also, the sample below is a real response captured from the API.
// GET /v1/youtube/transcript?video=dQw4w9WgXcQ&format=json // real captured response · transcript list shortened to 1 of 61 segments { "video_id": "dQw4w9WgXcQ", "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)", "author": "Rick Astley", "channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw", "length_seconds": 213, "is_live_content": false, "language_code": "en", "language_name": "English", "is_generated": false, "available_languages": [ { "language_code": "en", "name": "English", "is_generated": false, "is_translatable": true }, { "language_code": "en", "name": "English (auto-generated)", "is_generated": true, "is_translatable": true }, { "language_code": "de-DE", "name": "German (Germany)", "is_generated": false, "is_translatable": true }, { "language_code": "ja", "name": "Japanese", "is_generated": false, "is_translatable": true }, { "language_code": "pt-BR", "name": "Portuguese (Brazil)", "is_generated": false, "is_translatable": true }, { "language_code": "es-419", "name": "Spanish (Latin America)", "is_generated": false, "is_translatable": true } ], "transcript": [ { "text": "[♪♪♪]", "start": 1.36, "duration": 1.68 }, ... 60 more segments ], "cached": false }
YouTube video transcript API: more details
Of course, a failed call returns {"error": {"code", "message"}, "request_id"} and bills 0 transcripts.
Field reference
| Field | Type | Description |
|---|---|---|
| video_id | string | ID of the video on the platform. |
| video_url | string | Canonical link of the video. |
| title | string | Title of the video. |
| author | string | Name or handle of the account that posted it. |
| channel_id | string | ID of the channel that owns the video. |
| length_seconds | number | Length of the video in seconds. |
| is_live_content | boolean | True if the video is a live broadcast. |
| language_code | string | Language code of the transcript. Null when the platform does not report one. |
| language_name | string | Language name of the transcript. Null when not reported. |
| is_generated | boolean | True if the text was generated automatically instead of written by hand. |
| available_languages | array | Other languages offered for this video. Empty when there is only one text. |
| transcript | array | Timed segments, each with text, start and duration in seconds. Empty when the platform gives plain text only. |
| cached | boolean | True if the result was served from cache. |
Errors
| Code | HTTP | Meaning |
|---|---|---|
| UNAUTHORIZED | 401 | Missing or invalid API key. |
| INVALID_INPUT | 400 | The link or ID is not valid for this platform. |
| NO_TRANSCRIPT | 404 | The video has no text to return. |
| UNAVAILABLE | 404 | The post is deleted, private or not found. |
| PLATFORM_UNAVAILABLE | 503 | The platform is not available right now. |
Guide
YouTube video transcript API: Captions, auto-captions and language
Overall, not every transcript is equal. Furthermore, a creator-made caption track is usually accurate. In practice, auto-captions can contain errors in names, numbers and technical terms, so read a sample before you trust them.
Of course, language depends on the available tracks. Also, some videos offer Multilingual subtitles, and some offer one language only.
In addition, the API returns what the video provides. Moreover, it does not translate. Of course, for another language, translate the text yourself after you fetch it.
When the video has no captions
Overall, no captions means no transcript from this API. In practice, you then need a speech-to-text engine that listens to audio. Open source models like Whisper do this on your own machine. Whisper is released under the MIT license and supports many languages, though accuracy varies.
TranscriptAPI does not run speech recognition. Besides, plan for a fallback if your videos often lack captions.
Guide
YouTube video transcript API: Metadata is a separate job
In practice, some people search for a "youtube video metadata api" and expect it inside the transcript response. It is not. Also, the transcript API returns text and timing. In addition, titles, view counts, channel names and dates come from another source.
Of course, for public metadata you can call the official YouTube Data API v3 with a key. Besides, quota applies, and Google lists default limits on its quota cost page. Likewise, a good pattern is to fetch metadata once and store it beside the transcript with the same video ID.
Guide
Using the API from Python
In practice, a youtube video transcript python script is short. Also, use the requests library to send a GET call with your key and the video ID. Moreover, read the answer with .json(), then loop over the segments.
In fact, people also search "youtube video transcript python" when they want a library to install. Furthermore, a Python SDK can hide the HTTP details, but you do not need one. Besides, the plain call works in a few lines, and it keeps your project free of extra dependencies.
YouTube video transcript API: a simple batch loop
In short, read your video IDs from a file. Also, for each ID, check whether you already stored a transcript. If not, call the API, save the result and wait a short moment before the next call.
If a call fails, record the ID and move on. In addition, run the failures again at the end.
Scale
Limits and rate limits
Overall, every API has Rate limits. When you send too many requests too fast, you get an HTTP 429 status. Slow down, wait, and try again with longer pauses. Of course, check your dashboard and the pricing page for the limits on your plan, because they can change.
In fact, other limits are about content:
- Private videos return nothing.
- Videos with no captions return nothing.
- Live streams may lack a final caption track until they end.
- Removed videos return an error.
YouTube video transcript API: Webhooks
In practice, a Webhook is a message a service sends to your URL when an event happens. Besides, this page does not describe Webhook support for TranscriptAPI. If you need push messages, check the docs. Likewise, a polling loop with a saved state works without one.
Pricing
What the API costs
Usage is measured in transcripts. In fact, pay As You Go costs $3.00 per 1,000 transcripts, Pro costs $20 per month, Ultra costs $50 per month and Max costs $200 per month. Usage is billed proportionally and never rounded up.
Of course, for Dev's team, fifty videos a week is about 200 videos a month. Furthermore, at the pay-as-you-go rate, that is a few cents, and the savings in typing time are far larger. In practice, see the pricing table for every plan.
If you want to download youtube video transcript text in bulk, cost scales in a straight line with the number of videos. Besides, that makes budgeting easy.
How it works
YouTube video transcript API: Common mistakes and how to fix them
Of course, most problems with a YouTube video transcript API come from a short list of causes. In fact, check these before you blame the service.
- Wrong ID. Also, the ID has 11 characters. In addition, a playlist link or a channel link will not work.
- Private or removed video. If you cannot watch it while signed out, the API cannot read it.
- No caption track. Open the video and look for the captions button. If it is missing, there is nothing to fetch.
- Rate limit hit. Moreover, a burst of calls can return HTTP 429. Of course, add a pause and retry later.
- Missing key. Furthermore, every request needs your API key from the dashboard.
When a call fails, log the video ID and the status code. In practice, those two facts solve most cases within a minute. Besides, a weekly report of failed IDs also tells you which videos need a different route, such as a speech engine.
Use cases
Practical uses for a YouTube video transcript API
In practice, the same call supports very different projects. Also, here are four that teams build.
Interview and research notes. Dev's team pulls the text of each interview and highlights quotes. In addition, they search across all fifty videos for a topic in seconds, then jump to the moment using the start time.
Content repurposing. Moreover, a marketer turns a webinar into a blog draft, a short summary and a list of quotes. Of course, the transcript is the raw material, and the timing keeps every quote traceable.
Accessibility and subtitles. Furthermore, a team without captions of its own can build a subtitle file from a transcript and check it before publishing. Always review auto-captions for names and numbers.
Monitoring. In practice, track what public channels say about a product. Besides, run the call on new uploads, store the text and search it for key terms.
Likewise, each use depends on the same steps: get the ID, call the API, store the segments. In fact, you can read more patterns in the use cases section.
Guide
Cleaning and storing the text
Of course, raw segments are short and often lack punctuation. Before you use them, join the pieces with a space and trim extra whitespace. If you plan to show the text to people, add line breaks every few sentences.
Overall, store the transcript next to the video ID, the fetch date and the language. Moreover, a small table with those four columns is enough. If you later change your cleaning rules, you can rebuild from the stored segments without calling the API again.
Of course, for search, split the text into chunks of a few hundred words and keep the start time of each chunk. Furthermore, for summaries, send one chunk at a time to your language model and join the results. In practice, this keeps each request small and avoids losing detail.
Guide
Choosing between a caption API and a speech engine
Overall, a caption API and a speech engine solve different problems. Likewise, a caption API reads text that exists. In fact, a speech engine creates text from sound.
When captions exist, the caption route is faster and cheaper. When they do not, only the speech route works.
Also, many teams use both. In addition, they call the caption API first, and send only the videos with no captions to a speech engine. Moreover, that keeps cost low and coverage high. If you are comparing tools, ask whether a service reads captions or listens to audio, because the answer changes the price and the delay.
Of course, the download youtube video transcript api pattern is simple. If you need transcripts for a few hundred videos a day, the caption route is usually enough. Furthermore, a youtube video transcript api used as a youtube video subtitle extractor will return text in seconds for each video that has captions. In practice, a youtube video caption api works the same way, but the label differs between tools.
If your project covers more than one site, the generic youtube transcript api guide explains the wider picture. When you want to download youtube video transcript API results into a database, keep the video ID as the key.
Related
Related searches, answered
Of course, here is how the other common searches map to this API.
Text and subtitles. Likewise, a youtube video subtitle extractor or a youtube video caption api gives you timed text from the caption track. In fact, a youtube video to text api does the same job and returns JSON.
Services and speech. Also, a youtube video transcription service might use captions or audio. In addition, a youtube video speech to text api usually listens to the audio, which costs more and takes longer. Moreover, a caption-based call is quicker when captions exist.
Downloads and code. If you want to download youtube video transcript data, call the REST endpoint and save the JSON. Of course, the same applies if you want to extract transcript from youtube video api results into a spreadsheet.
Metadata. Furthermore, a youtube video metadata api is a different service. Pair it with the transcript by video ID.
Formats. In practice, many people want youtube video to srt output, and you can build it from the segments. If you only need youtube transcript json, you are done after the call. Besides, the generic youtube transcript api page covers the wider topic.
Glossary
Key terms for this guide
| Term | What it means here |
|---|---|
| YouTube | The video platform where the captions live |
| Video ID | The 11 character code in a video link |
| Closed captions | Timed text of the speech in a video |
| SRT/VTT | The two common subtitle file types |
| Auto-captions | Captions YouTube creates from the audio |
| Speech-to-text engine | Software that turns audio into text |
| REST endpoint | One URL that handles one kind of request |
| Timestamps | Start times attached to each text segment |
| Multilingual subtitles | Caption tracks in more than one language |
| Python SDK | A code library for calling an API from Python |
| Webhook | A message sent to your URL when an event happens |
| Rate limits | Caps on how many requests you can send |
Summary
Final Word
Of course, a YouTube video transcript API turns one video into text with one call. In fact, it reads the captions that already exist, so it is fast and cheap, and it works best on public videos that have captions.
Overall, start with a single video. Create a free TranscriptAPI key, send the link, and read the JSON. Then add a loop and a cache. Compare plans on the pricing page and see the other service pages when you need a different platform.
FAQ
Frequently asked questions
What is a YouTube video transcript API?
Does it need a Google login?
Does it work on videos without captions?
Can I get video titles and view counts too?
Can I use it in Python?
requests library and read the answer with .json(). Your dashboard lists the endpoint and fields.How much does it cost?
How do I make an SRT file?
Ship transcription today, not next quarter.
In short, no waitlist, no sales call required to start. Besides, get a key, make your first call, see structured JSON back in seconds.
Get your free API key →