YouTube Transcript API
A YouTube transcript API returns the caption text of a public YouTube video as structured JSON, so your code can read the words without opening the video. You send a link or a video ID, and you get back short text segments with start times.
›Get the transcript of this YouTube video
└GET /v1/youtube/transcript?video=dQw4w9WgXcQ
✓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 · 61 segments

G2
4.8 out of 5
Capterra
4.7 out of 5
Trustpilot
4.6 out of 5
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
YouTube transcript API: more details
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
YouTube transcript API: more details
Quick answer
Picture Maya, a developer who builds a search tool for a company with 3,000 training videos. Also, her team wants to search what people say inside the videos, not just the titles. In addition, watching them all is out of the question, so she needs the text in a form her code can use.
Moreover, this guide explains how that works, what the data looks like, where it breaks, and how the official and unofficial routes compare. Of course, it also covers cost, rate limits and the extra steps you need after the transcript arrives.
Need it now? Get a free TranscriptAPI key and test one video link before you read the rest.
- A transcript API reads the caption track that already exists for a video. Furthermore, it does not listen to audio.
- Videos with no captions have no transcript to return, even if the creator speaks clearly.
- The official YouTube Data API v3 needs authorization tied to the video owner, so it rarely works for other people's videos.
- A managed service like TranscriptAPI uses an API key from your dashboard and does not ask you to connect a Google account.
- Billing is per transcript, which makes costs easy to predict.
Endpoint
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 short, check the input, press Run and read the response. Also, 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 transcript API: more details
Overview
What is a YouTube transcript API?
In fact, a YouTube transcript API is a web service that gives you the text of a video's captions through a plain request. Besides, you send the video link or ID, and the service answers with JSON. Likewise, each item in the answer holds a piece of text and the time where it starts.
Overall, the captions come from one of two places. Also, some creators upload their own caption file, which is usually the most accurate version. When there is no upload, YouTube often creates auto-generated captions from the audio. In addition, both kinds are stored as a caption track, and both can be read the same way.
Moreover, people use different names for the same job. Of course, you will see "youtube caption api", "youtube subtitle api" and "get youtube video transcript" in search results. Furthermore, they all point at one need: turn a video into text that a program can read.
YouTube transcript API: how it differs from downloading a video
In short, some tools download the video file and then try to convert the sound into text. Besides, that is a heavy job, and it needs a speech engine. Likewise, a transcript API skips that step. In fact, it reads the text that YouTube already holds, which is faster and much cheaper per video.
Also, the trade is simple. Moreover, you get speed and low cost, but you depend on the captions being there. If the video has none, the API has nothing to return.
How it works
How the YouTube transcript API works step by step
In practice, the flow has four steps, and each one is small. Furthermore, most developers finish a first working call in under an hour.
v= in a normal watch link.Overall, you do not connect a Google account at any point. Besides, the service holds the access it needs, and you only hold the API key from your dashboard.
A short Python example in words
In fact, in Python you would use the requests library to send a GET request with your key in a header and the video ID as a parameter. Then you call .json() on the response and loop over the segments. Also, the exact endpoint and parameter names are listed in your dashboard, so copy them from there instead of guessing.
In addition, this is also why people search for "youtube video transcript python" and "youtube-transcript-api python". Moreover, python is the common choice for data work, and the loop over segments takes only a few lines. Of course, a search for youtube-transcript-api python usually leads to an open-source library, while this guide covers a hosted REST route instead.
Input
Input
In practice, every call takes the same kind of input: your API key in a header and the link of the video.
Of course, 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" }
Compare
YouTube transcript API options compared
Overall, you have three realistic routes. Likewise, each one fits a different kind of project.
| Route | Needs | Strength | Weak spot |
|---|---|---|---|
| Official YouTube Data API v3 | OAuth 2.0 and video owner rights | Free tier, official | Cannot read most public videos |
| PyPI youtube-transcript-api library | Python and your own server | Free and open source | Often blocked on cloud servers |
| Managed API such as TranscriptAPI | API key | No server upkeep, per transcript billing | Costs money at scale |
YouTube transcript API: the official YouTube Data API v3
Google's captions download method requires authorization with specific scopes. In fact, it also states that the user must have permission to edit the video. Also, that means it is built for channel owners who manage their own captions, not for reading other people's public videos.
Moreover, quota is a second limit. Of course, the quota cost page lists a default of 10,000 units per day, and one captions list call costs 50 units. Furthermore, a single download call costs 200 units. In practice, at those prices, a few dozen downloads would use up a day.
The open-source library
Of course, the PyPI youtube-transcript-api library reads caption data straight from YouTube pages. Likewise, it is free and popular, and it is a good choice for small scripts on your own laptop. In fact, the problem shows up when you move to a cloud server. Also, requests from cloud IP ranges are often blocked, and the library can break when YouTube changes its pages.
If you search for "youtube transcript api python library", this is usually what you find. In addition, it works well until you need to run it every day without babysitting it.
A managed service
Of course, a managed service handles the access problem for you. Furthermore, you call one endpoint, and the provider deals with blocks, page changes and retries. In practice, you pay per transcript, and you do not run any servers.
Besides, that is the model TranscriptAPI follows. Likewise, it is a better fit when the job has to run on a schedule, or when more than one person depends on it.
Output
YouTube transcript API: what data you get back
Overall, each transcript is a list of segments. Also, a segment holds the text and the time where that text starts. In addition, that is enough to rebuild the full text, link to an exact moment, or build subtitles.
Of course, the transcript timestamps guide explains how start and duration values work. Furthermore, the SRT, VTT and JSON formats guide compares the output formats side by side.
Subtitle files
In short, many people want a subtitle file, not JSON. Besides, the two common types are SRT and VTT. SRT puts a comma before the milliseconds, while VTT starts with the word WEBVTT and uses a period. Likewise, the W3C WebVTT specification describes the VTT format in full.
Because you get timed segments, you can write either format in a few lines of code. In fact, that is why "youtube transcript downloader" and "youtube transcript extractor" tools often end with a download button for both.
Languages and captions
Overall, language depends on the caption tracks of the video. Moreover, a video can have one track or many. When a creator adds several languages, you can ask for the one you need. When there is only one track, that is what you get.
Multilingual transcripts therefore depend on the creator. Of course, the API does not translate text. If you need another language, run the text through a translation tool after you fetch it.
Output
YouTube transcript API: Output
Of course, the one thing to know: the response is plain JSON with the same field names on every successful call. In practice, 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 transcript API: more details
Overall, 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. |
Limits
Limits and edge cases to plan for
In short, every transcript API has limits, and it is better to know them before you build.
- Private content. Of course, private videos return nothing. Public videos work.
- No captions. Furthermore, some videos have none, especially very new uploads or videos with music only.
- Auto-generated errors. In practice, names, numbers and technical terms are often wrong in auto captions.
- Live streams. Besides, a stream in progress may not have a final caption track yet.
- Removed videos. Likewise, a deleted video returns an error.
In fact, the first two are the most common. Also, in a library of 3,000 videos, Maya would expect some share to have no captions at all. Moreover, her code needs a clear plan for those cases, such as logging them and moving on.
When there are no captions
If a video has no caption track, you have two options. Of course, you can skip it, or you can run the audio through a speech tool. Furthermore, open models such as the Whisper speech recognition model turn audio into text on your own hardware. In practice, it is released under the MIT license and supports many languages, with accuracy that varies by language.
Besides, that is a different job from reading captions. TranscriptAPI does not run speech recognition, so a video with no captions has no transcript from the API. Likewise, keep that in mind when you plan your pipeline.
Pricing
What the YouTube transcript API costs
In short, cost is simple here because usage is measured in transcripts. Also, 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. In addition, usage is billed proportionally and never rounded up.
Of course, the TranscriptAPI pricing table lists every plan. Furthermore, people who search for "youtube transcript api free" often want a no-cost option. In practice, you can create a free API key and test a link before you pay. Besides, for large jobs, the paid plans apply.
YouTube transcript API: Pricing questions people ask
Of course, a common search is "youtube transcript api pricing", and the honest answer depends on volume. In fact, at the pay-as-you-go rate, 1,000 transcripts cost $3.00. Also, a job with 3,000 videos would cost about $7.50 at that rate.
Moreover, compare that with the quota math for the official route. Of course, a few dozen caption downloads fit in one day, and only for videos you own. Furthermore, the two are not really alternatives, because they solve different problems.
Scale
Rate limits, retries and bulk jobs
In short, any API caps how many requests you can send in a period. Besides, this is called rate limiting, and the usual signal is an HTTP 429 status code. Likewise, developers often search for the youtube transcript api rate limit, and the number that applies to you depends on your plan.
Of course, a bulk youtube transcript api job needs a queue. Also, put the video IDs in a list, process a small batch at a time, and store each result as soon as it arrives. If a request fails, put the ID back with a retry count. After three failures, log it and move on.
Cache what you fetch
In short, transcripts of published videos rarely change. Moreover, store each result in your own database with the video ID as the key. Then a repeat request never touches the API, and you pay once per video.
Of course, check your dashboard and the pricing page for the limits that apply to your plan. Furthermore, this page does not list numbers, because they can change.
Use cases
YouTube transcript API: Practical uses
Overall, here are four ways teams use a YouTube transcript API once the text is in hand.
Search across a video library. Index the segments, and a search for a phrase can link to the exact second. Maya's tool does this for training videos.
Summaries and study notes. Feed the text to a language model and ask for key points. Besides, the timing lets you add links back to the source.
Subtitles and chapters. Likewise, turn the segments into SRT or VTT files, or group them into chapters by topic.
Research and monitoring. In fact, track what channels say about a product or a topic over time, without watching every upload.
Also, you can read more examples in the use cases section.
Workflow
Working with the transcript text
Overall, the raw text needs light cleanup before you use it. Moreover, auto-generated captions have no punctuation in many cases, so sentences run together. Joining segments with a space gives you readable text, and a punctuation model can add periods if you need them.
In fact, for a language model, split the text into chunks of a few hundred words. Furthermore, keep the start time of each chunk so you can point back to the video. Besides, for search, store each chunk with its video ID and time.
Webhooks and notifications
In short, a webhook is a message a service sends to your URL when something happens. Also, many platforms use them to announce finished jobs. Moreover, this page does not describe webhook support for TranscriptAPI, so if you need push notifications, check your dashboard and the docs. Of course, a simple loop that polls and stores results works without one.
Related
YouTube transcript API: Related searches, answered
In fact, people reach this topic with different words. Besides, here is what each common search means in practice.
Free options. Likewise, a youtube transcript api free option exists in two forms. In fact, the open-source Python package costs nothing but needs your own server, and TranscriptAPI lets you test a link on a free key. Also, a youtube transcript api python library works well for small local scripts.
Downloading and extracting. In addition, a youtube transcript downloader or a youtube transcript extractor is usually a web page for one video at a time. Moreover, an API does the same job for thousands of videos. Of course, the words youtube caption api and youtube subtitle api describe the same service from the side of the file type.
Getting text for a single video. If you only need to get youtube video transcript text once, copying it from the YouTube page is fine. Furthermore, for anything repeated, use code.
Volume, price and limits. In practice, a bulk youtube transcript api job needs a queue and a cache. Besides, the youtube transcript api pricing section above shows the per-transcript cost, and the youtube transcript api rate limit that applies to you is listed in your dashboard. Likewise, developers who read the Python library docs will also meet these limits.
Glossary
Key terms for this guide
| Term | What it means here |
|---|---|
| YouTube | The video platform from Google where the captions live |
| YouTube Data API v3 | The official API, with caption methods that need owner rights |
| The company behind YouTube and its OAuth system | |
| Closed Captions (CC) | Timed text of speech, which the API reads |
| SRT/VTT subtitle formats | The two common subtitle file types |
| Auto-generated captions | Captions YouTube makes from the audio |
| Python | A common language for calling the API |
| PyPI youtube-transcript-api library | The free open-source Python package |
| REST API | A web interface you call with HTTP requests |
| JSON | The structured format of the response |
| Whisper (OpenAI ASR) | An open speech model for audio with no captions |
| Rate limiting | Caps on how many requests you can send |
| OAuth 2.0 | The sign-in standard the official API uses |
| Webhooks | Messages sent to your URL when an event happens |
| Multilingual transcripts | Text in more than one language, when tracks exist |
| Timestamps | Start times that tie text to a moment |
Summary
Final Word
Overall, a YouTube transcript API gives your code the words of a video without the work of watching or recording it. Also, it reads existing captions, so it is fast and cheap, and it fails only where captions are missing.
In fact, your next step is small. Create a free TranscriptAPI key, send one video link, and check the JSON. If the output fits your project, add a queue and a cache and scale up from there. Moreover, compare plans on the pricing page when you are ready, and see the full list of transcript API pages for other platforms.
FAQ
Frequently asked questions
Does the YouTube transcript API need OAuth?
Does it work for any YouTube video?
Is there a free way to get a transcript?
Can I use it in Python?
requests library sends the call, and .json() reads the answer. Your dashboard lists the exact endpoint.How is it billed?
Can I get SRT or VTT files?
What happens when I hit a rate limit?
Ship transcription today, not next quarter.
Of course, no waitlist, no sales call required to start. Furthermore, get a key, make your first call, see structured JSON back in seconds.
Get your free API key →