POST /translator/translate/srt

Translate SRT

Translate SRT subtitle files while preserving timing, sequence numbers, and formatting.

Translation API

Translate SRT (SubRip) subtitle files while preserving all timing information, sequence numbers, and formatting tags. Only the subtitle text is translated, ensuring perfect synchronization with the original media.

HTTP Request

1
POST /translator/translate/srt

Parameters

ParameterTypeRequiredDefaultDescription
sourcestringNo"auto"Source language code. Use auto for automatic detection
targetstringYesTarget language code

Request Body

Send the SRT content as the raw request body with Content-Type: text/plain.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
1
00:00:01,000 --> 00:00:04,000
Welcome to our tutorial on machine learning.

2
00:00:04,500 --> 00:00:08,000
Today we will cover the basics of neural networks.

3
00:00:08,500 --> 00:00:12,000
Let's start with understanding what a perceptron is.

Response

1
2
3
4
5
6
7
8
{
  "status": true,
  "data": {
    "translated_srt": "1\n00:00:01,000 --> 00:00:04,000\nBienvenido a nuestro tutorial sobre aprendizaje automatico.\n\n2\n00:00:04,500 --> 00:00:08,000\nHoy cubriremos los conceptos basicos de las redes neuronales.\n\n3\n00:00:08,500 --> 00:00:12,000\nComencemos por entender que es un perceptron.",
    "source_language": "en",
    "source_language_name": "English"
  }
}

Response Fields

FieldTypeDescription
statusbooleanWhether the request was successful
data.translated_srtstringThe translated SRT content with timing preserved
data.source_languagestringDetected or specified source language code
data.source_language_namestringHuman-readable name of the source language

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import requests

url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/srt"

querystring = {
    "source": "auto",
    "target": "es"
}

payload = """1
00:00:01,000 --> 00:00:04,000
Welcome to our tutorial on machine learning.

2
00:00:04,500 --> 00:00:08,000
Today we will cover the basics of neural networks.

3
00:00:08,500 --> 00:00:12,000
Let's start with understanding what a perceptron is."""

headers = {
    "Content-Type": "text/plain",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com"
}

response = requests.post(url, headers=headers, params=querystring, data=payload)
data = response.json()

# Save the translated subtitles to a file
with open("subtitles_es.srt", "w", encoding="utf-8") as f:
    f.write(data["data"]["translated_srt"])

print("Subtitles translated and saved.")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/srt";

const params = new URLSearchParams({
  source: "auto",
  target: "es",
});

const srt = `1
00:00:01,000 --> 00:00:04,000
Welcome to our tutorial on machine learning.

2
00:00:04,500 --> 00:00:08,000
Today we will cover the basics of neural networks.

3
00:00:08,500 --> 00:00:12,000
Let's start with understanding what a perceptron is.`;

const response = await fetch(`${url}?${params}`, {
  method: "POST",
  headers: {
    "Content-Type": "text/plain",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com",
  },
  body: srt,
});

const data = await response.json();
console.log(data.data.translated_srt);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -X POST "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/srt?source=auto&target=es" \
  -H "Content-Type: text/plain" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: multi-format-ai-translator-the-most-complete.p.rapidapi.com" \
  -d '1
00:00:01,000 --> 00:00:04,000
Welcome to our tutorial on machine learning.

2
00:00:04,500 --> 00:00:08,000
Today we will cover the basics of neural networks.'
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI