API Reference

YouTube Transcript

Extract the transcript (captions) from a YouTube video with timestamps. Supports auto-generated and manually created captions in multiple languages.

Use this to get what is said in a YouTube video as timed text segments. Useful for summarizing videos, searching inside them, and feeding them to an LLM.

3 credits per request.

Quick example

curl -G "https://api.webscraperapi.ai/v1/youtube_transcript" \
  -H "Authorization: Bearer $WEBSCRAPERAPI_API_KEY" \
  --data-urlencode "video_id=hHQlcnubuFI" \
  --data-urlencode "language=en" \
  --data-urlencode "output=json"

video_id takes a video ID or a full YouTube URL. Leave out language to get the first transcript available. is_generated tells you whether the captions were created automatically.

Full API reference

GET
/v1/youtube_transcript

Query Parameters

video_id*string

YouTube video ID or URL.

Length1 <= length
language?|

Preferred language code (e.g. 'en', 'es'). Defaults to first available.

output?|

Output format. Defaults to json.

timeout_ms?|

Request timeout in milliseconds.

Response Body

application/json

application/json

curl -X GET "https://api.webscraperapi.ai/v1/youtube_transcript?video_id=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}