GET
/
youtube
/
transcript
Node.js
import { Supadata } from '@supadata/js';

const supadata = new Supadata({
  apiKey: 'YOUR_API_KEY',
});
const transcript = await supadata.youtube.transcript({
  url: 'https://youtu.be/dQw4w9WgXcQ',
  lang: 'en',
  text: true,
});
console.log(transcript);
{
  "content": [
    {
      "text": "Never gonna give you up...",
      "offset": 8150,
      "duration": 1200,
      "lang": "en"
    }
  ],
  "lang": "en",
  "availableLangs": [
    "en",
    "es",
    "zh-TW"
  ]
}

Authorizations

x-api-key
string
header
required

Query Parameters

url
string<uri>

YouTube video URL. See supported URL formats.

Example:

"https://www.youtube.com/watch?v=dQw4w9WgXcQ"

videoId
string

YouTube video ID. Alternative to URL.

Example:

"dQw4w9WgXcQ"

text
boolean
default:false

When true, returns plain text transcript.

chunkSize
number

Maximum characters per transcript chunk (only when text=false)

Required range: 50 <= x <= 10000
Example:

1000

lang
string

Preferred language code of the transcript (ISO 639-1). If not provided, the first available language will be returned. If the requested language is unavailable, the API defaults to the first available language. See Languages.

Example:

"en"

Response

200
application/json

Successfully fetched transcript

The response is of type object.