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/transcriptQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | one of id / url | 11-character YouTube video ID. |
url | string | one of id / url | Any YouTube URL form (watch?v=, youtu.be/, embed, shorts, live). |
Headers
| Name | Required | Description |
|---|---|---|
Authorization | recommended | Bearer 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
| Field | Type | Description |
|---|---|---|
metadata.id | string | The resolved video ID. |
metadata.title | string | Video title. |
metadata.duration | number | Length in seconds. |
metadata.language | string | null | Detected language code. |
transcript | object | Keyed by language code; each value is an array of segments. |
transcript[lang][n].start | number | Segment start in seconds. |
transcript[lang][n].duration | number | Segment duration in seconds. |
transcript[lang][n].text | string | Spoken text for this segment. |
source | 'innertube' | 'ytdlp' | Which backend produced the transcript. |
cached | boolean | true if served from cache (doesn't consume quota). |
Errors
See Errors. Most common:
400 invalid_video_id—idandurlwere 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.