YouTubeVideos
Get a YouTube video's transcript
Return the transcript text for a YouTube video, by video ID, as ordered timestamped segments plus a concatenated plain-text field. Picks the caption track for the requested `lang` (default English, then the first available track), fetches its timed-text and parses it server-side. Returns 404 when the video has no captions.
Pricing — $ · min $0.001
Billed per record at 1 credit ($0.001) each, with a 1-credit ($0.001) minimum per call.
Authorization
bearerAuth AuthorizationBearer <token>
UnifAPI API key. Provider credentials are managed by UnifAPI.
In: header
Path Parameters
video_id*string
Query Parameters
lang?string
Caption language code to transcribe, e.g. en or es. Defaults to English.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/youtube/videos/string/transcript"{ "request_id": "string", "data": { "video_id": "string", "language_code": "string", "language_name": "string", "available_languages": [ { "language_code": "string", "language_name": "string" } ], "segments": [ { "start": 0, "dur": 0, "text": "string" } ], "text": "string" }, "billing": { "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}{ "error": { "type": "validation_error", "message": "string", "request_id": "string", "issues": [ null ], "billing": { "credits_required": 0, "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true } }}