YouTube Transcript API
Send a video URL and get its transcript back as JSON. Plain text for AI and search, timed segments for players, or a ready SRT or WebVTT file.
- 100 free credits
- No card needed
- No Google Cloud project or OAuth
curl "https://pipefetch.com/v1/youtube/transcript?video=jNQXAC9IVRw" \
-H "x-api-key: YOUR_API_KEY"const res = await fetch('https://pipefetch.com/v1/youtube/transcript?video=jNQXAC9IVRw', {
headers: { 'x-api-key': process.env.PIPEFETCH_API_KEY },
});
const { data, credits } = await res.json();import os, requests
res = requests.get(
"https://pipefetch.com/v1/youtube/transcript",
params={"video": "jNQXAC9IVRw"},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
)
data = res.json()["data"]What you get
- The full transcript as one text, with its word count
- Timed segments: start, duration and text
- The caption language, whether it is auto-generated, and every language the video offers
- Chapters, when the video has them
- The video title, channel, duration and publish date
{
"data": {
"videoId": "jNQXAC9IVRw",
"url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"title": "Me at the zoo",
"channel": {
"id": "UC4QobU6STFB0P71PMvOGN5A",
"name": "jawed",
"handle": "@jawed",
"url": "https://www.youtube.com/@jawed"
},
"publishedAt": "2005-04-23",
"durationSeconds": 19,
"language": "en",
"languageName": "English",
"isAutoGenerated": false,
"isPreferredLanguage": true,
"availableLanguages": [
{
"code": "en",
"name": "English",
"isAutoGenerated": false
},
{
"code": "de",
"name": "German",
"isAutoGenerated": false
}
],
"format": "text",
"text": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's …",
"wordCount": 39,
"segments": [
{
"start": 1.2,
"duration": 2.16,
"text": "All right, so here we are, in front of the elephants"
},
{
"start": 5.318,
"duration": 2.656,
"text": "the cool thing about these guys is that they have really..."
}
],
"chapters": [
{
"title": "Intro",
"startSeconds": 0,
"endSeconds": 5
},
{
"title": "The cool thing",
"startSeconds": 5,
"endSeconds": 17
}
]
},
"credits": {
"used": 1,
"remaining": 99
}
}One GET request
Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.
GET/v1/youtube/transcript
Costs 1 credit per request. Only requests that return data are charged.
Parameters
| Name | Type | Description |
|---|---|---|
videorequired |
string | Video URL or 11-character video id. Watch, youtu.be, Shorts, embed and live links all work. |
langoptional |
string | Preferred caption language code, such as en, es or pt-BR. Without it you get the video's original language. |
formatoptional |
string | What the text field holds: plain text, text with [0:12] timestamps, or a ready SRT or WebVTT file. One of: text, timestamped, srt, vtt. Default: text. |
segmentsoptional |
boolean | Include the list of timed segments (start, duration, text). Default: true. |
Good to know
- Uploaded captions are preferred over auto-generated ones. isAutoGenerated tells you which one you got.
- If the language you asked for does not exist, another one is returned and isPreferredLanguage is false.
- A video without captions answers 404 no_transcript and costs nothing.
What people build with it
Feed videos to an LLM
Summaries, question answering and retrieval over video content start with clean text. The plain format is made for that.
Search inside videos
Index the timed segments and link your users straight to the second where something is said.
Subtitles and repurposing
Take the SRT or WebVTT output into an editor, or turn a talk into an article.
Research across channels
Collect what a set of channels says about a topic and analyse it as text.
Buy credits once. Use them whenever.
This endpoint costs 1 credit per request, and a request that returns no data costs nothing. Move the slider to see what your volume costs.
One credit is one request that returns data. Requests that return nothing are free.
- $2.42 per 1,000 requests
- About $12.08 a month at this pace
- Lasts about 2.4 months at this pace
- Credits never expire
Questions and answers
Does it work for videos without captions?
No. The API returns the captions YouTube has for a video, uploaded or auto-generated. It does not run speech recognition. A video without captions answers 404 no_transcript and costs nothing.
Which languages can I get?
Any language the video has captions in. Pass lang to choose one; availableLanguages in the response lists what exists. Without lang you get the video's original language.
Why not use the official YouTube Data API for captions?
Its captions.download method only works for videos you own or manage, and it needs OAuth. It cannot fetch the captions of other people's public videos.
What does a transcript cost?
One request costs 1 credit. Credit packs start at $9 for 3,000 credits, never expire, and a request that returns no data is not charged. New accounts get 100 free credits without a card.
How fast is it?
Most requests answer in 3 to 8 seconds. Each request is fetched live from YouTube, not served from an old copy.
Step-by-step guides
How to get a YouTube transcript in Python
Three working ways, with code: a free library, yt-dlp and an HTTP API, and where each one stops working.
Read the guideHow to get a YouTube transcript in Node.js
The npm package route and the plain fetch route, with code, and why browsers and serverless functions need the second.
Read the guideYouTube API quota exceeded: what the error means and how to fix it
How Google counts quota today, why search runs out first, and seven ways to stay under the limit or get past it.
Read the guideHow to download YouTube subtitles as SRT or VTT
The yt-dlp command and a single HTTP request that returns a ready .srt or .vtt file, with code to save it.
Read the guide
More YouTube APIs
-
1 credit
YouTube Video API
Exact views, likes and comment count, description, tags, chapters and channel for one video.
GET /v1/youtube/video -
1 credit
YouTube Channel API
Subscribers, video count, description, keywords and avatar for a channel, from a handle, id or URL.
GET /v1/youtube/channel -
1 credit
YouTube Channel Videos API
The latest uploads of a channel, newest first, with views, duration and publish time.
GET /v1/youtube/channel/videos -
1 credit
YouTube Shorts API
The Shorts of a channel, newest first, with view counts and thumbnails.
GET /v1/youtube/channel/shorts -
1 credit
YouTube Search API
YouTube search results for a query, with the same sorting and filters the site offers.
GET /v1/youtube/search -
1 credit / 20
YouTube Comments API
Top or newest comments of a video with likes, reply counts, pinned and hearted flags.
GET /v1/youtube/comments
Make your first request in a minute
Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.