Preloader
Developer Reference

Xtream Codes API: player_api.php Documentation for Developers and Panel Owners

Every player_api.php action with its parameters, the live, movie and series stream URL formats, curl examples, M3U conversion and how the Xtream Codes compatible API works in Xtream-Masters.

Published: 3 November 2026


Short answer The Xtream Codes API is the JSON interface IPTV panels expose through player_api.php. Apps authenticate with a GET request to http://SERVER:PORT/player_api.php?username=USER&password=PASS and add an action parameter to list categories, live streams, VOD, series and EPG. Xtream-Masters panels expose a fully compatible API, so standard Xtream Codes players work unchanged.
Xtream Codes API key facts
Endpoint fileplayer_api.php on the streaming server: http://SERVER:PORT/player_api.php
MethodHTTP GET
Authenticationusername and password of a line, sent as query parameters on every request
Response formatJSON, UTF-8
PortThe streaming port of your panel, not the admin panel port
Live stream URL/live/USER/PASS/STREAM_ID.ts or .m3u8
Movie (VOD) URL/movie/USER/PASS/STREAM_ID.EXT
Series episode URL/series/USER/PASS/EPISODE_ID.EXT
EPGxmltv.php (full XMLTV guide), get_short_epg and get_simple_data_table (per stream)
M3U playlistget.php?username=USER&password=PASS&type=m3u_plus&output=ts
Compatible playersApps with an "Xtream Codes" or "Xtream API" login, and the Xtream-Masters white-label player
Official referenceXtream-Masters Player API documentation
Who this page is for: app developers and panel owners. Every request needs a line (username and password) issued by your own panel or by your provider. This page does not list or provide accounts, codes or playlists.

How the Xtream Codes API works

The Xtream Codes API started in the Xtream Codes panel and became the de facto standard for IPTV players. Panels in the same family, such as Xtream UI, XUI.ONE and Xtream-Masters, keep the same player_api.php interface so existing apps keep working. A player app follows the same flow on every compatible panel:

Login: player_api.phpCategoriesStreams per categoryVOD / series infoPlay the stream URL
  1. Login. The app calls player_api.php with only username and password. The response holds user_info (account status, expiry, connections) and server_info (URL, ports, protocol, timezone).
  2. Browse. The app adds action=get_live_categories, get_vod_categories or get_series_categories, then loads the streams of a category.
  3. Details. For movies and series it calls get_vod_info or get_series_info to get metadata, seasons and episodes.
  4. Play. The app builds the stream URL from the server, the credentials and the stream ID (see stream URL formats).

player_api.php endpoint reference

All actions are GET requests to http://SERVER:PORT/player_api.php?username=USER&password=PASS plus the parameters below. Parameter names are exactly as the panel expects them.

ActionExtra parametersReturns
(no action)noneAuthentication: user_info and server_info
get_live_categoriesnoneLive TV categories
get_live_streamscategory_id (optional)All live streams, or the streams of one category
get_vod_categoriesnoneVOD (movie) categories
get_vod_streamscategory_id (optional)All movies, or the movies of one category
get_vod_infovod_id (required)Details of one movie
get_series_categoriesnoneSeries categories
get_seriescategory_id (optional)All series, or the series of one category
get_series_infoseries_id (required)Details of one series with its seasons and episodes
get_short_epgstream_id (required), limit (optional)Short EPG (upcoming programmes) for one live stream
get_simple_data_tablestream_id (required)All EPG data for one live stream

The full XMLTV guide for all streams is a separate file: http://SERVER:PORT/xmltv.php?username=USER&password=PASS.

Xtream-Masters extras: the Xtream-Masters Player API reference also documents get_vod_latest and get_series_latest (the 100 latest added movies or series) and action=search with type=live, movies or series and a URL-encoded context search string. Other panels may not support these, so check before you depend on them.

Stream URL formats

Stream URLs are not returned as full links. The app builds them from the server address, the credentials and the IDs from the API responses. Replace the placeholders with your own values:

# Live TV (MPEG-TS or HLS) http://SERVER:PORT/live/USER/PASS/STREAM_ID.ts http://SERVER:PORT/live/USER/PASS/STREAM_ID.m3u8 # Movie: STREAM_ID and EXT (container_extension) come from get_vod_streams / get_vod_info http://SERVER:PORT/movie/USER/PASS/STREAM_ID.EXT # Series episode: EPISODE_ID and EXT come from the episodes list in get_series_info http://SERVER:PORT/series/USER/PASS/EPISODE_ID.EXT

Which live formats a line may use is listed in user_info.allowed_output_formats of the login response (for example m3u8, ts, rtmp).

Example requests with curl

Use -G with --data-urlencode so special characters in usernames and passwords are encoded correctly.

Authenticate (login)

curl -G "http://SERVER:PORT/player_api.php" \ --data-urlencode "username=USER" \ --data-urlencode "password=PASS"

List live categories, then the streams of one category

curl "http://SERVER:PORT/player_api.php?username=USER&password=PASS&action=get_live_categories" curl "http://SERVER:PORT/player_api.php?username=USER&password=PASS&action=get_live_streams&category_id=CATEGORY_ID"

Movie details, series episodes and short EPG

curl "http://SERVER:PORT/player_api.php?username=USER&password=PASS&action=get_vod_info&vod_id=VOD_ID" curl "http://SERVER:PORT/player_api.php?username=USER&password=PASS&action=get_series_info&series_id=SERIES_ID" curl "http://SERVER:PORT/player_api.php?username=USER&password=PASS&action=get_short_epg&stream_id=STREAM_ID&limit=4"

Login response structure

A successful login returns two objects. The field names below are from the Xtream-Masters Player API reference; the values are placeholders. Many numeric fields arrive as strings, and exp_date and created_at are Unix timestamps.

{ "user_info": { "username": "USER", "password": "PASS", "message": "...", "auth": 1, "status": "Active", "exp_date": "UNIX_TIMESTAMP", "is_trial": "0", "active_cons": "0", "created_at": "UNIX_TIMESTAMP", "max_connections": "1", "allowed_output_formats": ["m3u8", "ts", "rtmp"] }, "server_info": { "url": "SERVER", "port": "PORT", "https_port": "HTTPS_PORT", "server_protocol": "http", "rtmp_port": "RTMP_PORT", "timezone": "UTC", "timestamp_now": UNIX_TIMESTAMP, "time_now": "YYYY-MM-DD HH:MM:SS" } }

Check user_info.auth (1 means logged in) and user_info.status before you load content, and use server_info to pick the protocol and port for stream URLs.

Xtream Codes API vs M3U playlist

The same line works both ways. To turn an Xtream Codes API login into an M3U playlist, call get.php with the same credentials:

http://SERVER:PORT/get.php?username=USER&password=PASS&type=m3u_plus&output=ts # output=m3u8 for HLS instead of MPEG-TS
PointXtream Codes API (player_api.php)M3U playlist (get.php)
FormatJSON, one request per screen or categoryOne text file with every stream
Movies and seriesSeparate sections with info, seasons and episodesFlat list of entries
EPGget_short_epg, get_simple_data_table, xmltv.phpSeparate XMLTV URL (xmltv.php)
Account infoExpiry, status and connections in user_infoNot included
Loading speed on large listsLoads only what the screen needsDownloads and parses the whole file
Best forPlayer apps with live, VOD and series sectionsSimple players, set-top boxes and quick tests

Xtream Codes compatible API in Xtream-Masters

The Xtream-Masters OTT panel exposes four APIs. Two are for player apps, two are for automating your business:

APIUsed byWhat it doesDocumentation
Player APIPlayer appsXtream Codes compatible player_api.php: login, content lists, EPGPlayer API
ActiveCode APIActiveCode player appsPlayer API login with a device-bound ActiveCode instead of username and password. The mac (Device ID) parameter is required on every API, stream and EPG URLActiveCode API
Reseller APIReseller websites and botsAutomate reseller operationsReseller API
Admin APIYour own back officeCreate and manage client accounts, generate subscription links, handle admin accessAdmin API

How to enable each API

Player API

Nothing to enable. Every active line can call player_api.php on your streaming port. For ActiveCode apps, see ActiveCode IPTV player app.

Reseller API

Admin Menu, Reseller Members, Members Group: edit the reseller group and allow Reseller Use API. Then Admin Menu, System Security, Access Codes: create a reseller API access code (end-point). The reseller creates the key under Reseller Menu, API Documentation.

Admin API

Menu, Admin API: create an API key. Then Menu, System Security, Access Codes: create an admin API access code (end-point).

Security

  • Access codes: the Reseller and Admin APIs only answer on the access code (end-point) you create, not on a public default path.
  • Keep keys on your server: never put a Reseller or Admin API key inside an app. Call those APIs from your own backend. Rotate API keys quarterly, as the panel FAQ recommends.
  • Firewall: keep admin and SSH ports limited to known IP addresses and open only the streaming ports your customers need.
  • Abuse protection: Server Guard in front of every Xtream-Masters server filters Layer-7 DDoS, brute-force and API abuse.

Coming from another panel? Your lines keep working with the same apps after a move, because the Player API stays Xtream Codes compatible. See migrate Xtream UI or XUI.ONE to Xtream-Masters, NXT panel alternative, Xtream Codes alternative and best IPTV panel software.

Common errors and fixes

SymptomLikely causeFix
"auth": 0, empty user_info, or HTTP 401 / 403Wrong username or password, or the line is disabled, banned or expired. Panels differ in which of these they returnCheck the line in the panel, its status and exp_date. URL-encode special characters in the credentials
Connection refused or timeoutWrong port, often the admin panel port instead of the streaming port, or a firewall ruleUse the streaming port shown in server_info.port and make sure it is open
Works over HTTP, fails over HTTPSSSL is not set up on that port, or the app uses the HTTP port with https://Use http://, or https:// with server_info.https_port once SSL is configured
Login works, streams do not playOutput format not allowed, too many connections, or a wrong extensionCompare with allowed_output_formats, active_cons and max_connections, and use container_extension for movies and episodes
Requests start failing after many callsBrute-force or flood protection blocking the client IPCache category and stream lists instead of requesting them on every screen, and stop retrying failed logins in a loop
ActiveCode login failsMissing mac (Device ID) on one of the URLsSend the same Device ID on every API, stream and EPG URL
Building your own app? If you would rather not maintain an API client, Xtream-Masters delivers a branded white-label IPTV player that already speaks the Xtream Codes API, with an ActiveCode version for device-bound logins. Comparing ready apps first? Read IPTV Smarters alternative and TiviMate alternative.

Sources: Xtream-Masters Player API documentation, ActiveCode API documentation and OTT panel FAQ, checked 3 November 2026.

Xtream Codes Compatible

Xtream-Masters OTT Panel

Player, ActiveCode, Reseller and Admin APIs in one panel

Install on your own Ubuntu server (20.04 to 26.04), keep your existing Xtream Codes apps working and automate resellers and accounts through the API.

Xtream-Masters OTT panel dashboard with Xtream Codes compatible Player API
OTT Panel License €40/Month

€40/month until 31 Dec 2026, then €70/month from 1 January 2027.

  • Xtream Codes compatible player_api.php
  • Reseller API and Admin API with access codes
  • ActiveCode API for device-bound logins
  • Main server + unlimited load balancers
Get Your License
Xtream Codes API Questions

Xtream Codes API: FAQ

01

What is the Xtream Codes API?

The Xtream Codes API is the HTTP interface that IPTV panels expose through player_api.php. An app sends a GET request with a username and password to http://SERVER:PORT/player_api.php and receives JSON with the account status, server details and, with the action parameter, live, VOD, series and EPG data.

02

Is player_api.php the same in Xtream UI, XUI.ONE and Xtream-Masters?

The core is the same: the same login URL, the same main actions (categories, streams, VOD info, series info, short EPG) and the same live, movie and series stream URL formats. That is why one player app works with all of them. Extra actions can differ by panel, so check your panel's own reference before you rely on them.

03

How do I convert an Xtream Codes API login to an M3U playlist?

Use the same server, port, username and password in the get.php endpoint: http://SERVER:PORT/get.php?username=USER&password=PASS&type=m3u_plus&output=ts. Use output=m3u8 for HLS instead of MPEG-TS. The result is a standard M3U playlist with categories that any M3U player can open.

04

Which players support Xtream Codes API login?

Most IPTV players have an Xtream Codes or Xtream API login screen that asks for the server URL, username and password. Panel owners who want their own branded app can order the Xtream-Masters white-label player, which logs in through the same player_api.php endpoints.

05

How do I enable the API in Xtream-Masters?

The Player API is available to every line on your streaming port, no extra switch is needed. For the Reseller API, edit the reseller group under Reseller Members, Members Group and allow it to use the API, then create a reseller access code under System Security, Access Codes. For the Admin API, create an API key under Admin API and an admin access code under System Security, Access Codes.

06

Do I need an account to use the Xtream Codes API?

Yes. Every player_api.php request needs a line (username and password) that was created in your own panel or issued by your provider. This page documents the API for developers and panel owners. It does not provide accounts, codes or playlists.

Important Legal Notice
Xtream-Masters is a software development company. We build and license professional software. We don't host, store, stream, index, or distribute any audio, video, playlists, channels, or DRM-protected content of any kind. What we sell is an empty technical platform; whatever content runs through it is added, configured, and controlled entirely by the end user, who is responsible for holding the proper rights and following the law in their region. Any copyright or DMCA complaints should go to whoever is operating the stream or hosting the URL in question, not to us. For the full picture, have a look at our Terms, Privacy Policy, and Refund Policy.