Get Subtitles
GET /v1/videos/:id/subtitles
Retrieve subtitles for a video in JSON or SRT format.
Prerequisites
The video must be analyzed first. Returns 404 if no subtitles exist.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Video ID |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
format | string | No | json | Response format: json or srt |
Example (JSON)
curl "https://api.vidocu.ai/v1/videos/vid_.../subtitles?format=json" \
-H "Authorization: Bearer vdo_live_your_key_here"
Response 200 OK
{
"videoId": "vid_1708300000000_abc1234",
"language": "en",
"subtitles": [
{
"startTime": 0.5,
"endTime": 3.2,
"text": "Welcome to the product demo"
},
{
"startTime": 3.5,
"endTime": 6.8,
"text": "Today we'll walk through the new dashboard"
}
]
}
Subtitle object fields
| Field | Type | Description |
|---|---|---|
startTime | number | Start time in seconds |
endTime | number | End time in seconds |
text | string | Subtitle text |
Example (SRT)
curl "https://api.vidocu.ai/v1/videos/vid_.../subtitles?format=srt" \
-H "Authorization: Bearer vdo_live_your_key_here"
Response 200 OK (Content-Type: text/plain)
1
00:00:00,500 --> 00:00:03,200
Welcome to the product demo
2
00:00:03,500 --> 00:00:06,800
Today we'll walk through the new dashboard
Errors
| Status | Code | Cause |
|---|---|---|
| 400 | validation_error | Invalid format query parameter |
| 401 | authentication_error | Invalid or missing API key |
| 404 | not_found | Video not found, or no subtitles generated yet |