Social Media
YouTube Transcript
Fetch a video's transcript as plain text, or as timed SRT subtitles with start and end times — one synchronous call, as JSON.
POST/api/v1/youtube/transcript
Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your Scavio API key (e.g. Bearer sk_live_your_key).
Body
application/jsonvideo_idstringrequiredThe YouTube video id (11 characters).
Example: n61ULEU7CO0
languagestringdefault:enCaption language code to fetch (e.g. en, es, fr).
formatenum<string>default:textOutput format: text for a plain transcript, srt for timed subtitles.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
results = client.youtube.transcript(video_id="n61ULEU7CO0", format="srt")
print(results)Response
"video_id": "n61ULEU7CO0",
"language_code": "en",
"language_name": "English",
"format": "txt",
"content": "Welcome back to the channel. Today we are going to walk through building a retrieval pipeline from scratch..."
},
"response_time": 1633,
"credits_used": 8,
"credits_remaining": 4747
}