YouTube Scraper
Get YouTube Transcript
Retrieves publicly available captions, subtitles, or transcripts from a YouTube video or Short. Returns both a timestamped transcript array with start/end times and a plain-text version in transcript_only_text. Supports specifying a language code. Videos of any length are supported when YouTube exposes public captions. This endpoint does not use AI transcription. If no matching caption track is available, the transcript fields return null.
Endpoint
Parameters
| Name | Type | Required | Note |
|---|---|---|---|
| urlstring · required | string | required | YouTube video or short URL |
| languagestring · optional | string | optional | Language code, ie 'en', 'es', 'fr' or 'en-US'. Overrides the default track selection unless original_audio=true. If omitted, prefers captions matching the original spoken language when YouTube identifies the original audio. If that metadata is unavailable or ambiguous, prefers an auto-generated caption, otherwise the first caption track. One of: |
| cache_max_agestring · optional | string | optional | See the Caching page for details. One of: |
| original_audioboolean · optional | boolean | optional | Set to true to return captions only in the original spoken language identified by YouTube. Takes precedence over language. Omit or set to false for the existing default selection. |
Response schema
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"url": {
"type": "string"
},
"type": {
"type": "string"
},
"videoId": {
"type": "string"
},
"language": {
"type": "string"
},
"transcript": {
"type": "array"
},
"transcript_only_text": {
"type": "string"
}
},
"additionalProperties": true
}