API Documentation
Embed movies and TV shows with a single URL. No API key required.
Base URL
https://apiplayer.ruAll 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.
<iframe
src="https://apiplayer.ru/embed/movie/tt1375666"
width="100%"
height="100%"
frameborder="0"
allowfullscreen
allow="autoplay; encrypted-media; screen-wake-lock"
></iframe>allow="screen-wake-lock" to enable mobile orientation lock on fullscreen.Rate Limits
| Limit | Value | |
|---|---|---|
| Requests | 60 per minute (default) | |
| Window | 60 seconds |
Exceeding the limit returns 429 Too Many Requests.
Movie Embed
Embeds a movie player. Accepts IMDB or TMDB IDs as path parameter or query params.
| Param | Description | |
|---|---|---|
| id | required | IMDB ID (tt1375666) or TMDB ID (27205) |
https://apiplayer.ru/embed/movie/tt1375666https://apiplayer.ru/embed/movie/27205https://apiplayer.ru/embed/movie?imdb=tt1375666https://apiplayer.ru/embed/movie?tmdb=27205&ds_lang=deTV Show Embed
Embeds a TV show. Without season/episode params, defaults to S1E1.
| Param | Description | |
|---|---|---|
| id | required | IMDB ID (tt0944947) or TMDB ID (1399) |
https://apiplayer.ru/embed/tv/tt0944947https://apiplayer.ru/embed/tv?tmdb=1399&ds_lang=deEpisode Embed
Embeds a specific TV episode. Supports three URL formats.
| Param | Description | |
|---|---|---|
| id | required | IMDB or TMDB show ID |
| season | required | Season number |
| episode | required | Episode number |
https://apiplayer.ru/embed/tv/1399/1/1https://apiplayer.ru/embed/tv/tt0944947/1-1https://apiplayer.ru/embed/tv?imdb=tt0944947&season=1&episode=1&autoplay=1Optional Parameters
These query parameters work with all embed endpoints.
| Param | Description | |
|---|---|---|
| autoplay | optional | 1 or 0. Enable/disable autoplay. Default: 1. |
| autonext | optional | 1 or 0. Auto-advance to next episode at end. Default: 0. |
| resume | optional | 1 or 0. Show resume prompt for returning viewers. Default: 1. Set 0 to suppress if your site manages its own watch state. |
| lang | optional | Preferred 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_lang | optional | Alias for lang. Preferred audio/subtitle language. |
| uilang | optional | Preferred UI/interface language (ISO 639-1 code, e.g. en, fr, de, es, ru). Sets the player text translation. Alias: ui_lang. |
| ui_lang | optional | Alias for uilang. Preferred UI/interface language. |
| sub_url | optional | URL-encoded custom subtitle file URL (.srt or .vtt). The subtitle host must have CORS enabled. |
| chapters | optional | 1 or 0. Enable rendering chapter markers from TMDB (if available) on the progress bar. Default: 0. |
| subSize | optional | 0.75-2. Subtitle font size multiplier. Default: 1. |
| subColor | optional | Hex color code (e.g. #ffff00 for yellow). Default: #ffffff. |
| subBg | optional | Background color (e.g. transparent, rgba(0,0,0,1)). Default: rgba(0,0,0,0.5). |
| skip_intro_start | optional | Skip intro start time in seconds. Requires skip_intro_end. |
| skip_intro_end | optional | Skip intro end time in seconds. Shows a "Skip Intro" button between start and end. |
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=90postMessage API
The player communicates bidirectionally with its parent page via window.postMessage. All messages use type: "mplayer".
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)
| Action | Description | |
|---|---|---|
| play | IN | Start playback. |
| pause | IN | Pause playback. |
| seek | IN | value: seconds — Seek to position. |
| volume | IN | value: 0–1 — Set volume level. |
| mute | IN | value: true/false — Mute or unmute. |
| setSpeed | IN | value: 0.5–3 — Set playback rate. |
| setChapters | IN | value: [{time, label}, ...] — Dynamically inject chapter markers. |
| setSleepTimer | IN | value: seconds — Set sleep timer (0 = disable). |
| load | IN | value: {src, type} — Load a new stream URL without reloading the page. |
| getState | IN | Request current player state. Response: event: "state". |
| getProgress | IN | Request saved watch progress. Response: event: "progress". |
| setSleepTimer | IN | value: number — Set a sleep timer in minutes (e.g., 30). Set to 0 to cancel. |
| setSubtitlePrefs | IN | value: object — Set subtitle appearance (e.g. { size: "1.5", color: "#ffff00", bg: "rgba(0,0,0,1)" }). |
Outbound Events (player → parent)
| Event | Payload fields | |
|---|---|---|
| ready | OUT | contentId |
| play | OUT | currentTime |
| pause | OUT | currentTime |
| timeupdate | OUT | currentTime, duration |
| ended | OUT | — |
| error | OUT | message |
| state | OUT | paused, currentTime, duration, volume, muted, playbackRate |
| progress | OUT | position, duration, percent — emitted on load and when getProgress is called. |
| buffering | OUT | buffered (0–1 fraction) |
| qualitychange | OUT | quality (e.g. "720p", "Auto") |
| audiotrack | OUT | label — active audio track label |
| resize | OUT | width, height — player container size |
| autonext | OUT | Emitted when auto-next countdown starts |
| abloop | OUT | a, b — loop points set or cleared |
| report | OUT | User clicked "Report broken" |
| sleepended | OUT | Sleep timer fired and paused playback |
Keyboard Shortcuts
| Key | Action | |
|---|---|---|
| Space | Play / Pause | |
| ← / → | Seek ±10 seconds | |
| ↑ / ↓ | Volume ±10% | |
| f | Fullscreen toggle | |
| m | Mute toggle | |
| p | Picture-in-Picture toggle | |
| c | Cycle subtitle tracks | |
| a | Set A/B loop start point | |
| b | Set A/B loop end point | |
| Escape | Clear A/B loop | |
| z | Cycle zoom presets (1× → 1.5× → 2× → 1×) | |
| 0–9 | Jump 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.
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.Returns saved watch position for the current session. Requires the mpsid cookie.
| Param | Description | |
|---|---|---|
| id | required | IMDB or TMDB content ID |
{
"position": 1234, // seconds
"duration": 7200, // total duration
"percent": 17, // 0–100
"ts": 1710000000000
}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 field | Description | |
|---|---|---|
| position | required | Current position in seconds (number) |
| duration | optional | Total 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.
Returns a WebVTT manifest mapping time ranges to sprite sheet coordinates.
https://apiplayer.ru/api/v/_t/tt1375666202 Accepted while generating, 200 with text/vtt content when ready.Returns the JPEG sprite sheet. Tiles are 160×90px at 10-second intervals.
https://apiplayer.ru/api/v/_t/tt1375666/spriteList Available Subtitles
Returns available subtitle languages for a given content ID (from OpenSubtitles).
| Param | Description | |
|---|---|---|
| id | required | IMDB or TMDB content ID |
https://apiplayer.ru/api/v/_s/tt1375666[
{ "lang": "en", "label": "English" },
{ "lang": "es", "label": "Spanish" }
]Fetch Subtitle File
Returns subtitle content in VTT format for the specified language.
| Param | Description | |
|---|---|---|
| id | required | IMDB or TMDB content ID |
| lang | required | ISO 639-1 language code (e.g. en, fr) |
https://apiplayer.ru/api/v/_s/tt1375666/entext/vtt content type. Use this URL directly as a subtitle source in your own player.List Latest Movies
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
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
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"
}
]
}