Skip to main content
Version: 0.1.0

Channels API

Endpoints for browsing channels, listing categories, and obtaining stream URLs.

List Channels

GET /api/providers/:id/channels

Returns channels available from the specified provider. Results can be filtered by category and/or a search term, and support limit/offset pagination.

Headers:

Authorization: Bearer <jwt_token>

Path Parameters:

ParameterDescription
idProvider identifier

Query Parameters:

ParameterTypeRequiredDescription
categorystringNoFilter by category ID. Omit or pass an empty string to return all categories.
searchstringNoCase-insensitive substring match on channel names, evaluated server-side before pagination.
limitnumberNoMaximum number of channels to return. Omit for the provider's default page size.
offsetnumberNoZero-based index of the first channel to return (default: 0).
tip

search is applied before limit/offset, so the total field in the response always reflects the number of channels that matched the search (and category) filter, not the full unfiltered count. Use total to render pagination controls correctly.

Example Requests:

# All channels (no filters)
GET /api/providers/streammax/channels

# First page of "Sports" channels
GET /api/providers/streammax/channels?category=sports&limit=20&offset=0

# Search for "news" across all categories, second page
GET /api/providers/streammax/channels?search=news&limit=20&offset=20

# Combine search and category filter
GET /api/providers/streammax/channels?category=news&search=24&limit=10&offset=0

Response: 200 OK

{
"channels": [
{
"id": "ch001",
"name": "News 24/7",
"logo": "https://cdn.example.com/logos/news247.png",
"category": "news",
"number": 1,
"description": "24-hour news channel"
},
{
"id": "ch002",
"name": "Sports Live",
"logo": "https://cdn.example.com/logos/sportslive.png",
"category": "sports",
"number": 2,
"description": "Live sports coverage"
}
],
"total": 142
}

Response Fields

FieldTypeDescription
channelsChannel[]Array of channel objects for the current page
totalnumberTotal number of channels matching the applied filters (use this to compute pagination page count)

Channel Object

FieldTypeDescription
idstringUnique channel identifier
namestringChannel display name
logostring | nullChannel logo URL
categorystring | nullChannel category identifier
numbernumber | nullChannel number (LCN)
descriptionstring | nullChannel description

Error Responses:

StatusCondition
400Provider API returned an error
401Missing or invalid JWT token
403User has must_change_password = true (password change required before accessing this endpoint)
404Provider not found or no active session

Pagination

Use limit and offset together with the total field to build pagination controls:

Total channels matching filter: total = 142
Page size: limit = 20
Current page (0-based): page = 3

offset = page × limit = 60

GET /api/providers/streammax/channels?limit=20&offset=60

Example pagination loop:

const limit  = 20;
let offset = 0;

while (true) {
const { channels, total } = await fetchChannels({ limit, offset });
renderPage(channels);

offset += limit;
if (offset >= total) break;
}

List Categories

GET /api/providers/:id/channels/categories

Returns available channel categories. Categories may be fetched from the provider's API or defined statically in the provider YAML.

Headers:

Authorization: Bearer <jwt_token>

Path Parameters:

ParameterDescription
idProvider identifier

Response: 200 OK

{
"categories": [
{
"id": "entertainment",
"name": "Entertainment"
},
{
"id": "movies",
"name": "Movies"
},
{
"id": "sports",
"name": "Sports"
},
{
"id": "news",
"name": "News"
}
]
}

Category Object

FieldTypeDescription
idstringCategory identifier
namestringCategory display name

Error Responses:

StatusCondition
401Missing or invalid JWT token
403User has must_change_password = true
404Provider not found