Repackage
API

GET /transcript

Fetch metadata and timestamped transcript segments for a YouTube video.

Returns full metadata, the joined transcript text, and timestamped segments.

GET https://api.repackage.app/transcript

Query parameters

NameTypeRequiredDescription
idstringone of id / url11-character YouTube video ID.
urlstringone of id / urlAny YouTube URL form (watch?v=, youtu.be/, embed, shorts, live).

Headers

NameRequiredDescription
AuthorizationrecommendedBearer rpk_.... Anonymous calls work but are tightly rate-limited and counted by IP.

Example

curl "https://api.repackage.app/transcript?id=dQw4w9WgXcQ" \
  -H "Authorization: Bearer rpk_your_key_here"
const res = await fetch(
  `https://api.repackage.app/transcript?id=${videoId}`,
  { headers: { Authorization: `Bearer ${process.env.REPACKAGE_API_KEY}` } },
)
const data = await res.json()

Response

200 OK

{
  "metadata": {
    "id": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up",
    "description": "...",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "channelName": "Rick Astley",
    "uploadDate": "2009-10-25T00:00:00Z",
    "duration": 213,
    "viewCount": 1000000000,
    "likeCount": 16000000,
    "tags": [],
    "thumbnail": "https://...",
    "language": "en"
  },
  "transcript": {
    "en": [
      { "start": 18.32, "duration": 5.6, "text": "We're no strangers to love" }
    ]
  },
  "source": "innertube",
  "cached": true
}

Field reference

FieldTypeDescription
metadata.idstringThe resolved video ID.
metadata.titlestringVideo title.
metadata.durationnumberLength in seconds.
metadata.languagestring | nullDetected language code.
transcriptobjectKeyed by language code; each value is an array of segments.
transcript[lang][n].startnumberSegment start in seconds.
transcript[lang][n].durationnumberSegment duration in seconds.
transcript[lang][n].textstringSpoken text for this segment.
source'innertube' | 'ytdlp'Which backend produced the transcript.
cachedbooleantrue if served from cache (doesn't consume quota).

Errors

See Errors. Most common:

  • 400 invalid_video_idid and url were both missing or unparseable.
  • 404 video_not_found — Video doesn't exist.
  • 422 transcript_unavailable — Video exists but has no transcript.
  • 429 rate_limited — Too many requests in the current window.
  • 502 upstream_failure — Retry with backoff.

On this page