Skip to content
youtubeapi.io
All endpoints

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_idstringrequired

    11-character YouTube video ID (dQw4w9WgXcQ) or full YouTube watch/Shorts URL (https://www.youtube.com/watch?v=dQw4w9WgXcQ). Also accepts id, videoId, or url.

  • langstring

    Preferred ISO 639-1 language code (en, es, de, fr, ja, zh-Hans, etc.). Defaults to en with automatic fallback to the primary available track.

  • include_segmentsboolean

    Set to false to omit the segments array and return only fullTranscriptText for 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

FieldTypeSample / Notes
codeintegerExample: 0
providerstringExample: https://youtubeapi.io
statusstringExample: ok
msgstringExample: success
dataTranscriptData
videoIdstring11-character YouTube video ID.
urlstringCanonical YouTube watch URL.
titlestringVideo title.
channelIdstringYouTube channel ID (UC...).
channelTitlestringChannel display name.
languagestringSelected transcript language code (e.g. en).
languageLabelstringHuman-readable language name (e.g. English).
isAutoGeneratedbooleanTrue if auto-generated ASR track.
isTranslatablebooleanWhether YouTube supports auto-translation for this track.
availableLanguagesarray of object
codestring
namestring
isAutoGeneratedboolean
segmentsCountintegerTotal number of timed caption segments.
totalDurationSecnumberTotal duration covered by transcript in seconds.
wordCountintegerWord count of fullTranscriptText.
fullTranscriptTextstringConcatenated plain-text transcript ready for LLM/RAG ingestion.
segmentsarray of TranscriptSegment
textstringDecoded plain-text caption segment.
startSecnumberSegment start timestamp in seconds.
durationSecnumberSegment duration in seconds.
endSecnumberSegment end timestamp in seconds.
metaResponseMeta
request_idstringUnique UUID for tracing and support.
endpointstringCanonical endpoint path.
cachedbooleanTrue if served from L1 Redis or L2 PostgreSQL 16 asset sink.
sourcestringData source tier (redis, pg, upstream_primary, upstream_fallback, oembed).
items_countintegerNumber of records returned in data.
credits_chargedintegerCredits deducted for this request ($1 = 10,000 Credits).
has_morebooleanWhether additional pages are available via next_cursor.
next_cursorstringnullContinuation cursor for the next page.
latency_msintegerEnd-to-end gateway latency in milliseconds.

Status Codes

200
Successful transcript response