Use this API endpoint to fetch text transcript from a video hosted on YouTube, TikTok, Instagram, X (Twitter) or a public file URL.
GET https://api.supadata.ai/v1/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 | URL of the video to get transcript from. Must be either YouTube, TikTok, Instagram, X (Twitter) or a public file URL. It is recommended to encode the URL before sending it as a query parameter. |
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) |
mode | string | No | Transcript mode: native (only fetch existing transcript), generate (always generate transcript using AI), or auto (try native, fallback to generate if unavailable). If url is a file URL, mode is always generate . Default: auto . |
mode=native
.text=true
:
text=false
:
Status | Description |
---|---|
queued | The job is in the queue waiting to be processed |
active | The job is currently being processed |
completed | The job has finished and results are available |
failed | The job failed due to an error |
url
parameter supports the following:
https://www.youtube.com/watch?v=1234567890
https://www.tiktok.com/@username/video/1234567890
https://x.com/username/status/1234567890
https://instagram.com/reel/1234567890/
https://bucket.s3.eu-north-1.amazonaws.com/file.mp4
url
is a file URL, the endpoint supports the following file formats:
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.
When mode = generate
, the lang
parameter is ignored and the transcript is generated in the language of the video.