YouTube API endpoint
Returns transcript segments for a YouTube video using YouTube's native player captions. Set `format=text`, `format=srt`, or `format=vtt` to receive plain-text output instead of the standard response envelope. Returns `404` when the video currently has no transcript/captions available in any language — this is a normal, non-retryable result, not an error condition. Returns `503` when the request is temporarily blocked or rate-limited; retrying after a short delay may succeed.
/youtube/transcript/{id}Uses YouTube's native player captions instead of the legacy transcript sidecar.
Query parameters:
lang: preferred transcript language, defaults to entranslate_to: optional target language code for YouTube translationformat: json, text, srt, or vtttimestamps: include timestamps in the JSON response, defaults to trueIf format is text, srt, or vtt, the endpoint returns text/plain instead of the standard JSON envelope.
Notable response behavior:
404 — the video currently has no transcript/captions available in any language. This is a normal result for videos without captions (e.g. never had them, or auto-captions were never generated), not a transient failure — retrying will not help.503 — the request was temporarily blocked or rate-limited upstream. This is a transient condition; retrying after a short delay may succeed.| Field | Filled in, of 520 checked | Values in the sample |
|---|---|---|
| text | 500 | |
| start | 500 | 0.4 to 2,346.39, median 1,076.77 |
| duration | 500 | 0.08 to 30.45, median 3.12 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id (path) | string | Yes | YouTube video ID (11-character code) | YbJOTdZBX1g | |
| lang | string | No | Preferred transcript language | ||
| translate_to | string | No | Translate transcript to this language code | ||
| format | string | No | Response format Allowed values: json, text, srt, vtt. | ||
| timestamps | boolean | No | Include timestamps in the JSON response | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/youtube/transcript/YbJOTdZBX1g?lang=en&format=json×tamps=true" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"video_id": "dQw4w9WgXcQ",
"language": "English",
"language_code": "en",
"segments": [
{
"text": "Never gonna give you up",
"start": 12.34,
"duration": 2.11
}
],
"text": "Never gonna give you up"
}
}Request schema
No body schema
Response schema
#/definitions/youtube.transcriptResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | youtube.TranscriptResponse | No | ||||
| data.is_generated | boolean | No | Whether the transcript is auto-generated rather than written by a person. | |||
| data.language | string | No | English | Language name of the transcript, such as `English`. | ||
| data.language_code | string | No | en | Language code of the transcript, such as `en`. | ||
| data.segments | array | No | Transcript split into timed segments. | |||
| data.segments[].duration | number | No | Length of the segment, in seconds. | |||
| data.segments[].start | number | No | Time the segment starts, in seconds from the start of the video. | |||
| data.segments[].text | string | No | Transcript text spoken in this segment. | |||
| data.text | string | No | Never gonna give you up | Full transcript as one block of text. | ||
| data.translation_language | string | No | es | Language code the transcript was translated into. Omitted when no translation was requested. | ||
| data.video_id | string | No | dQw4w9WgXcQ | YouTube video ID the transcript belongs to. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid parameters | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/youtube/transcript/YbJOTdZBX1g?lang=en&format=json×tamps=true" \
-H "x-api-key: $CRAWLORA_API_KEY"