Skip to content

Subtitle Merge API

POST https://api.findutils.com/api/tools/subtitle-merge/execute

Join several SubRip (.srt) or WebVTT (.vtt) caption files into one track. Append (the default) lays the files end to end: each later file is offset past the previous one's last cue, plus an optional gap, so parts exported separately — which normally restart at 00:00:00 — become one continuous timeline, and the cues are renumbered from 1. Dual stacks two files on one timeline instead, keeping the primary file's timing and appending each secondary cue's lines to the cue it overlaps, which is how a bilingual subtitle track is built. Inputs may mix the two formats; each is parsed natively and the output is written in one format. A file that cannot be parsed is reported by position and the rest still merge. Cue text is never translated or edited.

Request body

application/json
  • inputs

    array required

    Caption file contents, one string per file, in the order they should appear. At most 20.

  • mode

    string optional

    append lays the files end to end on one continuous timeline. dual stacks them on the primary file's timing for a bilingual track. Default append. One of append · dual. Default "append".

  • gap_ms

    integer optional

    Silence inserted between parts in append mode, in milliseconds. Ignored in dual mode. 0 to 60000. Default 0. Default 0.

  • format

    string optional

    Output format. auto keeps the format of the first file that parsed. Default auto. One of auto · srt · vtt. Default "auto".

  • primary

    integer optional

    Dual mode only: the 0-based index of the file whose timing is kept. Default 0, the first file. Default 0.

  • keep_absolute

    boolean optional

    Append mode only: the files already share one timeline, so keep every timestamp as written and interleave the cues by start time instead of offsetting. Use this when the parts were cut from one long recording without being renumbered. Default false. Default false.

Example arguments

Verified
{
  "inputs": [
    "1\n00:00:01,000 --> 00:00:04,000\nPart one, first line.\n\n2\n00:00:05,000 --> 00:00:10,000\nPart one, last line.\n",
    "1\n00:00:00,500 --> 00:00:03,000\nPart two, first line.\n\n2\n00:00:04,000 --> 00:00:08,000\nPart two, last line.\n"
  ],
  "mode": "append",
  "gap_ms": 0
}