Home Reseller Hub Restream Feeds Providers Reviews Compare Locations Sports Devices Player Apps Troubleshooting Glossary Domains (29) Legal Live TV
Technical Encyclopedia 2026

What is Xtream Codes API Protocol?

Protocol Definition & Architecture: Definition And Guide

Technical Definition

A REST-style HTTP API used by IPTV panels to authenticate a line and deliver live, VOD, series, and EPG metadata as JSON. Players call player_api.php with a username and password and receive user_info and server_info objects, then request categories and streams by action parameter.

How It Operates Under the Hood

Stream URLs are constructed as http://host:port/live/USER/PASS/STREAM_ID.ts (or .m3u8), http://host:port/movie/USER/PASS/ID.ext, and http://host:port/series/USER/PASS/ID.ext. EPG is fetched from xmltv.php and M3U playlists from get.php?type=m3u_plus.

Beginner to Engineer Guide

Xtream Codes API Protocol matters to subscribers because it directly affects how quickly a channel starts, how stable it stays, and how the guide and catch-up behave. For resellers it determines which players and devices to recommend and which panel settings to expose.

Protocol Engineering Specifications

Stream Engineering Metric Reference Specification Governing Standard
Auth endpoint player_api.php?username&password JSON over HTTP/1.1
Catalog actions get_live_categories, get_live_streams, get_vod_streams, get_series Query parameter action=
Ports 8080 (HTTP), 2086 / 443 (HTTPS) server_info.https_port
Transport Container MPEG-TS (188 bytes: 4 B header + 184 B payload, 0x47 sync) ISO/IEC 13818-1
Manifest Specification Extended M3U8 playlist / LL-HLS 0.5 s parts IETF RFC 8216
Decoder Pipeline Hardware MediaCodec HEVC Main 10 (ExoPlayer / Media3) Android Media3

Xtream Codes v2 REST API Deep-Dive

Every modern player connects Reference Panel through the same HTTP handshake. The sequence below is what TiviMate, IPTV Smarters, and XCIPTV execute on login; you can reproduce each call in a browser or with curl.

1 Authentication handshake

HTTP Request
GET http://line.server.example.com:8080/player_api.php?username=USERNAME&password=PASSWORD
JSON Response (user_info + server_info)
{
  "user_info": {
    "username": "USERNAME",
    "status": "Active",
    "auth": 1,
    "exp_date": "1798761600",
    "is_trial": "0",
    "active_cons": "1",
    "max_connections": "5",
    "allowed_output_formats": ["m3u8", "ts", "rtmp"]
  },
  "server_info": {
    "url": "line.server.example.com",
    "port": "8080",
    "https_port": "2086",
    "server_protocol": "http",
    "timezone": "UTC",
    "timestamp_now": 1759795200
  }
}

auth must equal 1 and status "Active". exp_date is a Unix timestamp; max_connections caps concurrent streams; https_port exposes the TLS listener used to defeat SNI-based shaping.

2 Live category indexing & stream URL construction

action=get_live_categories
GET http://line.server.example.com:8080/player_api.php?username=USERNAME&password=PASSWORD&action=get_live_categories
Category Index
[
  { "category_id": "12", "category_name": "UK | SKY SPORTS", "parent_id": 0 },
  { "category_id": "18", "category_name": "USA | ESPN & FOX SPORTS", "parent_id": 0 },
  { "category_id": "41", "category_name": "24/7 | PPV EVENTS", "parent_id": 0 }
]
action=get_live_streams + stream URL template
GET http://line.server.example.com:8080/player_api.php?username=USERNAME&password=PASSWORD&action=get_live_streams&category_id=12
# Stream URL template returned per stream_id:
http://line.server.example.com:8080/live/USERNAME/PASSWORD/STREAM_ID.ts
http://line.server.example.com:8080/live/USERNAME/PASSWORD/STREAM_ID.m3u8

3 EPG XMLTV synchronisation routine

XMLTV fetch (gzip) + short EPG
curl -sS --compressed "http://line.server.example.com:8080/xmltv.php?username=USERNAME&password=PASSWORD" -o guide.xml
# Short-form EPG for a single channel (JSON, base64 descriptions):
GET http://line.server.example.com:8080/player_api.php?username=USERNAME&password=PASSWORD&action=get_short_epg&stream_id=STREAM_ID&limit=4
XMLTV excerpt (tvg-id must match channel id)
<?xml version="1.0" encoding="UTF-8"?>
<tv generator-info-name="Reference Panel EPG">
  <channel id="skysportsmainevent.uk">
    <display-name>Sky Sports Main Event</display-name>
    <icon src="https://cdn.example/logos/ssme.png"/>
  </channel>
  <programme start="20261006190000 +0000" stop="20261006210000 +0000" channel="skysportsmainevent.uk">
    <title lang="en">Premier League Live</title>
    <desc lang="en">Live coverage, 50 fps.</desc>
    <category lang="en">Sports</category>
  </programme>
</tv>

4 M3U extended playlist equivalent

M3U Plus formatting string
#EXTM3U
#EXTINF:-1 tvg-id="skysportsmainevent.uk" tvg-name="Sky Sports Main Event" tvg-logo="https://cdn.example/logos/ssme.png" group-title="UK | SKY SPORTS",Sky Sports Main Event FHD
http://line.server.example.com:8080/live/USERNAME/PASSWORD/10231.ts
# Full playlist export:
http://line.server.example.com:8080/get.php?username=USERNAME&password=PASSWORD&type=m3u_plus&output=ts

Xtream Codes API Protocol FAQ

What is Xtream Codes API Protocol in simple terms?

A REST-style HTTP API used by IPTV panels to authenticate a line and deliver live, VOD, series, and EPG metadata as JSON. Players call player_api.php with a username and password and receive user_info and server_info objects, then request categories and streams by action parameter.

Is Xtream Codes API the same as the original Xtream Codes software?

The protocol survived the 2019 shutdown of the original company and is now implemented by XUI.one, Xtream UI forks, and most commercial panels, so player apps remain compatible.

What is the difference between Xtream Codes API, M3U URL, and Stalker Portal login?

All three deliver the same channels. Xtream Codes API uses player_api.php JSON endpoints so the player lazy-loads categories and EPG in seconds. An M3U URL (get.php) downloads a single text playlist of every stream, which is slow with 45,000 channels but works on any player. Stalker Portal authenticates by MAC address through a /c/ portal URL and is used by MAG receivers and some Smart TV apps.

Why is my EPG guide empty or showing programs at the wrong time?

Players fetch an XMLTV file from xmltv.php and match each channel by tvg-id. An empty guide means the player downloaded the file before the server finished its 15-minute refresh or the file exceeded the player size cap (set TiviMate EPG update to "never limit"). Wrong times are a timezone offset issue: XMLTV timestamps carry +0000 and the player must apply your local offset, so set an EPG shift of +1 or -5 hours in the channel settings rather than changing the device clock.

How far behind live are IPTV sports streams and can latency be reduced?

Standard HLS with 4-second segments and a 3-segment player window sits 12-18 seconds behind the broadcast. Low-Latency HLS with 0.5-second partial segments brings glass-to-glass delay to about 3.8 seconds, and raw MPEG-TS over HTTP (.ts output format) is typically 5-7 seconds behind. Choose the .ts output format in your player for live sports and reserve .m3u8 for VOD and catch-up.

What buffer size should I set in TiviMate, Smarters, or XCIPTV for 4K sports?

Set the largest option (5,000 ms in TiviMate, "Large" in Smarters). Buffer time in seconds equals buffer bytes multiplied by 8, divided by the stream bitrate in Mbps: a 15 MB allocation on an 18.5 Mbps 4K feed yields 6.5 seconds of protection, which covers typical ISP shaping bursts of 2-4 seconds without a visible freeze.

Do providers offer a free trial and how long does activation take?

Every network in this directory issues 24-hour trial lines from the reseller panel. Activation is instant: the panel writes the line to the Xtream database and the player can authenticate within 10 seconds. Trial lines are usually limited to 1 connection and exclude PPV bouquets.

Verified Engineering Standards & Official Documentation
Authoritative Sources Only

Every external citation on this page points to a primary source: telecommunications RFCs, ITU-T and ISO codec standards, manufacturer and developer documentation, national regulators, or official sports governing bodies. No commercial IPTV competitor is cited.

Primary Specification
IETF RFC 3986 (URI syntax used by player_api.php requests)
The governing specification or official documentation for Xtream Codes API Protocol.
Read Official Documentation
Protocol Standard
IETF RFC 8216 (HTTP Live Streaming - HLS)
Official Internet Engineering Task Force specification for adaptive bitrate video chunking, master/media M3U8 manifests, and EXT-X tag semantics.
Read Official Documentation
Video Codec Standard
ITU-T Recommendation H.265 (HEVC)
International Telecommunication Union specification for High Efficiency Video Coding (Main / Main 10 profiles), enabling 4K 60fps delivery at roughly half the H.264 bitrate.
Read Official Documentation
Transport Protocol
ISO/IEC 13818-1 (MPEG-2 Transport Stream)
International standard defining MPEG-TS packetization (188-byte packets, 0x47 sync byte, PID multiplexing, PCR clock recovery) used in raw IPTV broadcast streams.
Read Official Documentation
Network Infrastructure
Cloudflare 1.1.1.1 DNS over HTTPS Documentation
Global ultra-low latency resolver with RFC 8484 DNS-over-HTTPS and DNS-over-TLS endpoints that bypass ISP resolver throttling.
Read Official Documentation
Network Diagnostics
Wireshark Network Protocol Analyzer Documentation
The industry-standard packet analyzer used for auditing MPEG-TS continuity errors, TCP retransmissions, and jitter diagnostics.
Read Official Documentation
Wholesale Desk Online