GET/youtube/transcript/translate

Translate a YouTube video transcript

Translates a YouTube video transcript into the language specified by lang. Provide the video URL or ID, and optionally select plain-text output or set a chunk size for chunked output.

5 parameters
urlstringoptional
YouTube video URL in a supported format.
videoIdstringoptional
YouTube video ID. Use this as an alternative to `url`.
textbooleanoptional
Set to `true` to return the translated transcript as plain text. Defaults to `false` when omitted.
Default:false
chunkSizenumberoptional
Maximum characters per transcript chunk when `text` is `false`. Must be between 50 and 10000.
langstringrequired
Target translation language code in ISO 639-1 format.

5 status codes
200Returns the translated transcript content as text or chunks and the ISO 639-1 language code of the translation.
contentarray<object>required
langstringrequired
ISO 639-1 language code of translation
206Returns an error response indicating that the transcript is unavailable.
errorstringrequired
Error code identifying the type of error
Allowed:invalid-requestinternal-errorforbiddenunauthorizedupgrade-requiredtranscript-unavailablenot-foundlimit-exceeded
messagestringrequired
Human readable error message
detailsstringrequired
Detailed error description
documentationUrlstringoptional
URL to error documentation
400Returned when the request is invalid, including when `lang` is missing or `chunkSize` is outside its allowed range; the response includes an error code, message, and details.
errorstringrequired
Error code identifying the type of error
Allowed:invalid-requestinternal-errorforbiddenunauthorizedupgrade-requiredtranscript-unavailablenot-foundlimit-exceeded
messagestringrequired
Human readable error message
detailsstringrequired
Detailed error description
documentationUrlstringoptional
URL to error documentation
404Returned when the requested video cannot be found; the response includes an error code, message, and details.
errorstringrequired
Error code identifying the type of error
Allowed:invalid-requestinternal-errorforbiddenunauthorizedupgrade-requiredtranscript-unavailablenot-foundlimit-exceeded
messagestringrequired
Human readable error message
detailsstringrequired
Detailed error description
documentationUrlstringoptional
URL to error documentation
500Returned when an internal error occurs; the response includes an error code, message, and details.
errorstringrequired
Error code identifying the type of error
Allowed:invalid-requestinternal-errorforbiddenunauthorizedupgrade-requiredtranscript-unavailablenot-foundlimit-exceeded
messagestringrequired
Human readable error message
detailsstringrequired
Detailed error description
documentationUrlstringoptional
URL to error documentation

Error handling

A 400 is returned when the request is invalid; lang is required, url must be a URI when supplied, and chunkSize must be between 50 and 10000. A 404 is returned when the requested video cannot be found. A 500 is returned when an internal error occurs.