post https://api.techspecsray.com/v1/translations/subtitles
Fetches or generates translated subtitles for a given content ID.
Overview
The Subtitles Translation API provides endpoints to fetch or generate translated subtitles for various types of audio or video content. It supports multiple languages and subtitle formats, making it suitable for applications like media players requiring multilingual subtitles.
Endpoint
POST /translations/subtitles
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
email | string | Yes | Email address of the user. |
key | string | Yes | Authentication key for API access. |
content_id | string | Yes | Unique identifier for the content. |
language | string | No | Target language for translation. If omitted, language of the original audio is assumed. |
format | string | No | Output format. Supported values: json (default) and srt . |
revised | boolean | No | Fetch exclusively revised subtitles. Default is false . |
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | Status of the request. Values: success , processing , or error . |
message | string | Detailed message about the response. |
language | string | Language of the returned captions. |
translated | boolean | Indicates if the subtitles are translations (true ) or language of the original audio (false ). |
revised | boolean | Specifies if the captions were revised or not. |
completion_percentage | float | Percentage of completed subtitles available. |
captions | object | Captions organized by index, including start_time , end_time , and text . |
Example Request
{
"email": "[email protected]",
"key": "your_api_key",
"content_id": "content123",
"language": "Spanish",
"format": "json",
"revised": false
}
Example Response
{
"status": "success",
"message": "Captions fetched successfully",
"language": "Spanish",
"translated": true,
"revised": false,
"completion_percentage": 100,
"captions": {
"1": {
"start_time": "00:00:01,000",
"end_time": "00:00:04,000",
"text": "Hola, ¿cómo estás?"
},
"2": {
"start_time": "00:00:05,000",
"end_time": "00:00:07,000",
"text": "Bienvenido a bordo."
}
}
}
Error Responses
Status Code | Error Message |
---|---|
400 | Invalid subtitle type or unsupported language. |
403 | Invalid key or unauthorized access. |
500 | Server error or translation process failure. |
504 | API request timed out. |
Extra notes:
- /n or /N present in the subtitles text means next line and should be rendered as such.