Guides

Subtitles for Your Streaming Site or Player#

This guide adds subtitles to a video player on a website: search by TMDB id, pick a language, and load a WebVTT file into the player.

Get a Key#

A free key at sub.wyzie.io/redeem gives 1,000 requests a day on the free sources. Pro ($5 once for 2,000,000 requests) adds every source, browser-safe keys and Wyzie Synced.

Search by TMDB ID#

Send the TMDB id of the movie, or of the show plus season and episode. IMDB ids work too: keep the tt.

# A movie
curl "https://sub.wyzie.io/search?id=286217&language=en&key=YOUR_KEY"
 
# A TV episode
curl "https://sub.wyzie.io/search?id=1399&season=1&episode=1&language=en,es&key=YOUR_KEY"

Pick a Language#

Each result has language (a BCP 47 tag such as en or pt-BR), display (the language name), flagUrl and isHearingImpaired, which is enough for a subtitle menu. Results come best first. best=1 returns only the top match.

Load It in the Player#

Add to=vtt to a result's url and use it as the track source. Browsers play WebVTT in a <track> element. hls.js plays into a normal <video>, so its tracks work the same way. Video.js and Plyr read <track> children too, and Video.js can add one later:

<video id="player" controls crossorigin="anonymous">
  <source src="/media/episode.m3u8" type="application/x-mpegURL" />
  <track
    kind="subtitles"
    srclang="en"
    label="English"
    src="SUBTITLE_URL&to=vtt"
    default
  />
</video>
// Video.js: add a track after the page has loaded
player.addRemoteTextTrack(
  {
    kind: 'subtitles',
    srclang: sub.language,
    label: sub.display,
    src: sub.url + '&to=vtt',
  },
  false,
);

CORS#

The API answers pages on any origin: responses carry Access-Control-Allow-Origin: *, and preflight requests are answered without a key and never billed. A <track> loaded from another origin also needs crossorigin="anonymous" on the <video>.

Keep Your Key Safe#

Never put your normal key in page JavaScript. Anyone can read it in DevTools, and lost requests are not refunded. Pick one of these instead:

  • Search from your own server and send only the result links to the page. Each link carries an encrypted token, never your key, and opens only its own file.
  • Use a browser-safe key (Pro) in the page. It works only from the sites you list, only for search and download, and stops at its own daily cap.

Server keys can also be limited to your own IP addresses and websites under Where Keys Work in the dashboard (Limit Where a Key Works).

Caching#

Each download link works for 60 days, so store the search answer per title and episode instead of searching on every play. Downloading the same subtitle again with the same key within 6 hours, with options you have not used yet in that window, is free (Repeat Downloads). Serve each file from its Wyzie link: the Terms do not allow re-hosting subtitles where others can reach them.

Out-of-Sync Subtitles#

The shift and fps download options fix a constant delay or frame-rate drift, free. Wyzie Synced (Pro) works out the fix from the video's audio: 60 requests when it succeeds, nothing when it misses. Browser-safe keys cannot call it, so run it from your server.

Many Titles at Once#

POST /search/batch runs up to 50 searches in one call, each billed like one search. Use it from your server to fill a catalogue; browser-safe keys get 403 (Batch Search).

curl -X POST https://sub.wyzie.io/search/batch \
  -H "Content-Type: application/json" \
  -d '{"key":"YOUR_KEY","language":"en","best":true,"items":["tt0111161",286217,{"id":1399,"season":1,"episode":2}]}'

Clean Subtitles for Family Sites#

Add censor=1 to a download link to mask the words on your account's Censored lists, first letter kept (f*). It adds no cost beyond the download. Wyzie Censored must be on for the account in dash.wyzie.io; the X-Censor header says on, off or ignored. To also mask blasphemy, choose the Strict or Super strict** level (Strictness Levels).

curl -o clean.vtt "https://sub.wyzie.io/c/...&to=vtt&censor=1"