GroundsocialDocs

API · YouTube

GET /youtube/videos/{id}/subtitles

A YouTube video’s captions as a subtitle file: srt, vtt, ttml, json3 or srv1.

RequestGET /v1/youtube/videos/{id}/subtitles
Operation idyoutube.video.subtitles
Cost2 credits, refunded if the call fails
AuthAPI key: Authorization: Bearer <key> or x-api-key.

A YouTube video’s captions as a subtitle file: srt, vtt, ttml, json3 or srv1.

Path parameters

NameTypeRequiredDescription
idstringyesA video or Short id, or any URL of it (watch, youtu.be, shorts, live, embed). Example: dQw4w9WgXcQ.

Query parameters

NameTypeRequiredDescription
format"srt" | "vtt" | "ttml" | "json3" | "srv1"nosrt (default), vtt, ttml, json3 or srv1. One of srt, vtt, ttml, json3, srv1.
languagestringnoISO 639-1 language code (en, es, pt-BR). Example: en.

Responses

StatusMeaningSchema
200The subtitle file.YouTubeSubtitles
400Invalid input. Nothing was charged.Error
401Missing or invalid API key.Error
402Not enough credits, a spend cap was reached, or payment is required.Error
403The target is private, or the account is suspended.Error
404The video, channel, playlist or post does not exist, was removed, or has nothing there.Error
429Too many requests. Wait for Retry-After seconds.Error
503YouTube is temporarily unavailable. Retryable; nothing was charged.Error

YouTubeSubtitles fields

FieldTypeDescription
kind"youtube#subtitles"
videoIdstring
languageCodestring
isAutoGeneratedboolean
isTranslatedboolean
format"srt" | "vtt" | "ttml" | "json3" | "srv1"
contentstringThe subtitle file, in format.
availableLanguagesYouTubeCaptionTrack[]

Errors use one shape everywhere; see Errors for every code and what to do.