Channels API

Endpoints for live and upcoming channels.

GET/api/channels

List all live and upcoming channels with EPG data.

Request

bash
curl "https://stream-api-production-f4f7.up.railway.app/api/channels" \
  -H "X-API-Key: YOUR_API_KEY"

Response

json
{
  "live": [
    {
      "channelId": "352043",
      "epgId": "MP000156889",
      "name": "beIN Sports 1 - Australian Open",
      "logo": "https://mediacms01.apac.beiniz.biz/...",
      "poster": "https://mediacms01.apac.beiniz.biz/...",
      "startTime": "2026-01-19T00:00:00.000Z",
      "endTime": "2026-01-19T06:00:00.000Z",
      "isLive": true
    }
  ],
  "upcoming": [
    {
      "channelId": "352044",
      "epgId": "MP000156890",
      "name": "beIN Sports 2 - Premier League",
      "startTime": "2026-01-19T18:00:00.000Z",
      "isLive": false
    }
  ]
}
GET/api/stream/:epgIdUses Quota

Get stream URL and DRM configuration for playback.

Parameters

  • epgId (path) - EPG ID from channels list
  • ch (query) - Channel ID

Request

bash
curl "https://stream-api-production-f4f7.up.railway.app/api/stream/MP000156889?ch=352043" \
  -H "X-API-Key: YOUR_API_KEY"

Response

json
{
  "manifest": "https://apac-live.akamaized.net/.../index.mpd?hdnts=...",
  "drm": {
    "server": "https://stream-api-production-f4f7.up.railway.app/drm/license",
    "headers": {
      "X-DRM-Ticket": "lTVyGJ/C56t9Lxve/rjCTn...",
      "X-DRM-Token": "Bearer dl0YAGhGOKuVy1Aaz498..."
    }
  },
  "ticket": "lTVyGJ/C56t9Lxve/rjCTn...",
  "token": "Bearer dl0YAGhGOKuVy1Aaz498..."
}

Playing the Stream

Use Shaka Player with Widevine DRM:

javascript
const player = new shaka.Player(videoElement);

player.configure({
  drm: {
    servers: { 'com.widevine.alpha': response.drm.server },
    advanced: {
      'com.widevine.alpha': {
        headers: response.drm.headers
      }
    }
  }
});

await player.load(response.manifest);