What is Xtream Codes API?
Xtream Codes API is a standardized IPTV panel API that provides:- VOD (Video on Demand) stream listings
- Series and episode information
- Live TV channels
- EPG (Electronic Program Guide) data
- Category organization
- User authentication and authorization
Environment Configuration
Configure your Lionz TV credentials in the.env file:
The Lionz TV Xtream Codes API server URL.Example:
http://api.lionz.tv, http://panel.lionz.tvThe port number for the API server.Common values:
80- HTTP (default)443- HTTPS- Custom port as provided by Lionz TV
Your Lionz TV account username.
Your Lionz TV account password.
User agent string sent with API requests.
Some IPTV providers check the user agent. The default mimics a Firefox browser.
Example Configuration
.env
API Endpoints
The application constructs API URLs automatically using your configuration:Base URL
Player API Endpoint
API Actions
The Xtream Codes API supports various actions for retrieving content:Get Account Info
Retrieve account information and subscription status:Get VOD Streams
Retrieve list of available VOD content:Get VOD Categories
Retrieve VOD categories for organization:Get VOD Info
Retrieve detailed information about a specific VOD stream:Get Series
Retrieve list of TV series:Get Series Info
Retrieve detailed information about a series including episodes:Get Live Streams
Retrieve list of live TV channels:Configuration Model
The application uses theXtreamCodesConfig model to manage API configuration. This model:
- Stores connection details in the database
- Encrypts the password for security
- Can load configuration from environment variables
- Provides helper methods for API URLs and credentials
Loading from Environment
The configuration is automatically loaded from environment variables:hostfromXTREAM_CODES_API_HOSTportfromXTREAM_CODES_API_PORTusernamefromXTREAM_CODES_API_USERpasswordfromXTREAM_CODES_API_PASS(encrypted)
API URL Generation
The model provides methods to generate API URLs:Testing Connection
After configuration, test your Xtream Codes connection:Using curl
Using the Application
The application automatically tests the connection when syncing media:Troubleshooting
Authentication Failed
If you receive authentication errors:- Verify
XTREAM_CODES_API_USERandXTREAM_CODES_API_PASSare correct - Check if your Lionz TV subscription is active
- Ensure you’re not exceeding the maximum number of concurrent connections
- Contact Lionz TV support to verify your account status
Connection Timeout
If API requests timeout:- Verify
XTREAM_CODES_API_HOSTis correct and accessible - Check if the
XTREAM_CODES_API_PORTis correct - Ensure your server can reach the Lionz TV API (check firewall rules)
- Try accessing the URL directly from your browser or curl
Invalid Response
If you receive unexpected responses:- Verify the API URL format is correct
- Check if the Lionz TV service is experiencing issues
- Ensure your
HTTP_CLIENT_USER_AGENTis acceptable to the service - Try the API request manually with curl to see the raw response
Empty Content
If API returns no VOD streams or series:- Check if your subscription includes VOD/Series access
- Verify your account has content assigned to it
- Try accessing content through other Xtream Codes compatible players
- Contact Lionz TV support to verify your package
Security Best Practices
API Rate Limiting
Be aware of potential rate limiting:- Don’t make excessive API requests in a short time
- The application caches API responses where possible
- Respect the provider’s concurrent connection limits
- Use the sync commands during off-peak hours for large updates
Syncing Content
Once configured, sync content from Lionz TV:Initial sync may take a while depending on the size of your content library. Subsequent syncs are faster as they only update changes.
Additional Resources
- Xtream Codes API Documentation
- Contact Lionz TV support for account-specific questions
- Check the application logs for detailed API error messages