The DoubleSub.io API allows you to programmatically merge two subtitle files into a single bilingual subtitle file. This is useful for building integrations, plugins, or automating subtitle processing.
Base URL: https://doublesub.io
API Key
To use the API, you need an API key. Keys are free and anonymous - no account required!
Limit: 50 merges per day per key.
Your API Key:
Save this key! It cannot be recovered if lost.
Merge Subtitles
POST/api/v1/merge
Request Parameters
Content-Type: multipart/form-data
Parameter
Type
Description
api_keyrequired
string
Your API key (also accepted via X-API-Key header)
srt1required
file
First subtitle file (SRT format) - displayed on top
srt2required
file
Second subtitle file (SRT format) - displayed on bottom
modeoptional
string
Merge mode: all (default), overlapping, or primary
toleranceoptional
integer
Timing tolerance in milliseconds (default: 700)
offset1optional
integer
Time offset for first subtitle in ms (default: 0)
offset2optional
integer
Time offset for second subtitle in ms (default: 0)
color1optional
string
HTML color for first subtitle (e.g., #FFFFFF)
color2optional
string
HTML color for second subtitle (e.g., #FFFF00)
formatoptional
string
Response format: file (default) or json
Example: cURL
# Get merged file directly (using header)
curl -X POST https://doublesub.io/api/v1/merge \
-H "X-API-Key: dsub_your_api_key_here" \
-F "srt1=@english.srt" \
-F "srt2=@french.srt" \
-F "mode=all" \
--output merged.srt
# Or pass API key in form data
curl -X POST https://doublesub.io/api/v1/merge \
-F "api_key=dsub_your_api_key_here" \
-F "srt1=@english.srt" \
-F "srt2=@french.srt" \
--output merged.srt
# Get JSON response
curl -X POST https://doublesub.io/api/v1/merge \
-H "X-API-Key: dsub_your_api_key_here" \
-F "srt1=@english.srt" \
-F "srt2=@french.srt" \
-F "format=json"
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "dsub_your_api_key_here");
using var form = new MultipartFormDataContent();
form.Add(new ByteArrayContent(File.ReadAllBytes("english.srt")), "srt1", "english.srt");
form.Add(new ByteArrayContent(File.ReadAllBytes("french.srt")), "srt2", "french.srt");
form.Add(new StringContent("all"), "mode");
var response = await client.PostAsync("https://doublesub.io/api/v1/merge", form);
var mergedSrt = await response.Content.ReadAsByteArrayAsync();
File.WriteAllBytes("merged.srt", mergedSrt);