# Subtitle Converter: SRT to WebVTT, Time Shift & Plain Text (`kotaro-project/subtitle-converter`) Actor

Convert subtitles between SRT and WebVTT, shift every timestamp by any number of milliseconds to fix sync, or pull out the plain text for transcripts and translation. Paste subtitles or give links. Get a download URL for each file. No API key. Pay per file converted.

- **URL**: https://apify.com/kotaro-project/subtitle-converter.md
- **Developed by:** [KOTARO project](https://apify.com/kotaro-project) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 file converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🎬 Subtitle Converter — SRT ⇄ WebVTT, time shift and plain text

Paste subtitles or give links to .srt or .vtt files. Get back a converted file with a download link: **SRT to WebVTT**, **WebVTT to SRT**, every timestamp **shifted** to fix out-of-sync subtitles, or just the **plain text** for transcripts, translation or AI tools. No API key.

### What it does

- 🔁 **SRT ⇄ WebVTT**, format detected automatically
- ⏱️ **Shift all timestamps** later or earlier by any number of milliseconds (cues that would end before 0 are dropped and counted)
- 📝 **Plain text** without timestamps or tags, with repeated lines removed
- 🎨 WebVTT styling tags and cue settings (like `align:start`) are kept when writing WebVTT, and removed when writing SRT
- 🌏 **Any language**, UTF-8 output, Windows line endings and BOM handled
- 🔗 **A download URL** for every converted file, and a short preview in the results
- 🔒 Only public http(s) links, every redirect is checked, private and internal addresses are refused

### Input

| Field | What it is |
|---|---|
| `subtitles` | Paste SRT or WebVTT text |
| `urls` | Or links to .srt / .vtt files |
| `outputFormat` | `vtt`, `srt` or `text` (default `vtt`) |
| `shiftMs` | Move every subtitle by this many milliseconds (1500 = 1.5 s later, -2000 = 2 s earlier) |

```json
{ "subtitles": "1\n00:00:01,000 --> 00:00:03,500\nWelcome to the rainy day bakery.\n", "outputFormat": "vtt", "shiftMs": 0 }
```

### Output

```json
{
  "source": "pasted",
  "ok": true,
  "inputFormat": "srt",
  "outputFormat": "vtt",
  "cueCount": 3,
  "droppedCues": 0,
  "shiftMs": 0,
  "firstStart": "00:00:01.000",
  "lastEnd": "00:00:10.000",
  "outputChars": 218,
  "fileKey": "subtitles-001-1a2b3c4d.vtt",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/subtitles-001-1a2b3c4d.vtt",
  "preview": "WEBVTT\n\n00:00:01.000 --> 00:00:03.500\nWelcome to the rainy day bakery.\n…"
}
```

### Pricing

Pay per event: **one `file-converted` event per file converted**. Failed links and empty runs are free.

### Limits

- Up to 5 MB per subtitle file and 100 links per run
- SSA/ASS, SCC and other formats are not supported
- Only use subtitles you are allowed to process

# Actor input Schema

## `subtitles` (type: `string`):

SRT or WebVTT subtitle text. The format is detected automatically. Up to 5 MB.

## `urls` (type: `array`):

Public http or https links to .srt or .vtt files. One output file per link. Private and internal addresses are refused.

## `outputFormat` (type: `string`):

'vtt' (WebVTT), 'srt' (SubRip) or 'text' (plain text only, no timestamps).

## `shiftMs` (type: `integer`):

Move every subtitle later (positive) or earlier (negative). 1500 = 1.5 seconds later. Cues that end before 0 are dropped.

## Actor input object example

```json
{
  "subtitles": "1\n00:00:01,000 --> 00:00:03,500\nWelcome to the rainy day bakery.\n\n2\n00:00:04,000 --> 00:00:07,250\n<i>Fresh bread</i> every rainy evening,\nfrom five o'clock.\n\n3\n00:00:08,000 --> 00:00:10,000\nOnly twenty loaves a day.\n",
  "outputFormat": "vtt",
  "shiftMs": 0
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "subtitles": `1
00:00:01,000 --> 00:00:03,500
Welcome to the rainy day bakery.

2
00:00:04,000 --> 00:00:07,250
<i>Fresh bread</i> every rainy evening,
from five o'clock.

3
00:00:08,000 --> 00:00:10,000
Only twenty loaves a day.`
};

// Run the Actor and wait for it to finish
const run = await client.actor("kotaro-project/subtitle-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "subtitles": """1
00:00:01,000 --> 00:00:03,500
Welcome to the rainy day bakery.

2
00:00:04,000 --> 00:00:07,250
<i>Fresh bread</i> every rainy evening,
from five o'clock.

3
00:00:08,000 --> 00:00:10,000
Only twenty loaves a day.
""" }

# Run the Actor and wait for it to finish
run = client.actor("kotaro-project/subtitle-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "subtitles": "1\\n00:00:01,000 --> 00:00:03,500\\nWelcome to the rainy day bakery.\\n\\n2\\n00:00:04,000 --> 00:00:07,250\\n<i>Fresh bread</i> every rainy evening,\\nfrom five o'\''clock.\\n\\n3\\n00:00:08,000 --> 00:00:10,000\\nOnly twenty loaves a day.\\n"
}' |
apify call kotaro-project/subtitle-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kotaro-project/subtitle-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Iec8lZC3MOfZ1Lvgp/builds/iATAAD2pK4oHDPHeC/openapi.json
