Translation API
Translate subtitles from source to target language.
Endpoint
POST /v1/translate
Authentication
API Key (Bearer token)
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| mediaUrl | string | Conditional | URL of media file (if transcription needed). Supports HTTP/HTTPS URLs (max 3500 MB) or URLs from the upload mechanism. Can also be an SRT file URL. |
| srtUrl | string | Conditional | URL of existing SRT file (HTTP/HTTPS or URL from the upload mechanism) |
| srtContent | string | Conditional | Inline SRT content |
| sourceLanguage | string | Yes | Source language code. See Supported Languages for available options. |
| targetLanguage | string | Yes | Target language code. See Supported Languages for available options. |
Note: Either mediaUrl or srtUrl or srtContent must be provided. If mediaUrl points to an SRT file or srtUrl / srtContent specified, transcription is skipped.
Response
json
{
"jobId": "job_abc123",
"status": "pending",
"message": "Translation job started successfully"
}Code Examples
cURL
bash
curl -X POST https://api.rednerapp.com/v1/translate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"srtUrl": "https://example.com/subtitles.srt",
"sourceLanguage": "en-US",
"targetLanguage": "es-ES"
}'Python
python
import requests
url = "https://api.rednerapp.com/v1/translate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"srtUrl": "https://example.com/subtitles.srt",
"sourceLanguage": "en-US",
"targetLanguage": "es-ES"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())JavaScript
javascript
const response = await fetch('https://api.rednerapp.com/v1/translate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
srtUrl: 'https://example.com/subtitles.srt',
sourceLanguage: 'en-US',
targetLanguage: 'es-ES'
})
});
const data = await response.json();
console.log(data);Java
java
HttpClient client = HttpClient.newHttpClient();
String json = "{\"srtUrl\":\"https://example.com/subtitles.srt\"," +
"\"sourceLanguage\":\"en\"," +
"\"targetLanguage\":\"es\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.rednerapp.com/v1/translate"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());Media URLs
The mediaUrl and srtUrl parameters accept:
- HTTP/HTTPS URLs: Direct links to media or SRT files (max 3500 MB)
- URLs via the upload mechanism
- Supported formats for mediaUrl: mp4, mp3, wav, m4a, webm, ogg, flac, amr, srt
- Supported formats for srtUrl: srt
See the Media URLs guide for detailed URL requirements.
Pricing
$0.00015 per word ($0.015 per 100 words, $0.15 per 1000 words)