Use this API endpoint to fetch text transcript from a YouTube video in various formats and languages.
GET https://api.supadata.ai/v1/youtube/transcript
Each request requires an x-api-key
header with your API key available after signing up. Get your API key here.
Parameter | Type | Required | Description |
---|---|---|---|
url | string | Yes* | YouTube video URL. See Supported YouTube URL Formats. |
videoId | string | Yes* | YouTube video ID. Alternative to URL |
lang | string | No | Preferred language code of the transcript (ISO 639-1). See Languages. |
text | boolean | No | When true, returns plain text transcript. Default: false |
chunkSize | number | No | Maximum characters per transcript chunk (only when text=false) |
url
or videoId
must be provided
text=true
:
text=false
:
url
parameter supports various YouTube URL formats. See this page for more details.
lang
parameter is used to specify the preferred language of the transcript. If the video does not have a transcript in the preferred language, the endpoint will return a transcript in the first available language and a list of other available languages. It is then possible to make another request to get the transcript in your chosen fallback language.