Skip to content
FreeIPTV.codes
IPTV Guides

Xtream Codes API Explained: Login & Setup

Editorial Team9 min readReviewed Oct 30, 2026
Diagram of an Xtream Codes login with server URL, username and password connecting a player to an IPTV service
Diagram of an Xtream Codes login with server URL, username and password connecting a player to an IPTV service

Xtream Codes is a login method, not a file format. Instead of a single M3U URL, your player receives a server address, a username and a password. It sends those to the server, receives a structured list of categories, channels, films and series, and builds its own interface from that data.

Quick answer: Enter the server URL (with its port), username and password into your player's "Xtream Codes" or "Xtream API" option. The player handles the rest, including the EPG in most cases.

Xtream Codes vs M3U: What Is the Difference?

M3U playlistXtream Codes login
What you receiveOne long URL to a text fileServer URL, username, password
Data formatPlain-text channel listJSON responses from an API
Channel listFixed when the file is generatedRequested live by the player
CategoriesInline group-title attributesSeparate category endpoints
VOD and seriesOften flattened or absentSeparate film and series endpoints
EPGSeparate XMLTV URLUsually derived from the same server
Failure modeA dead URL breaks everythingOne failed request breaks one section
Credential exposureURL onlyCredentials appear in every request URL

The short version: an M3U is a snapshot, while Xtream is a live query. That is why Xtream logins often feel faster to browse, and why a single wrong password breaks every section at once.

If you are not sure which one your provider gave you, check what you were sent: a single long link is an M3U; three separate values are Xtream. Our playlist guide explains the M3U side in detail.

The Three Fields

Server URL

The address of the panel, usually with a port:

http://server.example.com:8080

Use exactly what the provider supplied — including http:// versus https:// and the port. Do not append /player_api.php in a player's server field; the app adds the endpoint itself. A trailing slash is usually tolerated, but the scheme and port are not.

Username and Password

These are the account credentials, not your email login to a website. They are case-sensitive, and some panels generate them with characters that are easy to misread — l, 1 and I, or 0 and O.

Optional: Output Format

Some players ask for an output preference. .ts tends to start faster and is more tolerant of older devices; .m3u8 is HLS and handles adaptive bitrate better. If one stutters, try the other.

How the API Works

A player authenticates by calling the panel's API with your credentials:

/player_api.php?username=USER&password=PASS

That first response returns account status, expiry date and the server's connection details. The player then requests the sections it needs:

ActionReturns
get_live_categoriesLive TV groups
get_live_streamsLive channels, with stream IDs
get_vod_categoriesFilm groups
get_vod_streamsFilms, with stream IDs
get_seriesSeries list
get_series_infoSeasons and episodes for one series

The M3U export and the guide use different endpoints on the same server:

/get.php?username=USER&password=PASS&type=m3u_plus&output=ts
/xmltv.php?username=USER&password=PASS

That first URL is why providers can offer "M3U or Xtream" for the same account: the panel can generate an M3U from the same data. It also means you can convert an Xtream login into an M3U URL if a player only accepts playlists — at the cost of losing the separate on-demand sections.

Adding an Xtream Login to Common Players

TiviMate

  1. Add playlist → Xtream Codes.
  2. Enter the server URL, username and password.
  3. Set the EPG source if the player does not detect one automatically.
  4. Choose which sections to import — live TV, films, series — so the app does not load content you never watch.

IPTV Smarters Pro

  1. Choose Login with Xtream Codes API on the first screen.
  2. Enter a profile name, then the three credentials.
  3. Save and let it sync. The full walkthrough is in our IPTV Smarters Pro setup guide.

Android TV and Fire TV

The same fields appear in most players. On a Fire Stick, the on-screen keyboard is the weakest link — send the credentials to yourself and paste them instead of typing. See Fire Stick IPTV setup for the install side.

VLC and Desktop Players

VLC does not speak Xtream natively. Use the /get.php M3U export URL in VLC instead. The player will load the channel list, but not films, series or the guide.

Common Xtream Login Errors

ErrorCauseFix
401 / "invalid username or password"Wrong credentials, expired plan, or blocked accountRe-paste credentials, check expiry in the portal
403Server rejects the request — often a blocked IP or expired accountTry another network; contact the provider
Empty channel list, valid loginAccount has no active line, or wrong section requestedCheck the portal for an active subscription
JSON parse errorThe URL returned an HTML error page instead of JSONCheck scheme, port and that the server is reachable
Redirect loopServer moved or requires HTTPSTry https://, or the new address from the provider
Works on one device, not anotherConnection limit reachedClose the other stream or upgrade the plan
Login works, EPG emptyGuide endpoint not suppliedAdd the /xmltv.php URL manually

A useful test: open the player_api.php URL with your credentials in a browser. A JSON response means the account is alive. An error page means the problem is upstream — the same split described in IPTV not working.

Catch-Up and VOD Depend on the Panel

A player can only show what the panel exposes. Xtream responses include archive flags — commonly tv_archive and tv_archive_duration — and a value of 0 means catch-up is not available on that line, regardless of what your app advertises.

That explains two confusing situations:

  • The catch-up button appears but plays nothing. The panel has no archive for that channel, or the provider disabled it for your plan.
  • Films and series are missing while live TV works. The account may be live-only, or those sections were not enabled in the panel.

Before blaming the player, check the account in the provider's portal, then ask one specific question: does this line include catch-up, VOD and series? Our EPG guide covers the related trap — a guide that exists but maps to nothing.

Security: Treat the Three Fields as a Password

Xtream credentials travel in the URL query string. That has consequences worth knowing:

  • Screenshots leak accounts. A screenshot of a player's settings screen usually contains the full login. Blur it or re-enter it.
  • Do not post the URL in forums. Anyone with it can use your connection until the provider resets it.
  • Watch for logs. Browser history, proxy logs and support tickets can all contain the URL.
  • Never share it with "activation" sites. No legitimate player needs your provider credentials on a third-party website.

If a credential leaks, ask the provider to reset the password. The playlist URL and every stream link embed it, so assume the old one is public.

The API is a technical interface; legality depends entirely on the content the server distributes. A licensed service can use the same API as an unlicensed one, and the presence of an Xtream login tells you nothing about licensing.

What you can check: whether the provider names the company behind it, publishes terms and a refund policy, explains its content rights, and accepts normal payment methods. Our free trial checklist turns those into a test you can run before paying, and the disclaimer explains the general legal position.

FAQ

How do I get Xtream Codes?

You do not create them yourself. The provider issues a server URL, username and password for your account. If you were given a single M3U link instead, the panel may still expose Xtream on the same account — ask before assuming it does not.

Are "free Xtream codes" real?

Treat them as a red flag. A working Xtream login is an account someone pays for; lists of "free codes" are usually expired, stolen, or a lure for a paid reseller. There is no legitimate free tier of a licensed channel service.

Is Xtream Codes better than an M3U playlist?

For daily use, usually yes. It gives the player structured categories, separate films and series, and often a bundled EPG. M3U is more portable and works in almost every player, including VLC. Many providers support both on the same account.

What do I put in the "server URL" field?

Only the address and port, for example http://server.example.com:8080. Do not add /player_api.php or a username to that field — those go in their own boxes.

Why does my Xtream login say invalid password when it worked yesterday?

Either the plan expired, the provider rotated credentials, or another device hit the connection limit. Log in to the provider's portal and check the account status before changing anything in the player.

Can I convert an Xtream login into an M3U file?

Yes, if the panel exposes /get.php with type=m3u_plus. That URL produces a playlist from the same account. You lose the separate on-demand sections in most players.

Does Xtream Codes include the EPG?

Usually. Many players request the guide from the same server automatically. If the timeline is empty, add the /xmltv.php URL manually — the format is covered in what an EPG is.

Where to Go Next