OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

Retrieving the episodes of a series (binge watching)

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:

Bash
https://<host>:<port>/metadata/v1/series/{series}/episodes

Headers

  • Authorization – the client's access token, as a bearer token (Bearer <access token>). This is the access_token that 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 (see next and previous). 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 – if true, and there are fewer than next episodes 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:

Bash
https://<host>:<port>/metadata/v1/series/game_of_thrones/episodes?deviceType=Android

This request returns the episodes of one season:

Bash
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:

Bash
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:

Bash
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

id

The ID of the series

Title

The title of the series

Description

The description of the series

Ratings

The parental rating(s) for the series

seasons

The seasons of the series. Each season contains:

  • id – the ID of the season

  • Title – the title of the season

  • SeasonNumber – the season number

  • Description and Ratings – the description and parental rating(s) of the season

  • episodes – the episodes of the season (see below)

episodes

Episodes that do not belong to a season

Each episode contains the following fields:

Field

Description

type

Where the episode is available from: VOD, BTV (a live event), or RECORDING (one of the user's NPVR recordings)

id

The ID of the VOD content, the live event, or the recording (depending on type)

contentId

The ID of the editorial content

contentLinkId

The content link ID, which links different versions of the same content

series

The ID of the series

season

The ID of the season

Title

The title

Description

The description

episodeNumber

The episode number within the season

Episode

The title of the episode

contentType

The content type, for example, episode

channel

For live events and recordings, the ID of the channel

broadcast

For live events, the broadcast start and end times (epoch time, in seconds)

For example:

JSON
{
  "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 deviceType are 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_epg or exclude=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