Extract Timestamped YouTube Video Transcript & Full RAG Text
GET/v1/youtube/transcript
Fetches full plain-text transcript (fullTranscriptText), word count, available subtitle languages, and millisecond-accurate timestamped segments (segments) for any YouTube video or Short. Cost: 10 Credits ($0.001) per video.
Query Parameters
video_idstringrequired11-character YouTube video ID (
dQw4w9WgXcQ) or full YouTube watch/Shorts URL (https://www.youtube.com/watch?v=dQw4w9WgXcQ). Also acceptsid,videoId, orurl.langstringPreferred ISO 639-1 language code (
en,es,de,fr,ja,zh-Hans, etc.). Defaults toenwith automatic fallback to the primary available track.include_segmentsbooleanSet to
falseto omit thesegmentsarray and return onlyfullTranscriptTextfor lightweight LLM context windows.
Example Request (cURL / Python / JavaScript)
curl "https://api.youtubeapi.io/v1/youtube/transcript?video_id=dQw4w9WgXcQ" \
-H "x-api-key: yt_live_your_api_key"Live Response Preview
{
"code": 0,
"provider": "https://youtubeapi.io",
"status": "ok",
"msg": "success",
"data": {
"videoId": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
"channelTitle": "Rick Astley",
"language": "en",
"languageLabel": "English",
"isAutoGenerated": false,
"isTranslatable": true,
"availableLanguages": [
{
"code": "en",
"name": "English",
"isAutoGenerated": false
},
{
"code": "es",
"name": "Spanish",
"isAutoGenerated": false
}
],
"segmentsCount": 8,
"totalDurationSec": 53.6,
"wordCount": 68,
"fullTranscriptText": "We're no strangers to love You know the rules and so do I A full commitment's what I'm thinking of You wouldn't get this from any other guy I just wanna tell you how I'm feeling Gotta make you understand Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye",
"segments": [
{
"text": "We're no strangers to love",
"startSec": 18.6,
"durationSec": 3.72,
"endSec": 22.32
},
{
"text": "You know the rules and so do I",
"startSec": 22.32,
"durationSec": 4.44,
"endSec": 26.76
}
]
},
"meta": {
"request_id": "9f8c2b10-6112-4a2b-9d1a-8f42ed904989",
"endpoint": "/v1/youtube/transcript",
"cached": true,
"source": "pg",
"items_count": 1,
"credits_charged": 10,
"latency_ms": 6
}
}Response Fields
Successful transcript response
| Field | Type | Sample / Notes |
|---|---|---|
code | integer | Example: 0 |
provider | string | Example: https://youtubeapi.io |
status | string | Example: ok |
msg | string | Example: success |
data | TranscriptData | |
videoId | string | 11-character YouTube video ID. |
url | string | Canonical YouTube watch URL. |
title | string | Video title. |
channelId | string | YouTube channel ID (UC...). |
channelTitle | string | Channel display name. |
language | string | Selected transcript language code (e.g. en). |
languageLabel | string | Human-readable language name (e.g. English). |
isAutoGenerated | boolean | True if auto-generated ASR track. |
isTranslatable | boolean | Whether YouTube supports auto-translation for this track. |
availableLanguages | array of object | |
code | string | |
name | string | |
isAutoGenerated | boolean | |
segmentsCount | integer | Total number of timed caption segments. |
totalDurationSec | number | Total duration covered by transcript in seconds. |
wordCount | integer | Word count of fullTranscriptText. |
fullTranscriptText | string | Concatenated plain-text transcript ready for LLM/RAG ingestion. |
segments | array of TranscriptSegment | |
text | string | Decoded plain-text caption segment. |
startSec | number | Segment start timestamp in seconds. |
durationSec | number | Segment duration in seconds. |
endSec | number | Segment end timestamp in seconds. |
meta | ResponseMeta | |
request_id | string | Unique UUID for tracing and support. |
endpoint | string | Canonical endpoint path. |
cached | boolean | True if served from L1 Redis or L2 PostgreSQL 16 asset sink. |
source | string | Data source tier (redis, pg, upstream_primary, upstream_fallback, oembed). |
items_count | integer | Number of records returned in data. |
credits_charged | integer | Credits deducted for this request ($1 = 10,000 Credits). |
has_more | boolean | Whether additional pages are available via next_cursor. |
next_cursor | stringnull | Continuation cursor for the next page. |
latency_ms | integer | End-to-end gateway latency in milliseconds. |
Status Codes
- 200
- Successful transcript response