Developer API documentation

Laravel example

$apiToken = 'YOUR_TOKEN';

$inputFile = fopen(base_path('input.vtt'));

$response = Http::acceptJson()
    ->withToken($apiToken)
    ->attach('subtitle', $inputFile)
    ->post('https://subtitletools.com/api/v1/convert-to-srt');

$json = $response->json();

if ($json->errors) {
    throw new RuntimeException();
}

$response = Http::acceptJson()
    ->withToken($apiToken)
    ->get($json->download_url);

$outputFilePath = base_path('output.srt');

file_put_contents($outputFilePath, $response->body());