Get Transcript
Extract a transcript for any public YouTube video. Optional timestamps and metadata.
The Get Transcript endpoint returns the full caption track for any public YouTube video as predictable JSON. Authenticate with Authorization: Bearer YOUR_API_KEY. Each successful 200 response charges 1 credit; 4xx errors, 5xx errors, and 429 rate-limits never debit. Cached responses (X-Cache-Status: HIT) return in 49ms median. The response always includes video_id, language, and a transcript array of { text, start, duration } segments.
GET/api/v2/youtube/transcript1 credit (only charged on HTTP 200)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| video_urlreq | string | — | Video ID, full youtube.com URL, or short youtu.be URL. |
| format | string | json | Either json (segments) or text (single string). |
| include_timestamp | boolean | true | Include start and duration on each segment. |
| send_metadata | boolean | false | Include video title, author, and thumbnail. |
Example request
bash
curl -X GET "https://youtubetranscriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ&format=json&include_timestamp=true&send_metadata=true" \
-H "Authorization: Bearer YOUR_API_KEY"Example response — JSON with timestamps and metadata
json
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [
{ "text": "Never gonna give you up", "start": 0.0, "duration": 4.12 },
{ "text": "Never gonna let you down", "start": 4.12, "duration": 3.85 }
],
"metadata": {
"title": "Rick Astley - Never Gonna Give You Up",
"author_name": "RickAstleyVEVO",
"author_url": "https://www.youtube.com/@RickAstley",
"thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
}
}Example response — JSON without timestamps
json
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [
{ "text": "Never gonna give you up" },
{ "text": "Never gonna let you down" }
]
}Example response — Plain text
When format=text, the transcript is returned as a single string. With include_timestamp=true, segments are prefixed with [start_s].
json
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": "[0.0s] Never gonna give you up\n[4.12s] Never gonna let you down"
}Edge cases
- 404 — video has no captions, is private, or has been removed.
- 422 — the
video_urldidn't resolve to a valid video ID. - 408 / 503 — transient upstream error; safe to retry after 1–5s.