
Guide
Catch-up TV and timeshift: how they work and what they cost
Catch-up TV and timeshift for IPTV operators: recording windows, a worked storage example, where recordings live, Xtream timeshift URLs, players and rights.
Guide· intermediate
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.

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.phpfor JSON,get.phpfor an M3U playlist,xmltv.phpfor 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.
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.
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.
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
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.
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.
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.
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.
Look at the same traffic as an attacker would. Four things stand out.
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.
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.
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.
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.
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:
xmltv.php and get.php. Apps refresh them on a timer, and one broken app can loop.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.
player_api.php with a test line and read server_info. Make sure it shows your public domain, not an origin IP.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.
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.
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.
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.
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.

Guide
Catch-up TV and timeshift for IPTV operators: recording windows, a worked storage example, where recordings live, Xtream timeshift URLs, players and rights.

Guide
How IPTV load balancers work: origin and relay servers, one provider connection per channel, GeoIP routing, failover, common faults and a sizing rule of thumb.

Guide
How an IPTV EPG works: XMLTV sources (.xml, .xml.gz), priorities, matching channels by name and country, time offsets, how apps fetch the guide, and fixes.
Comments