1. Platforms
  2. YouTube Scraper API
  3. YouTube video transcript API

YouTube video transcript API

The video's own captions: the language you ask for.

GET api.socialscrape.dev/v1/youtube/video/transcript

Cost
1 creditAI transcription is billed by the started minute after 2
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits

Or the original audio's, typed by the uploader or recognised by YouTube (source), with the languages on offer. A video without captions answers transcript_unavailable and costs nothing; AI transcription of YouTube audio is not available yet.

You send one of url or id.

Part of the YouTube Scraper API: 18 YouTube endpoints on one key.

Request

Send your key in the x-api-key header.

1curl -G "https://api.socialscrape.dev/v1/youtube/video/transcript" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode 'id=dQw4w9WgXcQ' \4  --data-urlencode 'language=de'

Parameters

NameTypeRequiredDescription
urlurlone ofVideo or Short URL (watch, youtu.be, shorts, live, embed).
idstringone of11-character video id. Also accepted as videoId, video_id.
languagestringLanguage code ("en", "es", "en-US"). Overrides the default track unless `original_audio` is set. Also accepted as lang.
original_audiobooleanOnly return captions in the video's original spoken language. Takes precedence over `language`.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are examples, not your data.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_e45a821caf0eddcb356f1b98",8  "data": {9    "object": "transcript",10    "platform": "youtube",11    "video_id": "dQw4w9WgXcQ",12    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",13    "language": "de-DE",14    "source": "captions",15    "duration_seconds": 213,16    "text": "Uns beiden ist die Liebe nicht fremd Du kennst die Regeln genau wie ich Für mich zählst nur du Das kriegst du sonst von keinem hier Ich will dir sagen, wie i...",17    "segments": [18      {19        "start": 18.64,20        "end": 21.880000000000003,21        "text": "Uns beiden ist die Liebe nicht fremd"22      },23      {24        "start": 22.64,25        "end": 26.96,26        "text": "Du kennst die Regeln genau wie ich"27      },28      {29        "start": 27.04,30        "end": 31.04,31        "text": "Für mich zählst nur du"32      }33    ],34    "available_languages": [35      "de-DE",36      "en",37      "es-419"38    ],39    "extra": {40      "language_name": "German (Germany)",41      "tracks": [42        {43          "auto": false,44          "code": "en",45          "name": "English"46        },47        {48          "auto": true,49          "code": "en",50          "name": "English (auto-generated)"51        },52        {53          "auto": false,54          "code": "de-DE",55          "name": "German (Germany)"56        }57      ]58    }59  },60  "cursor": null,61  "has_more": null62}

Fields

One Transcript in data.

A field the platform does not give is null, never made up. Extra platform details are in extra.

FieldTypeAlwaysNotes
object"transcript"
platformPlatformyes
video_idstring or null
urlstring or null
languagestring or nullBCP 47, "en"
source"captions" or "auto_captions" or "ai"yes
duration_secondsnumber or null
textstringyes
segmentsTranscriptSegment[] or null
available_languagesstring[] or null
extraobject or null

Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.

Questions

Which errors can it return?

invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry), transcript_unavailable (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.

Is there an SDK call for it?

The Python client has client.youtube.video_transcript(...) and the TypeScript client client.youtube.videoTranscript(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.

Can an AI agent call it?

Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.