API Documentation

Embed movies and TV shows with a single URL. No API key required.

Base URL

https://apiplayer.ru

All endpoints are relative to this base. No authentication required for public embed and listing endpoints.

Iframe Usage

Embed the player in your page using a standard iframe.

HTML
<iframe
src="https://apiplayer.ru/embed/movie/tt1375666"
width="100%"
height="100%"
frameborder="0"
allowfullscreen
allow="autoplay; encrypted-media; screen-wake-lock"
></iframe>
Add allow="screen-wake-lock" to enable mobile orientation lock on fullscreen.

Rate Limits

LimitValue
Requests60 per minute (default)
Window60 seconds

Exceeding the limit returns 429 Too Many Requests.

Movie Embed

GET/embed/movie/:id

Embeds a movie player. Accepts IMDB or TMDB IDs as path parameter or query params.

ParamDescription
idrequiredIMDB ID (tt1375666) or TMDB ID (27205)
Path examples
https://apiplayer.ru/embed/movie/tt1375666
https://apiplayer.ru/embed/movie/27205
Query param examples
https://apiplayer.ru/embed/movie?imdb=tt1375666
https://apiplayer.ru/embed/movie?tmdb=27205&ds_lang=de

TV Show Embed

GET/embed/tv/:id

Embeds a TV show. Without season/episode params, defaults to S1E1.

ParamDescription
idrequiredIMDB ID (tt0944947) or TMDB ID (1399)
Examples
https://apiplayer.ru/embed/tv/tt0944947
https://apiplayer.ru/embed/tv?tmdb=1399&ds_lang=de

Episode Embed

GET/embed/tv/:id/:season/:episode

Embeds a specific TV episode. Supports three URL formats.

ParamDescription
idrequiredIMDB or TMDB show ID
seasonrequiredSeason number
episoderequiredEpisode number
Path format
https://apiplayer.ru/embed/tv/1399/1/1
Dash format
https://apiplayer.ru/embed/tv/tt0944947/1-1
Query format
https://apiplayer.ru/embed/tv?imdb=tt0944947&season=1&episode=1&autoplay=1

Optional Parameters

These query parameters work with all embed endpoints.

ParamDescription
autoplayoptional1 or 0. Enable/disable autoplay. Default: 1.
autonextoptional1 or 0. Auto-advance to next episode at end. Default: 0.
resumeoptional1 or 0. Show resume prompt for returning viewers. Default: 1. Set 0 to suppress if your site manages its own watch state.
langoptionalPreferred audio/subtitle language (ISO 639-1 code, e.g. en, fr, de, es). The player will proactively translate and select subtitles in this language. Alias: ds_lang.
ds_langoptionalAlias for lang. Preferred audio/subtitle language.
uilangoptionalPreferred UI/interface language (ISO 639-1 code, e.g. en, fr, de, es, ru). Sets the player text translation. Alias: ui_lang.
ui_langoptionalAlias for uilang. Preferred UI/interface language.
sub_urloptionalURL-encoded custom subtitle file URL (.srt or .vtt). The subtitle host must have CORS enabled.
chaptersoptional1 or 0. Enable rendering chapter markers from TMDB (if available) on the progress bar. Default: 0.
subSizeoptional0.75-2. Subtitle font size multiplier. Default: 1.
subColoroptionalHex color code (e.g. #ffff00 for yellow). Default: #ffffff.
subBgoptionalBackground color (e.g. transparent, rgba(0,0,0,1)). Default: rgba(0,0,0,0.5).
skip_intro_startoptionalSkip intro start time in seconds. Requires skip_intro_end.
skip_intro_endoptionalSkip intro end time in seconds. Shows a "Skip Intro" button between start and end.
Example with all params
https://apiplayer.ru/embed/tv/1399/1/1?autoplay=1&autonext=1&resume=1&ds_lang=en&chapters=1&subSize=1.5&subColor=#ffff00&skip_intro_start=60&skip_intro_end=90

postMessage API

The player communicates bidirectionally with its parent page via window.postMessage. All messages use type: "mplayer".

Setup
const player = document.getElementById('mplayer-iframe');

// Send a command to the player
player.contentWindow.postMessage({ type: 'mplayer', action: 'play' }, '*');

// Listen to player events
window.addEventListener('message', (e) => {
  if (e.data?.type === 'mplayer') {
    console.log(e.data.event, e.data);
  }
});

Inbound Commands (parent → player)

ActionDescription
playINStart playback.
pauseINPause playback.
seekINvalue: seconds — Seek to position.
volumeINvalue: 0–1 — Set volume level.
muteINvalue: true/false — Mute or unmute.
setSpeedINvalue: 0.5–3 — Set playback rate.
setChaptersINvalue: [{time, label}, ...] — Dynamically inject chapter markers.
setSleepTimerINvalue: seconds — Set sleep timer (0 = disable).
loadINvalue: {src, type} — Load a new stream URL without reloading the page.
getStateINRequest current player state. Response: event: "state".
getProgressINRequest saved watch progress. Response: event: "progress".
setSleepTimerINvalue: number — Set a sleep timer in minutes (e.g., 30). Set to 0 to cancel.
setSubtitlePrefsINvalue: object — Set subtitle appearance (e.g. { size: "1.5", color: "#ffff00", bg: "rgba(0,0,0,1)" }).

Outbound Events (player → parent)

EventPayload fields
readyOUTcontentId
playOUTcurrentTime
pauseOUTcurrentTime
timeupdateOUTcurrentTime, duration
endedOUT
errorOUTmessage
stateOUTpaused, currentTime, duration, volume, muted, playbackRate
progressOUTposition, duration, percent — emitted on load and when getProgress is called.
bufferingOUTbuffered (0–1 fraction)
qualitychangeOUTquality (e.g. "720p", "Auto")
audiotrackOUTlabel — active audio track label
resizeOUTwidth, height — player container size
autonextOUTEmitted when auto-next countdown starts
abloopOUTa, b — loop points set or cleared
reportOUTUser clicked "Report broken"
sleependedOUTSleep timer fired and paused playback

Keyboard Shortcuts

KeyAction
SpacePlay / Pause
← / →Seek ±10 seconds
↑ / ↓Volume ±10%
fFullscreen toggle
mMute toggle
pPicture-in-Picture toggle
cCycle subtitle tracks
aSet A/B loop start point
bSet A/B loop end point
EscapeClear A/B loop
zCycle zoom presets (1× → 1.5× → 2× → 1×)
0–9Jump to 0%–90% of video duration

Progress / Resume API

The player automatically saves watch position server-side using an anonymous session cookie (mpsid). Position is saved every 30 seconds and on pause/end. A "Resume from X:XX?" prompt appears for returning viewers.

The mpsid cookie is SameSite=None; Secure which allows it to persist across browser sessions within the same embed iframe context. Set ?resume=0 on the iframe URL to suppress the resume prompt entirely.
GET/api/v/progress/:id

Returns saved watch position for the current session. Requires the mpsid cookie.

ParamDescription
idrequiredIMDB or TMDB content ID
{
  "position": 1234,    // seconds
  "duration": 7200,    // total duration
  "percent":  17,       // 0–100
  "ts":       1710000000000
}
POST/api/v/progress/:id

Saves watch position for the current session. If position is less than 30s or greater than 95% of duration, the saved progress is cleared.

Body fieldDescription
positionrequiredCurrent position in seconds (number)
durationoptionalTotal duration in seconds (number). Used to compute percent and detect near-end.
{ "saved": true, "position": 1234 }

Thumbnail Preview API

Generates seek bar thumbnail previews from the video stream using FFmpeg. First request triggers background generation and returns 202. Subsequent requests return 200 once ready. The player automatically polls these endpoints.

GET/api/v/_t/:id

Returns a WebVTT manifest mapping time ranges to sprite sheet coordinates.

https://apiplayer.ru/api/v/_t/tt1375666
Returns 202 Accepted while generating, 200 with text/vtt content when ready.
GET/api/v/_t/:id/sprite

Returns the JPEG sprite sheet. Tiles are 160×90px at 10-second intervals.

https://apiplayer.ru/api/v/_t/tt1375666/sprite

List Available Subtitles

GET/api/v/_s/:id

Returns available subtitle languages for a given content ID (from OpenSubtitles).

ParamDescription
idrequiredIMDB or TMDB content ID
https://apiplayer.ru/api/v/_s/tt1375666
[
  { "lang": "en", "label": "English" },
  { "lang": "es", "label": "Spanish" }
]

Fetch Subtitle File

GET/api/v/_s/:id/:lang

Returns subtitle content in VTT format for the specified language.

ParamDescription
idrequiredIMDB or TMDB content ID
langrequiredISO 639-1 language code (e.g. en, fr)
https://apiplayer.ru/api/v/_s/tt1375666/en
Returns text/vtt content type. Use this URL directly as a subtitle source in your own player.

List Latest Movies

GET/movies/latest/page-:page.json

Returns a paginated JSON list of the latest movies.

https://apiplayer.ru/movies/latest/page-1.json
{
  "page": 1,
  "total_pages": 5,
  "result": [
    {
      "imdb_id": "tt0468569",
      "tmdb_id": 155,
      "title": "The Dark Knight",
      "year": 2008,
      "poster": "https://image.tmdb.org/...",
      "embed_url_imdb": "/embed/movie/tt0468569",
      "embed_url_tmdb": "/embed/movie/155"
    }
  ]
}

List Latest TV Shows

GET/tvshows/latest/page-:page.json

Returns distinct TV shows with episode counts, paginated.

https://apiplayer.ru/tvshows/latest/page-1.json
{
  "page": 1,
  "total_pages": 3,
  "result": [
    {
      "imdb_id": "tt0944947",
      "tmdb_id": 1399,
      "show_title": "Game of Thrones",
      "embed_url": "/embed/tv/1399"
    }
  ]
}

List Latest Episodes

GET/episodes/latest/page-:page.json

Returns the latest episodes with season/episode info.

https://apiplayer.ru/episodes/latest/page-1.json
{
  "page": 1,
  "total_pages": 120,
  "result": [
    {
      "tmdb_id": 2894230,
      "show_title": "Mom",
      "season_num": 8,
      "episode_num": 18,
      "embed_url": "/embed/tv/2894230/8/18"
    }
  ]
}