IPTVBlog
Search IPTVBlog

Guide· intermediate

Xtream Codes API explained: what player apps call and reveal

The Xtream Codes API from the operator's side: player_api.php actions, get.php, xmltv.php, stream URLs, line logins, and why credentials in URLs matter.

By
Published
Reading time
7 min · 1,616 words
Glowing data packets with envelopes and keys travelling from a small server to a phone, a tablet and a screen

Numbers are rules of thumb

Sizing figures here are labelled estimates from operating experience, not measurements of your setup. Test with your own channel list and audience before committing.

The Xtream Codes API is the interface almost every IPTV player app uses to talk to your panel. This guide explains it from the operator’s side. You get the endpoints apps call, what each one returns, how a line’s username and password act as the only key, and what that means for leaks, rate limits and sharing. It ends with how Xtream UI, XUI One and IPTVOS expose it.

Short version: Apps log in with three fields: server, username, password. They call player_api.php for JSON, get.php for an M3U playlist, xmltv.php for the guide, and play streams from URLs like /live/USER/PASS/ID.ts. Credentials sit in every URL, so they end up in logs, proxies and screenshots; treat a line’s password as public once it is in use. Protect the panel with HTTPS, failed-login limits, connection limits and sharing checks.

Note: this guide names Xtream UI and XUI One for context only. Xtream UI is unmaintained and XUI One is proprietary; the API itself outlived both.

Where the API came from

Xtream Codes was a commercial panel. Its client API was simple: plain HTTP, query strings, JSON answers. App developers adopted it because one login form then worked with thousands of panels.

The original product is gone. The API stayed. Xtream UI, XUI One and newer panels copy it closely, because breaking it would break every app your customers already use.

So treat it as a convention, not a spec. Field names and URL shapes below are the common ones. Your panel may add fields or variants, so check its documentation.

The three-field login

A customer types three things into an app: the server URL, a username and a password. The username and password belong to a line, the panel’s word for one customer subscription.

There is no token exchange and no session in the classic flow. The app sends the same username and password with every request. The panel checks them each time, along with the line’s status, expiry and connection count.

That one design choice explains most of the security notes later in this guide.

Flow of a player app session: the app logs in at player_api.php, the panel returns user_info and server_info, the app loads categories and streams, then plays a stream URL from a load balancer

player_api.php: the JSON side

Every call goes to the same file with the credentials in the query string:

https://panel.example.com/player_api.php?username=demo_user&password=demo_pass

The login call

Without an action, the panel answers with two objects. user_info holds the line: auth, status, exp_date, is_trial, max_connections, active_cons and allowed_output_formats. server_info holds the URL, ports, protocol, time zone and the server’s current time.

Apps use this answer to show “expires on” and to decide whether to build .ts or .m3u8 links. They also take the host and port from server_info for later stream URLs. That last point matters for security, as you will see below.

The content actions

Apps then call actions one by one. The common set:

Action Returns
get_live_categories Live channel groups
get_live_streams (optional category_id) Channels with stream_id, icon, EPG id, tv_archive flag
get_vod_categories, get_vod_streams Movie groups and movies with container_extension
get_vod_info&vod_id= Details for one movie
get_series_categories, get_series Series groups and series
get_series_info&series_id= Seasons and episodes with their ids
get_short_epg&stream_id=&limit= The next few guide entries for one channel
get_simple_data_table&stream_id= The full guide for one channel, with catch-up flags

A fresh login in a full-featured app often fires many of these within seconds. Some apps load every category’s streams in a loop. Keep that burst in mind when you set rate limits.

get.php and xmltv.php

Not every app builds its own menus. Simple players and set-top box apps want one playlist file. For them the panel serves:

https://panel.example.com/get.php?username=demo_user&password=demo_pass&type=m3u_plus&output=ts

type=m3u_plus adds attributes such as tvg-id, tvg-logo and group-title to each line. Plain m3u leaves them out, and output chooses ts or m3u8 links. The playlist contains every stream URL for the line, credentials included, so it is a complete copy of the account.

The guide comes from xmltv.php with the same two parameters. It returns XMLTV for every channel on the line.

On a large line that file is heavy, and apps that refresh it often add load to whichever server answers. The EPG guide covers what goes into that file and how to keep it correct.

Stream URL shapes

Once the app knows a stream_id, it builds the playback URL itself. The common forms:

https://panel.example.com/live/demo_user/demo_pass/1234.ts
https://panel.example.com/live/demo_user/demo_pass/1234.m3u8
https://panel.example.com/movie/demo_user/demo_pass/5678.mkv
https://panel.example.com/series/demo_user/demo_pass/9012.mp4
https://panel.example.com/timeshift/demo_user/demo_pass/60/2026-11-12:20-00/1234.ts

The movie and episode extension comes from container_extension in the API answer. Many panels also accept a short live form, /demo_user/demo_pass/1234, which older apps still use. The catch-up guide explains the timeshift form.

In a multi-server setup the first request usually hits the main server. It checks the line and redirects the player to a load balancer that carries the stream. The redirect target often carries the credentials or a token, depending on the panel.

What the API reveals

Look at the same traffic as an attacker would. Four things stand out.

Credentials in every URL

The password sits in the path or query string of every request. It lands in web server access logs, reverse proxy and CDN logs, and browser history. Players show it in “account info” screens, and customers post those screenshots in support chats.

Over plain HTTP, anyone on the path can read it too. Many panels still default to HTTP for player traffic, because old apps and boxes handle HTTPS badly. Offer HTTPS, and test it on the apps you support before you force it.

Rule of thumb: assume a line’s password is known to more people than its owner. Resetting it is cheap. Make that easy in your support process.

Account data

user_info tells anyone with the credentials when the line expires and how many connections it allows. That is mild.

server_info and the redirects can be worse. If they point at a raw IP address, they reveal your origin server. That undoes a Cloudflare setup for the panel domain. The security checklist covers origin protection in detail.

Guessable ids

Stream ids are small integers. Anyone with one working line can walk the id range and see what the line’s bouquets allow. That is by design. It does mean that a line with “all bouquets” gives a reseller’s whole catalogue to whoever holds it.

Sharing and restreaming

Since the credentials are the whole key, sharing a line is copying three strings. The panel’s only built-in brake is max_connections. A shared line shows up as many IP addresses, often from different countries, within a day. A restreamer shows up as one line with a long, steady stream from a data-centre IP.

Anatomy of an Xtream stream URL: host, type, username, password, stream id and extension, with the places where the URL ends up such as access logs, proxy logs, screenshots and shared playlists

Rate limits that do not break real apps

Brute-force attempts against player_api.php and get.php are routine on any public panel. You want to stop them without locking out a family whose three apps log in at once.

Some rules of thumb, which you should test against your own logs:

  • Limit failed logins per IP and per username, not successful requests. A failed burst is a clear signal; a busy household is not.
  • Lock an IP for minutes after repeated failures, then for longer if it continues. Permanent bans catch shared mobile carrier addresses.
  • Put a separate, looser limit on xmltv.php and get.php. Apps refresh them on a timer, and one broken app can loop.
  • Log the username and the result, not the full URL. Strip passwords from access logs where your web server allows it.

How the panels expose it

Xtream UI serves the classic endpoints from its bundled PHP stack on the main server and load balancers. It is unmaintained, and its PHP is end-of-life. Any API weakness in it stays unfixed unless you patch it. The Xtream UI guide covers its structure.

XUI One keeps the same client API, so apps cannot tell the two apart. It is proprietary, so you rely on the vendor for fixes and for any extra controls. Check your version’s release notes for what it adds.

IPTVOS, an advertiser on IPTVBlog, speaks the Xtream Codes API, M3U and Enigma2. It serves the guide through xmltv.php, the M3U url-tvg and player_api.php. It accepts the XUI-style /playlist/USER/PASS/m3u_plus URL.

Its default playlist links are encrypted /play/<token> links, while classic Xtream URLs keep working. On the security side it lists brute-force limits, line restrictions by IP, country and app, sharing detection and stream links bound to the viewer.

Its limits: IPTVOS is still in beta, it delivers only HLS and MPEG-TS, and it has no importer for Xtream UI or XUI One databases. The IPTVOS review has the full list.

What to do next

  1. Open your panel’s access logs and check whether passwords appear in plain text. If they do, change the log format or shorten retention.
  2. Log in with a test line in your top three apps and watch the request burst. Set failed-login limits above that, using the security checklist as a base.
  3. Call player_api.php with a test line and read server_info. Make sure it shows your public domain, not an origin IP.
  4. Review sharing alerts weekly, and reset passwords for lines that show up from many places. The player apps comparison helps you see which apps your customers use.

Questions people ask

What is the Xtream Codes API?

It is the HTTP interface that player apps use to log in to an IPTV panel and fetch channels, movies, series and the guide. It started in the Xtream Codes panel and became a de facto standard. Most panels and most player apps speak it today, so one line works in many apps.

What does player_api.php return without an action?

A login check. With a valid username and password it returns user_info (status, expiry date, maximum connections, active connections, allowed formats) and server_info (the URL, ports, protocol and time zone the app should use). With wrong credentials it returns an auth value of 0.

Is the Xtream Codes API secure?

Not by design. The line's username and password travel in every URL, often over plain HTTP, and land in logs and shared screenshots. You make it safer with HTTPS, rate limits on failed logins, connection limits, sharing detection and short-lived or bound stream links where your panel supports them.

What is the difference between get.php and player_api.php?

get.php returns the whole line as one M3U playlist for apps that only read playlists. player_api.php returns JSON in small pieces, one action at a time, for apps that build their own menus. Both use the same line credentials.

Do I need the Xtream Codes software to offer the API?

No. The original Xtream Codes product is gone. Xtream UI, XUI One, IPTVOS and other panels implement the same client API, so apps that log in with server, username and password work against any of them.

Topicsxtream-codes-apiplayer-appssecurityoperations

Comments

Keep reading