Overview
The Subtitle API provides comprehensive subtitle management including fetching embedded subtitles, searching external subtitle providers, downloading subtitles, and delivering them in various formats.Get Subtitle Stream
Retrieves subtitles in a specified format.Get Subtitle
The unique identifier of the video item
The media source identifier
The subtitle stream index (zero-based)
The output format:
vtt- WebVTT (recommended for web)srt- SubRipass- Advanced SubStation Alphassa- SubStation Alphajson- JSON format
The start position of the subtitle in ticks. Used for extracting a subset of subtitles.
The end position of the subtitle in ticks. If omitted, returns subtitles to the end.
Whether to copy the original timestamps (useful when transcoding with an offset)
Whether to add a VTT time map header. Required for HLS subtitle synchronization:
Subtitle file content in the requested format
200 OK- Subtitle file returned401 Unauthorized- Authentication required404 Not Found- Item or subtitle stream not found
Example Request
Get Subtitle with Time Range
Retrieves subtitles for a specific time range.startPositionTicks in the path.
Example Request
HLS Subtitle Playlist
Generates an HLS playlist for subtitles, allowing them to be loaded as segments.Get HLS Subtitle Playlist
The video item identifier
The media source identifier
The subtitle stream index
The subtitle segment length in seconds (typically matches video segment length)
M3U8 playlist with subtitle segment URLs
200 OK- Subtitle playlist returned400 Bad Request- Invalid parameters or HLS subtitles not supported for this media401 Unauthorized- Authentication required404 Not Found- Item not found
Example Request
Example Response
Search Remote Subtitles
Searches for subtitles from external providers (e.g., OpenSubtitles).Search Subtitles
The video item identifier
The ISO 639-1 language code (e.g.,
en, es, fr, de, ja)Only show subtitles which are a perfect match for the video
Array of RemoteSubtitleInfo objects:
200 OK- Search results returned401 Unauthorized- Authentication required403 Forbidden- User lacks SubtitleManagement permission404 Not Found- Item not found
Example Request
Example Response
Download Remote Subtitle
Downloads a subtitle from an external provider.Download Subtitle
The video item identifier
The subtitle identifier from the search results
204 No Content- Subtitle downloaded successfully401 Unauthorized- Authentication required403 Forbidden- User lacks SubtitleManagement permission404 Not Found- Item or subtitle not found
Example Request
Get Remote Subtitle
Retrieves a remote subtitle file without downloading it to the server.Get Remote Subtitle File
The subtitle identifier from search results
Subtitle file content with appropriate MIME type
200 OK- Subtitle file returned401 Unauthorized- Authentication required403 Forbidden- User lacks SubtitleManagement permission
Example Request
Upload Subtitle
Uploads an external subtitle file for a video.Upload Subtitle File
The video item identifier
ISO 639-1 language code (e.g., “en”, “es”, “fr”)
Subtitle format:
srt, ass, ssa, vtt, subWhether this is a forced subtitle track
Whether this subtitle includes hearing impaired descriptions
Base64-encoded subtitle file content
204 No Content- Subtitle uploaded successfully400 Bad Request- Invalid subtitle data401 Unauthorized- Authentication required403 Forbidden- User lacks SubtitleManagement permission404 Not Found- Item not found
Example Request
Delete Subtitle
Deletes an external subtitle file.Delete Subtitle
The video item identifier
The subtitle stream index to delete
204 No Content- Subtitle deleted successfully401 Unauthorized- Authentication required403 Forbidden- User lacks elevation privileges404 Not Found- Item or subtitle not found
Example Request
Fallback Fonts
Manage fallback fonts used for rendering subtitles.Get Fallback Font List
Array of FontFile objects:
200 OK- Font list returned401 Unauthorized- Authentication required
Get Fallback Font File
The font file name
Font file content (woff, woff2, ttf, or otf format)
200 OK- Font file returned401 Unauthorized- Authentication required404 Not Found- Font file not found
Subtitle Formats
SubRip (SRT)
Most widely supported format:WebVTT (VTT)
Web standard, required for HLS:Advanced SubStation Alpha (ASS)
Supports styling and positioning:JSON
Structured format for programmatic use:Subtitle Delivery Methods
When playing video with subtitles, you can specify the delivery method:Encode (Burned In)
- Subtitles are permanently rendered into the video
- Always visible, cannot be disabled
- Works on all devices
- Requires transcoding
- Use when: Client doesn’t support text subtitles
Embed
- Subtitles included as a separate stream in the container
- Can be toggled on/off
- Requires container and client support
- No transcoding if source supports it
- Use when: Client supports subtitle streams in the container format
External
- Subtitles served as a separate file
- Maximum compatibility
- Client fetches subtitle file separately
- No transcoding required
- Use when: Maximum flexibility needed
HLS
- Subtitles included in HLS manifest
- Segmented like video/audio
- Best for adaptive streaming
- Client-side subtitle rendering
- Use when: Using HLS video streaming
Best Practices
-
Format Selection:
- Web playback: Use WebVTT
- Maximum compatibility: Use SubRip (SRT)
- Advanced styling: Use ASS/SSA
-
Searching Subtitles:
- Use
isPerfectMatch=truefor better quality matches - Check
IsHashMatchin results for best sync - Consider
CommunityRatingandDownloadCount
- Use
-
Performance:
- External subtitles avoid transcoding overhead
- Cache converted subtitle formats
- Use HLS subtitle playlists for long videos
-
Language Codes:
- Use ISO 639-1 two-letter codes when possible
- ISO 639-2 three-letter codes are also supported
-
Time Synchronization:
- Use
copyTimestamps=truewhen transcoding - Add VTT time map for HLS (
addVttTimeMap=true) - Test subtitle sync after encoding
- Use