Skip to main content
GET
/
api
/
series
/
{showId}
/
seasons
/
{seasonId}
/
chapters
/
{chapterId}
Get Episode
curl --request GET \
  --url https://api.example.com/api/series/{showId}/seasons/{seasonId}/chapters/{chapterId}
{
  "_id": "<string>",
  "title": "<string>",
  "description": "<string>",
  "content": [
    {
      "value": {
        "_id": "<string>"
      }
    }
  ],
  "images": [
    {
      "_id": "<string>",
      "path": "<string>",
      "basePath": "<string>"
    }
  ],
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Overview

This endpoint retrieves detailed information about a specific episode, including its video content, metadata, and thumbnail images.

Path Parameters

showId
string
required
The unique identifier of the series
seasonId
string
required
The unique identifier of the season
chapterId
string
required
The unique identifier of the episode

Request Example

curl -X GET "https://your-domain.com/api/series/abc123/seasons/def456/chapters/ghi789" \
  -H "Accept: application/json"

Response

_id
string
Unique episode identifier
title
string
Episode title
description
string
Episode description
content
array
Video content array
images
array
Episode thumbnail images
createdAt
string
ISO 8601 timestamp when the episode was created
updatedAt
string
ISO 8601 timestamp when the episode was last updated

Response Example

{
  "_id": "64a7f2b1c8d4e12345abcdef",
  "title": "Episode 1: Pilot",
  "description": "The beginning of an epic journey. In this episode, we meet our main characters and learn about the world they inhabit.",
  "content": [
    {
      "value": {
        "_id": "5f8a3d2b1c9d440000123456"
      }
    }
  ],
  "images": [
    {
      "_id": "img123",
      "path": "/images/episode1.jpg",
      "basePath": "/images/episodes/pilot"
    }
  ],
  "createdAt": "2024-03-01T10:30:00Z",
  "updatedAt": "2024-03-05T14:20:00Z"
}

Video Playback

Use the video ID from the content array to stream the episode:

HLS Streaming URL

const videoId = episode.content[0].value._id;
const streamUrl = `https://mdstrm.com/video/${videoId}.m3u8`;

HTML5 Video Player

<video
  controls
  autoplay
  src="https://mdstrm.com/video/5f8a3d2b1c9d440000123456.m3u8"
  class="w-full aspect-video"
></video>

MediaStream Player Integration

const playerOptions = {
  width: 640,
  height: 360,
  type: 'media',
  id: videoId,
  autoplay: false,
  events: {
    onPlayerReady: () => console.log('Player ready'),
    onPlay: () => console.log('Playing'),
    onVideoEnd: () => console.log('Video ended'),
    onVideoError: () => console.log('Error')
  }
};

new MediastreamPlayer('player-container', playerOptions);

Error Responses

The specified episode, season, or series does not exist.
{
  "error": "Episode not found"
}
Invalid or missing API authentication.
{
  "error": "Unauthorized access"
}
Server error while fetching the episode.
{
  "error": "Failed to retrieve episode details"
}

Notes

This endpoint is used by the episode player view to load video content and metadata for playback.
The episode data includes both native HTML5 video playback URLs and MediaStream player integration options. Choose the player that best fits your use case.
HLS (HTTP Live Streaming) automatically adapts video quality based on the viewer’s internet connection speed, providing the best possible viewing experience.

Build docs developers (and LLMs) love