Video Transcript
GET/v1/youtube/video/transcript1 credit
Returns a video's transcript from its caption track: timed segments, the full text as one string, the track's language and the list of available caption tracks.
01Query parameters
| Name | Type | Description |
|---|---|---|
| urlrequired | string | YouTube video URL: a watch, youtu.be, Shorts, live or embed link. |
| languageoptional | string | Language code of the caption track (e.g. `en`, `es`). Without it, English is used, preferring the auto-generated track. |
| cache_max_ageoptional | string | Accepted for compatibility; every call is fetched fresh, so the value does not change the answer.Accepted values:1d3d7d14d30d |
02Pricing
1 credit when a transcript is returned; 0 credits when the video has no caption track in the requested language.
03Request
curl "https://api.scrapesocial.ai/v1/youtube/video/transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ" \ -H "x-api-key: $SCRAPESOCIAL_KEY"
04Responses
Real answers from the API. Lists are shortened to 2 items.
GET /v1/youtube/video/transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ
{
"success": true,
"credits_remaining": 4980,
"credits_charged": 1,
"type": "video",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"transcript": [
{
"text": "[Music]",
"startMs": "320",
"endMs": "14580",
"startTimeText": "0:00"
},
{
"text": "We're no strangers to",
"startMs": "18800",
"endMs": "25960",
"startTimeText": "0:18"
}
],
"transcript_only_text": " [Music] \n We're no strangers to \n love. You know the rules and so do \n I. I feel commitments from what I'm \n thinking \n of. You wouldn't get this from any other \n guy. I just want to tell you how I'm \n feeling. Got to make you understand. \n Never going to give you up. I'm going to \n let you down. I'm going to run around \n and desert you. I'm g…",
"language": "English",
"videoId": "dQw4w9WgXcQ",
"captionTracks": [
{
"baseUrl": "https://www.youtube.com/api/timedtext?v=dQw4w9WgXcQ&ei=Njfeasj0HYX_6LUP7JjxiQw&caps=asr&opi=112496729&xoaf=5&xowf=1&hl=en&ip=0.0.0.0&ipbits=0&expire=1792973222&sparams=ip,ipbits,expire,v,ei,caps,opi,xoaf&signature=B60BC17575C8DC4FEC9D59CAD2FD370CB7761D84.17DDA628EDFDB5719F35F9B6DA727B904ECAEFCF&key=yt8&lang=en",
"name": {
"simpleText": "English"
},
"vssId": ".en",
"languageCode": "en",
"isTranslatable": true,
"trackName": ""
},
{
"baseUrl": "https://www.youtube.com/api/timedtext?v=dQw4w9WgXcQ&ei=Njfeasj0HYX_6LUP7JjxiQw&caps=asr&opi=112496729&xoaf=5&xowf=1&hl=en&ip=0.0.0.0&ipbits=0&expire=1792973222&sparams=ip,ipbits,expire,v,ei,caps,opi,xoaf&signature=B60BC17575C8DC4FEC9D59CAD2FD370CB7761D84.17DDA628EDFDB5719F35F9B6DA727B904ECAEFCF&key=yt8&kind=asr&lang=en",
"name": {
"simpleText": "English (auto-generated)"
},
"vssId": "a.en",
"languageCode": "en",
"kind": "asr",
"isTranslatable": true,
"trackName": ""
}
]
}Common to every endpoint
Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.
GET /v1/cosmos/profile?handle=design
{
"success": false,
"message": "Invalid API key"
}05Notes
If the video has no caption track in the requested language, the call returns 200 with `transcript` and `language` null and still lists `captionTracks`, so you can pick another language. `startMs` and `endMs` are strings, and `language` is the track's name (e.g. `English`), not a code.
06Errors & credits
Every error has success: false, a real HTTP status and costs no credits.
400missing_parameter
A required parameter is missing or invalid.
403private_account
The account is private or age-restricted.
404not_found
No such account.
503upstream_error
The platform did not answer; retry shortly.