Export Subtitles
Download subtitles in your preferred formats and track the real-time status of your transcription projects.
/api/v1/export/:projectIdcurl -X POST https://api.srtgen.com/api/v1/export/proj_8k2n9m1b \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"output": "srt"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Core Parameters | |||
id | String | Yes | The unique project identifier passed in URL path. |
output | String | No | Desired subtitle format or media asset for export. Options: srt, vtt, ass, txt, json, mp4 | Default: srt |
burnId | String | No | Explicitly request status/result of a specific burn job ID. |
language | String | No | Target language for the subtitles. Range: Any translated code or 'original' | Default: original |
| Multi-Language Support (New) | |||
languages | Array | No | Array of configurations to show multiple languages in the same file. Limit: Max 3 Languages | Default: ASS, VTT |
- language | String | Yes* | The code for this language slot (e.g., 'zh' or 'original'). |
- lineBreakRules | Object | No | Per-language segmentation overrides. |
- styleSettings | Object | No | Per-language styling (Primary for ASS). |
| Line Break Rules (lineBreakRules) | |||
lineBreakRules | Object | No | Nested object for subtitle segmentation logic. |
- maxChars | Number | No | Maximum characters allowed per line. Range: 5 - 100 | Default: 45 |
- maxWords | Number | No | Maximum words allowed per subtitle line. Range: 1 - 20 | Default: 10 |
- balanceLines | Boolean | No | Evens out line lengths in multi-line subtitles. Default: true |
- sentenceSplit | Boolean | No | Prefer breaking lines at the end of sentences. Default: true |
- gapThreshold | Number | No | Max gap (seconds) between words on a line. Range: 0.1 - 2.0 | Default: 0.4 |
| Style Basics (styleSettings) | |||
uppercase | Boolean | No | Force all transcription text to uppercase. |
styleSettings | Object | No | Nested object for visual styling (Active for ASS). |
- preset | String | No | Apply a built-in style preset as a base. Options: standard-stream, classic-apple, etc. |
- fontSize | Number | No | Font size as a ratio of video height. Default: 0.045 (approx 48px) |
- fontFamily | String | No | Standard font name used for rendering. Default: Arial |
- bold | Boolean | No | Apply bold weight to text. Range: true | false | Default: false |
- italic | Boolean | No | Apply italic style to text. Range: true | false | Default: false |
| Colors & Borders | |||
- primaryColor | Hex | No | Main text color hex code. Default: #FFFFFF |
- secondaryColor | Hex | No | Secondary color (used for karaoke effects). Default: #00FFFF |
- outlineColor | Hex | No | Color of the text outline. Default: #000000 |
- outline | Number | No | Outline thickness (Ratio of height). Default: 0.002 |
- shadow | Number | No | Shadow depth (Ratio of height). Default: 0.001 |
| Positioning (Ratios 0-1) | |||
- alignment | Number | No | ASS alignment code (1-9). Bottom-Center is 2. Range: 1 - 9 | Default: 2 |
- posX | Number | No | Horizontal position (0 = Left, 1 = Right). Range: 0.0 - 1.0 | Default: 0.5 |
- posY | Number | No | Vertical position (0 = Top, 1 = Bottom). Range: 0.0 - 1.0 | Default: 0.88 |
- marginV | Number | No | Vertical margin ratio from bottom/top. Range: 0.0 - 0.5 | Default: 0.056 |
| Animation & Effects | |||
- fadeIn | Number | No | Fade in duration in milliseconds. Range: 0ms - 5000ms | Default: 0 |
- fadeOut | Number | No | Fade out duration in milliseconds. Range: 0ms - 5000ms | Default: 0 |
- karaoke | String | No | Karaoke tag type (k, kf, ko, ks). Options: k, kf, ko, ks | Default: none |
curl -X POST https://api.srtgen.com/api/v1/export/proj_8k2n9m1b \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"output": "srt",
"language": "fr",
"lineBreakRules": {
"maxChars": 25,
"maxWords": 5,
"balanceLines": true
}
}'curl -X POST https://api.srtgen.com/api/v1/export/proj_8k2n9m1b \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"output": "ass",
"lineBreakRules": {
"maxChars": 30
},
"styleSettings": {
"preset": "standard-stream",
"fontSize": 55,
"primaryColor": "#FF0000",
"bold": true
}
}'curl -X POST https://api.srtgen.com/api/v1/export/proj_8k2n9m1b \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"output": "ass",
"languages": [
{
"language": "original",
"styleSettings": {
"preset": "classic-apple",
"fontSize": 40,
"posY": 0.85
}
},
{
"language": "zh",
"lineBreakRules": {
"maxChars": 16,
"balanceLines": false
},
"styleSettings": {
"preset": "standard-stream",
"fontSize": 55,
"posY": 0.7
}
}
]
}'Response Structure
1. Processing State
If the project is still being processed by our AI engine or pending, you'll receive a status update indicating its current state.
This allows you to implement simple polling on your frontend using the same endpoint until status is completed.
{ "projectId": "proj_abc123", "status": "processing", "message": "AI is generating..." }
2. Completed State
Once finalized, the response includes the subtitle content in your requested format.
Each format is optimized for its use-case:
{ "success": true, "projectId": "proj_abc123", "status": "completed", "format": "srt", "content": "1\\n00:00:01,000 --> 00:00:03,000\\nHello..." }
Error Codes
| Status | Error Code | Description |
|---|---|---|
| 400 | param_not_valid | A provided parameter is outside its allowed range. |
| 401 | unauthorized | API Key is missing or invalid. |
| 404 | not_found | Project ID does not exist. |
| 500 | export_error | An error occurred during formatting. |
| 500 | project_fetch_failed | Failed to retrieve project data. |
| 500 | server_error | Unexpected internal server error occurred. |
{ "success": false, "error": "unauthorized", "message": "The provided API key is invalid or has expired." }