{
  "openapi": "3.0.1",
  "info": {
    "title": "Subtitle Converter & Resync — SRT/VTT/ASS",
    "description": "Convert SRT, VTT, ASS/SSA and JSON subtitles, then fix timing with a global offset, framerate conversion or two-point synchronization. Supports batch processing and multiple output formats without third-party APIs.",
    "version": "1.7",
    "x-build-id": "uUlf8tyPuek3DEZgd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lumaxys~subtitle-converter-and-resync/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lumaxys-subtitle-converter-and-resync",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/lumaxys~subtitle-converter-and-resync/runs": {
      "post": {
        "operationId": "runs-sync-lumaxys-subtitle-converter-and-resync",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/lumaxys~subtitle-converter-and-resync/run-sync": {
      "post": {
        "operationId": "run-sync-lumaxys-subtitle-converter-and-resync",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "subtitleText": {
            "title": "Paste your subtitles here — easiest option",
            "type": "string",
            "description": "Paste the complete contents of one SRT, VTT, ASS/SSA or JSON subtitle file, choose an output format, then run. No upload storage is required."
          },
          "pastedFileName": {
            "title": "Filename for pasted subtitles",
            "type": "string",
            "description": "Optional output filename stem for Quick input, for example episode-01.srt. Used only when pasted subtitle content is provided.",
            "default": "pasted-subtitles.srt"
          },
          "outputFormats": {
            "title": "Choose output formats",
            "type": "array",
            "description": "One file is written per format. TXT drops all timings and produces a clean transcript.",
            "items": {
              "type": "string",
              "enum": [
                "srt",
                "vtt",
                "ass",
                "txt",
                "json"
              ],
              "enumTitles": [
                "SRT (SubRip)",
                "VTT (WebVTT)",
                "ASS (Advanced SubStation)",
                "TXT (plain transcript)",
                "JSON (structured cues)"
              ]
            },
            "default": [
              "srt"
            ]
          },
          "subtitleStore": {
            "title": "Select upload storage",
            "type": "string",
            "description": "Required when uploading files: select a Key-Value Store here, then select that exact same store in Step 2. This safely grants read-only access to the uploaded files. Leave empty only when using public direct URLs."
          },
          "subtitleFiles": {
            "title": "Advanced upload — upload files",
            "maxItems": 20,
            "type": "array",
            "description": "Upload SRT, VTT, ASS/SSA or JSON files and choose the SAME Key-Value Store as in Step 1. You can upload several files and apply the same conversion and retiming to all of them.",
            "items": {
              "type": "string"
            }
          },
          "subtitleUrls": {
            "title": "Direct subtitle file URLs",
            "maxItems": 20,
            "type": "array",
            "description": "Optional direct HTTP(S) download URLs to SRT, VTT, ASS/SSA or JSON files. Not YouTube or TikTok page links. Uploaded files and URLs can be combined in the same run.",
            "items": {
              "type": "string"
            }
          },
          "offsetMs": {
            "title": "Global offset (milliseconds)",
            "type": "integer",
            "description": "Shift every cue. Negative makes subtitles appear EARLIER, positive LATER. Use this when the lag is the same at the start and at the end of the file. If the lag grows over time, it is drift — use the framerate or two-point options instead.",
            "default": 0
          },
          "sourceFps": {
            "title": "Source framerate",
            "enum": [
              "",
              "23.976",
              "24",
              "25",
              "29.97",
              "30",
              "50",
              "59.94",
              "60"
            ],
            "type": "string",
            "description": "The framerate the subtitles were authored against. Leave empty unless you know it.",
            "default": ""
          },
          "targetFps": {
            "title": "Target framerate",
            "enum": [
              "",
              "23.976",
              "24",
              "25",
              "29.97",
              "30",
              "50",
              "59.94",
              "60"
            ],
            "type": "string",
            "description": "The framerate of the video you are syncing to. Must be set together with the source framerate.",
            "default": ""
          },
          "useAnchorSync": {
            "title": "Two-point sync (fixes lag AND drift)",
            "type": "boolean",
            "description": "The reliable fix when you do not know the framerates. Give the current and correct timestamps of two lines far apart — ideally the first and the last of the file — and both the constant lag and the progressive drift are solved at once.",
            "default": false
          },
          "anchorObservedA": {
            "title": "First line — current timestamp",
            "type": "string",
            "description": "As written in the file, e.g. 00:00:04,120. Seconds also accepted."
          },
          "anchorDesiredA": {
            "title": "First line — correct timestamp",
            "type": "string",
            "description": "When it should actually appear, e.g. 00:00:02,000."
          },
          "anchorObservedB": {
            "title": "Last line — current timestamp",
            "type": "string",
            "description": "Must be at least 30 seconds after the first anchor, or the computed scale is unreliable."
          },
          "anchorDesiredB": {
            "title": "Last line — correct timestamp",
            "type": "string",
            "description": "When the last line should actually appear."
          },
          "dropNegativeCues": {
            "title": "Drop cues pushed before zero",
            "type": "boolean",
            "description": "Off by default: cues shifted before zero are clamped to 00:00:00, which is what a player does anyway. Turn on when you are trimming a leading section rather than correcting a lag.",
            "default": false
          },
          "keepLineBreaksInTxt": {
            "title": "Keep line breaks in TXT output",
            "type": "boolean",
            "description": "Off by default, so each cue becomes one paragraph. Turn on to preserve the original two-line layout.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}