Overview
To support binge watching – for example, a list of episodes to watch next, auto-play of the next episode, or a "play all" mode – a client application needs the episodes of a series in the right order, whether they are available as VOD, as live events, or as the user's recordings.
The Content Discovery Facade series episodes API returns all the episodes of a series (or of one season) from all of these sources in a single, ordered, de-duplicated list. It can also return just the episodes around the one that the user is watching.
Request
To retrieve the episodes of a series, send a GET request to:
https://<host>:<port>/metadata/v1/series/{series}/episodes
Headers
-
Authorization– the client's access token, as a bearer token (Bearer <access token>). This is theaccess_tokenthat the client gets when it signs in – see Authentication token. -
Accept-Language– the language (locale) of the response data, for example,en_GB. This header is mandatory.
Mandatory arguments
-
series(in URL) – the ID of the series -
deviceType(in query) – the type of the device making the query (for example,Android). Only episodes that can be played on this type of device are returned.
Other arguments
All these arguments are query parameters:
-
season– the ID of a season. Only the episodes of this season are returned. -
seed– the content ID (or content link ID) of an episode, typically the one that the user is watching. If you specify this, the response contains this episode and the episodes around it (seenextandprevious). If you do not specify it, all the episodes are returned. -
next– the maximum number of episodes after the seed episode to return. Default:0. -
previous– the maximum number of episodes before the seed episode to return. Default:0. -
cycle– iftrue, and there are fewer thannextepisodes after the seed episode, the list continues from the first episode of the series. Default:false. -
exclude– the types of episodes to leave out. You can specify this parameter more than once. The values are:-
vod– VOD episodes -
epg– live events (whether they have already been broadcast or not) -
future_epg– live events that have not started yet -
recordings– the user's NPVR recordings -
unentitled– episodes that the user is not entitled to watch
-
-
seasonLimit– the maximum number of seasons to return. Default:100. -
episodeLimit– the maximum number of episodes to return per season. Default:100.
You can only use next, previous, and cycle with seed.
You cannot use episodeLimit with seed. Use next and previous instead.
If you specify seed without next, no episodes after the seed episode are returned. So, to get the next episodes, always specify next.
Examples
This request returns all the episodes of a series:
https://<host>:<port>/metadata/v1/series/game_of_thrones/episodes?deviceType=Android
This request returns the episodes of one season:
https://<host>:<port>/metadata/v1/series/game_of_thrones/episodes?deviceType=Android&season=game_of_thrones_s01
This request returns the episode that the user is watching, the two episodes before it, and the four episodes after it:
https://<host>:<port>/metadata/v1/series/game_of_thrones/episodes?deviceType=Android&seed=game_of_thrones_s01_e03&next=4&previous=2
This request returns the next episode after the one that the user is watching, leaving out VOD episodes and episodes that the user is not entitled to watch, and going back to the start of the series after the last episode:
https://<host>:<port>/metadata/v1/series/game_of_thrones/episodes?deviceType=Android&seed=game_of_thrones_s01_e03&next=1&exclude=vod&exclude=unentitled&cycle=true
Response
A successful request returns an HTTP 200 status.
A bad request returns an HTTP 400 status – for example, if deviceType or Accept-Language is missing, or if the arguments are not used as described above.
A forbidden request returns an HTTP 403 status – for example, if the access token is missing, invalid, or has expired.
If the series does not exist, the request returns an HTTP 404 status.
Interpreting the response
The response contains the series, its seasons (in season number order), and each season's episodes (in episode number order).
|
Field |
Description |
|---|---|
|
|
The ID of the series |
|
|
The title of the series |
|
|
The description of the series |
|
|
The parental rating(s) for the series |
|
|
The seasons of the series. Each season contains:
|
|
|
Episodes that do not belong to a season |
Each episode contains the following fields:
|
Field |
Description |
|---|---|
|
|
Where the episode is available from: |
|
|
The ID of the VOD content, the live event, or the recording (depending on |
|
|
The ID of the editorial content |
|
|
The content link ID, which links different versions of the same content |
|
|
The ID of the series |
|
|
The ID of the season |
|
|
The title |
|
|
The description |
|
|
The episode number within the season |
|
|
The title of the episode |
|
|
The content type, for example, |
|
|
For live events and recordings, the ID of the channel |
|
|
For live events, the broadcast |
For example:
{
"id": "game_of_thrones",
"Title": "Game of Thrones",
"Description": "Nine noble families fight for control over the lands of Westeros.",
"Ratings": [
{
"code": "15",
"precedence": 15,
"Title": "15"
}
],
"seasons": [
{
"id": "game_of_thrones_s01",
"Title": "Season 1",
"SeasonNumber": 1,
"Ratings": [],
"episodes": [
{
"id": "game_of_thrones_s01_e03",
"contentId": "game_of_thrones_s01_e03",
"contentLinkId": "GOT_S01E03",
"series": "game_of_thrones",
"season": "game_of_thrones_s01",
"Title": "Game of Thrones",
"episodeNumber": 3,
"Episode": "Lord Snow",
"contentType": "episode",
"type": "VOD"
},
{
"id": "PROG_HBO_20261021T2100",
"contentId": "game_of_thrones_s01_e04",
"contentLinkId": "GOT_S01E04",
"series": "game_of_thrones",
"season": "game_of_thrones_s01",
"Title": "Game of Thrones",
"episodeNumber": 4,
"Episode": "Cripples, Bastards, and Broken Things",
"contentType": "episode",
"channel": "CH_HBO",
"broadcast": {
"start": 1792616400,
"end": 1792620000
},
"type": "BTV"
},
{
"id": "REC_5c1f02a9",
"contentId": "game_of_thrones_s01_e05",
"contentLinkId": "GOT_S01E05",
"series": "game_of_thrones",
"season": "game_of_thrones_s01",
"Title": "Game of Thrones",
"episodeNumber": 5,
"Episode": "The Wolf and the Lion",
"contentType": "episode",
"channel": "CH_HBO",
"type": "RECORDING"
}
]
}
],
"episodes": []
}
The response does not include playback information, images, or cue points. To get these for an episode, use the media card for the episode's type – see Media cards – or the MDS and User Recordings APIs.
How the list of episodes is built
-
Episodes are collected from VOD content, live events, and the user's NPVR recordings for the series, unless you exclude them.
-
Only episodes that can be played on the specified
deviceTypeare returned. -
If the same episode is available from more than one source (for example, as VOD and as a recording), it is returned only once. Episodes are treated as the same if they have the same
contentLinkId. A recording takes precedence over other sources. -
Live events are included whether they have already been broadcast or not (unless you use
exclude=future_epgorexclude=epg). A live event that has already been broadcast can only be played if it is available as catch-up, so check this (for example, using the episode's media card) before offering it to the user.
See also
-
For full details of this API, see Content Discovery Facade API documentation.