Movie streaming API reference
BingeAPI is a movie streaming API, for films and TV shows alike, that you use through an iframe. There is no key, no account and nothing to install: build a URL, put it in an iframe, done.
Quick start
Paste this where the player should appear. It plays Inception (TMDB id 27205).
<iframe src="https://bingeapi.st/embed/movie/27205"
width="100%" height="100%" frameborder="0"
allow="autoplay; fullscreen; picture-in-picture; encrypted-media"
allowfullscreen></iframe>
Want a different look or behaviour? The playground builds the URL with every option for you.
Embed URLs
| Route | Plays |
|---|---|
https://bingeapi.st/embed/movie/{id} | a movie |
https://bingeapi.st/embed/tv/{id}/{season}/{episode} | one episode of a show |
Ids
{id}is a TMDB id (digits, e.g.27205) or an IMDb id (tt+ digits, e.g.tt1375666). Both point to the same title.- For TV,
{id}is the show's id, not the episode's: Breaking Bad season 1 episode 1 is/embed/tv/1396/1/1or/embed/tv/tt0903747/1/1. - Season and episode numbers start at 1. Specials (season 0) are not available.
Titles we don't have yet
If a title is not in the library, the player looks it up on TMDB the first time it is requested and checks the streaming servers on the spot. That first play can take several seconds; every play after it is instant. Ids that don't exist show "This movie could not be found." inside the player.
Episodes inside the player
A TV embed includes a season picker and an episode list, plus a next-episode button and countdown. Moving to another episode keeps your URL options, except autoplay and welcome: the next episode always starts by itself. Hide the episode list with episodes=0 and the next-episode button with next=0, or turn the countdown off with autonext=0.
The iframe
| Attribute | Why |
|---|---|
allow="autoplay; fullscreen; picture-in-picture; encrypted-media" | lets the player start by itself, go fullscreen and use picture-in-picture |
allowfullscreen | fullscreen on older browsers |
width="100%" height="100%" | fills the element you put it in, so give that element the size you want the player to be |
frameborder="0" | no border around the player |
Because the height is 100%, the player is as tall as the element around it, so that element needs a height. For a 16:9 player at full width, a common way that works in every browser is a wrapper with position:relative;padding-top:56.25% and the iframe placed inside it with position:absolute;top:0;left:0.
Don't add a sandbox attribute: it blocks the scripts the player needs. Browsers only let a video start with sound after the viewer has interacted with the page, so autoplay may start muted, with a tap to unmute.
URL options
Add options to the embed URL as a query string, e.g. /embed/movie/27205?color=00aaff&autoplay=0. Every value is checked: anything invalid is ignored and the default applies, so a typo never breaks the player. Options you set on a movie or episode carry over when the viewer moves to another episode, except autoplay and welcome.
| Option | Values | Default | What it does |
|---|---|---|---|
autoplay | 1, 0 | 1 | 0 shows a play button and waits for a click before the first video starts. Episodes the viewer moves to afterwards play by themselves. |
welcome | 1 | off | Shows a welcome page first: a play button over the title's artwork, and the player loads on click. Viewers on VPN and hosting networks always get this page, with a quick bot check. |
color | 3 or 6 hex digits, # optional | violet | Your colour for the whole player. The progress bar, buttons, toggles and highlights use it, and the panels and backgrounds become dark shades of it. Text and icons on it switch to dark automatically when the colour is light. |
bg | 3 or 6 hex digits, # optional | follows color | A separate background colour for the panels and backgrounds, so color only sets the controls. Its hue and how colourful it is are used, and a darker or lighter colour makes the panels a little darker or lighter; the player always stays dark enough for the text to be readable. A gray gives neutral panels. |
theme | dark | - | A plain near-black player with white text and controls. bg is ignored. Add color if the controls should be coloured instead of white. |
title | 0 | shown | Hides the title in the player's top bar. |
autonext | 1, 0 | 1 | Whether the next episode starts by itself after a countdown. The next-episode button stays either way. |
next | 0 | shown | Hides the next-episode button near the end of an episode. autonext still decides whether the next episode starts by itself. |
episodes | 0 | shown | Hides the episode browser (its button and list). |
pause_overlay | 0 | shown | No logo, title and details over the video while it is paused. |
skip | 1, 0 | viewer's choice | 0 hides the Skip Intro, Recap, Preview and Credits buttons, 1 always shows them. Without it the viewer's own setting applies. |
resume | 0 | on | Always starts from the beginning instead of where the viewer left off on this device. |
right_click | 0 | shown | Right click on the player does nothing, instead of showing the BingeAPI Player link. |
sub_lang | a language code | off | Turns subtitles on in that language, using the server's built-in subtitles when it has them. See subtitles. |
sub_os | 1 | off | With sub_lang: when the server has no built-in subtitles in that language, the most downloaded OpenSubtitles ones are loaded instead. |
sub_url | an https:// url to a .srt or .vtt file | none | Adds your own subtitle file and selects it. See subtitles. |
sub_label | text, up to 40 characters | Subtitles | The name of your subtitle file in the player's list. |
servers | server numbers, comma separated | our order | These servers are tried first, in your order; all other servers follow. See servers. |
A site's options win over a viewer's own saved choices on that site's player, but the viewer can still change anything in the player while watching.
Servers
Every title is checked across our servers. The player starts with the first one that has it and switches to the next one by itself if a server fails. Viewers can also pick a server in the player. Use the numbers below with servers=.
| Number | Server | Quality |
|---|---|---|
81 | Aldebaran | HD |
80 | Sirius | up to 4K |
94 | Tarazed | up to 4K |
85 | Markab | HD |
87 | Yildun | up to 4K |
86 | Vega | HD |
93 | Mira | HD |
84 | Wezen | up to 4K |
82 | Fomalhaut | HD |
88 | Nashira | up to 4K |
92 | Botein | HD |
91 | Ogma | HD |
Example: ?servers=87,88,80 tries those three 4K-capable servers first. Unknown or disabled numbers are skipped, so you can never end up with fewer servers than the default.
Subtitles
Viewers get the subtitles each server provides, can search OpenSubtitles in 42 languages, and can upload a file. Size, position, colour, font, background and timing are adjustable in the player.
Default language: sub_lang
Use one of these codes (two-letter codes like en also work):
alb Albanianara Arabicarm Armenianbul Bulgarianchi Chinese (simplified)zht Chinese (traditional)hrv Croatiancze Czechdan Danishdut Dutcheng Englishest Estonianfin Finnishfre Frenchgeo Georgianger Germanell Greekheb Hebrewhin Hindihun Hungarianice Icelandicind Indonesianita Italianjpn Japanesekor Koreanmac Macedoniannor Norwegianper Persianpol Polishpor Portuguesepob Portuguese (BR)rum Romanianrus Russianscc Serbianslo Slovakslv Slovenianspa Spanishswe Swedishtha Thaitur Turkishukr Ukrainianvie Vietnamese
OpenSubtitles fallback: sub_os
Add sub_os=1 next to sub_lang and, when the server has no built-in subtitles in your language, the player loads the most downloaded OpenSubtitles ones for it. Built-in subtitles always come first.
Your own file: sub_url
- The file must be served over
https://, as .srt or .vtt. - The viewer's browser loads it straight from your server, so your server must allow it with a CORS header:
Access-Control-Allow-Origin: *(orhttps://bingeapi.st). - URL-encode the address, otherwise any
&or?in it breaks the embed URL:?sub_url=https%3A%2F%2Fexample.com%2Fsubs%2Fen.srt&sub_label=English - If the file can't be loaded, the player quietly falls back to its normal subtitles.
postMessage API
Your page and the player talk with window.postMessage. Send commands to the iframe; listen for events from it.
// send a command
const player = document.querySelector("iframe");
function send(command, value) {
player.contentWindow.postMessage({ source: "bingeapi_player_command", command, value }, "*");
}
send("seek", 120);
// listen for events
window.addEventListener("message", (e) => {
if (e.data && e.data.source === "bingeapi_player") {
console.log(e.data.event, e.data.info);
}
});
Commands
| Command | Value | Does |
|---|---|---|
play, pause, toggle | playback | |
seek | seconds | jumps to that time |
volume | 0-1, or 1-100 as a percentage | sets the volume |
mute, unmute | sound off / on | |
fullscreen, exitfullscreen | browsers usually allow this only after a click on the page |
Unknown commands are ignored. Commands sent before the player has loaded are dropped, so wait for the first event before sending.
Events
| Event | info |
|---|---|
play, pause, ended | null |
time | current time in seconds, at most once a second |
duration | length in seconds |
seek | the new time in seconds |
volume | 0-1 |
mute, unmute | null |
buffering | true / false |
fullscreen, exitfullscreen | null |
serverchange | the server's name, also for the first server |
error | a message, e.g. a server failing, all servers failing, or no sources for the title |
What viewers see
- VPN, proxy and data-centre connections first see a welcome page: a play button over the title's artwork, with a quick automatic check. Most never see more than the button; if the check needs them, a small verification box appears. Home and mobile connections go straight to the player, unless you add
welcome=1, which shows them the same page without the check. - A big play button waits for a tap when
autoplay=0is set, and when the browser refuses to start the video by itself. - Progress is remembered in the viewer's browser: where they stopped, playback speed and subtitle settings. Browsers keep this separately for each website the player is embedded on. With
resume=0every play starts from the beginning. - Right click on the player shows a small BingeAPI Player link instead of the browser's menu. With
right_click=0right click does nothing. - No ads. Nothing is shown before, during or after the video.
- Errors are shown inside the player: a title that doesn't exist, an episode that isn't available, or no streaming sources yet. Your page gets the same as an
errorevent.
Help
Questions, a title that plays the wrong video, or an idea for an option? Ask on Discord or send us a message.