Skip to main content

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

Authentication: Required
string
required
The unique identifier of the video item
string
required
The media source identifier
integer
required
The subtitle stream index (zero-based)
string
required
The output format:
  • vtt - WebVTT (recommended for web)
  • srt - SubRip
  • ass - Advanced SubStation Alpha
  • ssa - SubStation Alpha
  • json - JSON format
integer
default:"0"
The start position of the subtitle in ticks. Used for extracting a subset of subtitles.
integer
The end position of the subtitle in ticks. If omitted, returns subtitles to the end.
boolean
default:"false"
Whether to copy the original timestamps (useful when transcoding with an offset)
boolean
default:"false"
Whether to add a VTT time map header. Required for HLS subtitle synchronization:
string
Subtitle file content in the requested format
Response Codes:
  • 200 OK - Subtitle file returned
  • 401 Unauthorized - Authentication required
  • 404 Not Found - Item or subtitle stream not found

Example Request


Get Subtitle with Time Range

Retrieves subtitles for a specific time range.
Parameters are the same as above, with 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

Authentication: Required
string
required
The video item identifier
string
required
The media source identifier
integer
required
The subtitle stream index
integer
required
The subtitle segment length in seconds (typically matches video segment length)
string
M3U8 playlist with subtitle segment URLs
Response Codes:
  • 200 OK - Subtitle playlist returned
  • 400 Bad Request - Invalid parameters or HLS subtitles not supported for this media
  • 401 Unauthorized - Authentication required
  • 404 Not Found - Item not found

Example Request

Example Response


Search Remote Subtitles

Searches for subtitles from external providers (e.g., OpenSubtitles).

Search Subtitles

Authentication: Required (SubtitleManagement policy)
string
required
The video item identifier
string
required
The ISO 639-1 language code (e.g., en, es, fr, de, ja)
boolean
Only show subtitles which are a perfect match for the video
array
Array of RemoteSubtitleInfo objects:
Response Codes:
  • 200 OK - Search results returned
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - User lacks SubtitleManagement permission
  • 404 Not Found - Item not found

Example Request

Example Response


Download Remote Subtitle

Downloads a subtitle from an external provider.

Download Subtitle

Authentication: Required (SubtitleManagement policy)
string
required
The video item identifier
string
required
The subtitle identifier from the search results
Response Codes:
  • 204 No Content - Subtitle downloaded successfully
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - User lacks SubtitleManagement permission
  • 404 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

Authentication: Required (SubtitleManagement policy)
string
required
The subtitle identifier from search results
binary
Subtitle file content with appropriate MIME type
Response Codes:
  • 200 OK - Subtitle file returned
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - User lacks SubtitleManagement permission

Example Request


Upload Subtitle

Uploads an external subtitle file for a video.

Upload Subtitle File

Authentication: Required (SubtitleManagement policy)
string
required
The video item identifier
string
required
ISO 639-1 language code (e.g., “en”, “es”, “fr”)
string
required
Subtitle format: srt, ass, ssa, vtt, sub
boolean
required
Whether this is a forced subtitle track
boolean
required
Whether this subtitle includes hearing impaired descriptions
string
required
Base64-encoded subtitle file content
Response Codes:
  • 204 No Content - Subtitle uploaded successfully
  • 400 Bad Request - Invalid subtitle data
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - User lacks SubtitleManagement permission
  • 404 Not Found - Item not found

Example Request


Delete Subtitle

Deletes an external subtitle file.

Delete Subtitle

Authentication: Required (Elevation policy)
string
required
The video item identifier
integer
required
The subtitle stream index to delete
Response Codes:
  • 204 No Content - Subtitle deleted successfully
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - User lacks elevation privileges
  • 404 Not Found - Item or subtitle not found

Example Request


Fallback Fonts

Manage fallback fonts used for rendering subtitles.

Get Fallback Font List

Authentication: Required Returns a list of available fallback font files.
array
Array of FontFile objects:
Response Codes:
  • 200 OK - Font list returned
  • 401 Unauthorized - Authentication required

Get Fallback Font File

Authentication: Required
string
required
The font file name
binary
Font file content (woff, woff2, ttf, or otf format)
Response Codes:
  • 200 OK - Font file returned
  • 401 Unauthorized - Authentication required
  • 404 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

  1. Format Selection:
    • Web playback: Use WebVTT
    • Maximum compatibility: Use SubRip (SRT)
    • Advanced styling: Use ASS/SSA
  2. Searching Subtitles:
    • Use isPerfectMatch=true for better quality matches
    • Check IsHashMatch in results for best sync
    • Consider CommunityRating and DownloadCount
  3. Performance:
    • External subtitles avoid transcoding overhead
    • Cache converted subtitle formats
    • Use HLS subtitle playlists for long videos
  4. Language Codes:
    • Use ISO 639-1 two-letter codes when possible
    • ISO 639-2 three-letter codes are also supported
  5. Time Synchronization:
    • Use copyTimestamps=true when transcoding
    • Add VTT time map for HLS (addVttTimeMap=true)
    • Test subtitle sync after encoding