post https://api.techspecsray.com/v1/translations/announcement
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": "3519e082c04b263e854a864fe358f347e38ed1dcdf2f6a58368a43b3eef4ab71",
"language": "English",
"include_audio": "true"
}
Example Response
{
"status": "success",
"content_id": "3519e082c04b263e854a864fe358f347e38ed1dcdf2f6a58368a43b3eef4ab71",
"language": "English",
"title": "Welcome Aboard: Cathay Pacific Flight to Bangkok",
"content": "Ladies and gentlemen, a very good afternoon and a warm welcome on board this Cathay Pacific flight 701 to Bangkok. I'm the captain; my name is Cam Matner. Flying time to Bangkok is two hours and 30 minutes, and we are expecting mainly fine and smooth flying conditions. Having said that, could I still ask that any time you're seated, would you please leave your seatbelts loosely fastened?\n\nOur in-flight services manager looking after you in the cabin this afternoon is Christina, and she will shortly be showing you this aircraft's safety briefing. It does contain important information, so please give it your attention. We're just waiting for the last of the bags to be loaded before we get underway; we should have all the doors shut within the next five to ten minutes. So thanks very much for your patience, and please enjoy the flight.",
"male_audio_download_url": "http://content.techspecsray.com/air/3519e082c04b263e854a864fe358f347e38ed1dcdf2f6a58368a43b3eef4ab71_English_male.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=M7oaNTtSuMaoGu8Jipfo%2F20241212%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241212T194537Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=8a99c348a984246fa6b29dad96010af6cf937807208dec9598010215d6b152eb",
"female_audio_download_url": "http://content.techspecsray.com/air/3519e082c04b263e854a864fe358f347e38ed1dcdf2f6a58368a43b3eef4ab71_English_female.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=M7oaNTtSuMaoGu8Jipfo%2F20241212%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241212T194537Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=05d630f2919a5a9c26e9a2439d8003b42fe1af19ca5e0625664ed95b73d942c6"
}
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.