Download OpenAPI specification:
REST-APIs for interfacing with the HLS Analyzer monitoring service
HLSAnalyzer.com is an online HLS analyzer and monitoring service. We follow the official HTTP Live Streaming specification (RFC 8216) and check for a variety of error conditions as well as HLS conformance points. For any HLS stream, the monitoring engine initializes the playlist buffer with segment durations greater than three times the target duration. It maintains this buffer with the arrival of each new segment while accumulating the elapsed time in the playlist refresh cycle. In addition to stream monitoring, HLSAnalyzer.com also tracks and saves all advertisement cues (SCTE-35) appearing in HLS playlists and embedded in transport streams, as well as closed captions (CEA-608/708) from video segments.
Our monitoring service will recognize a variety of SCTE-35 marker formats (shown below). When a duration field is available, the analyzer will confirm that the individual segment lengths for the advertisement match the expected duration:
Supported SCTE-35 Formats
#EXT-X-CUE-OUT:DURATION=60
...
#EXT-X-CUE-IN
#EXT-X-CUE-OUT:120
...
#EXT-X-CUE-IN
#EXT-X-CUE-OUT
...
#EXT-X-CUE-IN
#EXT-X-DATERANGE:ID="22",START-DATE=START_DATE,SCTE35-OUT=...
...
#EXT-X-DATERANGE:ID="22",START-DATE=START_DATE,SCTE35-IN=...
SCTE-35 cues embedded in the transport stream
Caption Extraction (CEA-608/708)
Our service automatically extracts and decodes closed captions from HLS video segments:
CEA-608 - Legacy line 21 closed captions
- Standard Definition captions
- Extracts caption text from MPEG-TS user data
- Compatible with older broadcast standards
CEA-708 - Digital Television (DTV) closed captions
- High Definition captions
- Extracts caption text from MPEG-TS user data
Captions are extracted from MPEG-TS segments in real-time and made available via polling or streaming (SSE) APIs. Both JSON and SRT (SubRip) output formats are supported for easy integration with video players and transcription workflows.
The RESTful APIs documented here can add and remove HLS streams, configure stream-alerting features, and enable or disable alerts on individual streams. Our monitoring process will generate email and HTTP-based alarms when media streams encounter delivery problems or SCTE-35 cues disappear from the playlist or transport stream. These APIs enable a high level of automation that help integrate our service into your production pipeline or a CICD development and testing environment.
All API-based streams are private and can only be accessed and monitored with a corresponding API key.
Specify the global alert destinations, which will be used in case an alert is raised. When specified, the parameters will be tested for validity: a test email will be sent to the address provided, and the callback link will be confirmed via an HTTP POST. Alerts may also be enabled and disabled using this command.
The alert descriptions will be in JSON format, which will be emailed and POSTed when an alarm is triggered.
There are 3 sensitivty levels, increasing from least sensitive to most.Alerts are generated when 1) no data is being received (total outage), 2) when segments are slower than realtime and a specific outage duration has been accumulated (outage accumulation), or 3) when segments are delivered slower than realtime for a minimum amount of time (poor delivery).
To avoid excessive email communication, for any single stream only 10 email “STREAM Outage” alerts will be sent in 24 hours, with an additional 10 “Clear” email messages when enabled. No limits shall exist for HTTP callbacks or SCTE-35 outage alerts.
| apikey required | string Unique API key |
string Email address to which alert messages will be sent, or “none” to remove an existing email address. Up to 3 email addresses (separated by commas) may be specified | |
| callback | string An HTTP address to which alert messages will be POSTed, or “none” to remove existing HTTP callback address |
| enable | string enable or disable alerting [default: false] |
| notifyclear | string enable or disable sending an email when an alert condition has cleared [default: false] |
| sensitivity | number set alert sensitivity from 1 (least) to 3 (most) |
{- "email": "noname@example.com",
- "enable": true,
- "notifyclear": false
}Specify alert limits for delivery outages in all streams. An outage condition is entered when the stream playback buffer reaches 0 seconds, or if the Media Playlist contains an “#EXT-X-ENDLIST” tag. If an outage condition continues for more than outage_seconds, an alert will be raised. The alert condition must be cleared for a contiguous clear_seconds, before a new alert may be raised for the same stream.
| apikey required | string Unique API key |
| outage required | integer minimum seconds of the outage before an alert is raised [default: 120, minimum: 30; maximum: 3600] |
| clear required | integer minimum seconds for which an alert must be contiguously resolved, after which a new alert may be raised for the same outage stream [default, minimum: 300; maximum: 3600] |
{- "outage": 120,
- "clear": 300
}Specify alert limits for SCTE-35 outages in all streams. An outage condition is entered when consecutive SCTE-35 Cue-out and Cue-in playlist parameters have not been observed for outage_minutes. The alert condition must be cleared for a contiguous clear_minutes before a new alert may be raised for the same stream.
| apikey required | string Unique API key |
| outage required | integer minimum minutes of the outage before an alert is raised [default: 30, minimum: 15, maximum:720] |
| clear required | integer minimum minutes of minutes for which an alert must be contiguously resolved, after which a new alert may be raised for the same outage stream [default, minimum: 30, maximum: 720] |
{- "outage": 15,
- "clear": 30
}Enable or disable the stream outage alert mode for an individual link. If alerts are globally disabled, individual alerts cannot be enabled. Once a link is removed, its alert state will also be erased.
| apikey required | string Unique API key |
| mode required | string mode 0: alerts disabled, mode 1: alerts enabled [default] |
| m3u8 | string URI of the link being monitored |
| linkid | string ID of the link being monitored |
{- "mode": "0",
- "linkid": "d421d046"
}Get the currently enabled or disabled stream outage alerts for individual streams.
| apikey required | string Unique API key |
{- "mode": {
- "c301b2b0678c": "0",
- "c53a154a678c": "0",
- "c6c7c81c678c": "0"
}
}Enable or disable the SCTE-35 outage alert mode for an individual link. SCTE-35 alerts are disabled by default, so they must be enabled individually for each stream. If alerts are globally disabled, individual alerts will not be enabled. Once a link is removed, its alert state will also be reset.
| apikey required | string Unique AP key |
| mode required | string mode 0: alerts disabled [default], mode 1: alerts enabled |
| m3u8 | string URI of the link being monitored |
| linkid | string ID of the link being monitored |
{- "mode": "0",
- "linkid": "d421d046"
}Get all alert records between the start and end timestamps for the specified LinkID. Timestamps are specified in Unix timestamp mode (UTC).
| apikey required | string Unique API key |
| linkid required | string ID of the stream being monitored |
| start required | string UTC timestamp |
| end required | string UTC timestamp |
[- {
- "timestamp": 1641274831,
- "alerts": " STREAM ALERT CLEARED Consistent Delivery Duration 301 seconds, Playlist Status Live, Accumulated Stream Outage 255677 (sec)"
}, - {
- "timestamp": 1641274444,
- "alerts": " STREAM OUTAGE ALERT Intermittent Delivery Duration 148 seconds, Playlist Status Live, Accumulated Stream Outage 255598 (sec)"
}, - {
- "timestamp": 1641222947,
- "alerts": " STREAM ALERT CLEARED Consistent Delivery Duration 945 seconds, Playlist Status Live, Accumulated Stream Outage 226512 (sec)"
}, - {
- "timestamp": 1641222002,
- "alerts": " STREAM OUTAGE ALERT Intermittent Delivery Duration 26548 seconds, Playlist Status HttpError, Accumulated Stream Outage 225567 (sec)"
}, - {
- "timestamp": 1641164813,
- "alerts": " STREAM ALERT CLEARED Consistent Delivery Duration 301 seconds, Playlist Status Live, Accumulated Stream Outage 191582 (sec)"
}, - {
- "timestamp": 1641164229,
- "alerts": " STREAM OUTAGE ALERT Intermittent Delivery Duration 1999 seconds, Playlist Status HttpError, Accumulated Stream Outage 191577 (sec)"
}, - {
- "timestamp": 1641119878,
- "alerts": " STREAM ALERT CLEARED Consistent Delivery Duration 925 seconds, Playlist Status Live, Accumulated Stream Outage 147268 (sec)"
}, - {
- "timestamp": 1641118887,
- "alerts": " STREAM OUTAGE ALERT Intermittent Delivery Duration 10847 seconds, Playlist Status HttpError, Accumulated Stream Outage 146351 (sec)"
}, - {
- "timestamp": 1640898806,
- "alerts": " SCTE-35 OUTAGE ALERTS DISABLED"
}, - {
- "timestamp": 1640898806,
- "alerts": " STREAM OUTAGE ALERTS ENABLED"
}
]Get all SCTE-35 cue records between the start and end timestamps for the specified LinkID. Timestamps are specified in Unix timestamp mode (UTC).
SCTE-35 Source Types:
playlist (default): SCTE-35 cues found in HLS playlist tags (#EXT-X-CUE-OUT, #EXT-X-CUE-IN, #EXT-X-DATERANGE)stream: SCTE-35 cues extracted directly from the MPEG transport stream segments (when present)Requirements for Transport Stream Extraction:
/api/stream/segment?enable=true) when using source=streamsource=playlist) does not require segment downloadingBoth sources support the same time-based filtering using start and end timestamps. Transport stream extraction provides more detailed SCTE-35 information including splice commands and segmentation descriptors that may not be present in playlist tags.
| apikey required | string Unique API key |
| linkid required | string ID of the stream being monitored |
| start required | string UTC timestamp |
| end required | string UTC timestamp |
| source | string Default: "playlist" Enum: "playlist" "stream" Source of SCTE-35 cues: 'playlist' (default, from HLS playlist tags) or 'stream' (extracted from transport stream) |
[- {
- "timestamp": 1641363628,
- "scte35": " Cue In 120.00 seconds measured duration"
}, - {
- "timestamp": 1641363508,
- "scte35": " Cue Out 120.00 seconds expected duration"
}, - {
- "timestamp": 1641362768,
- "scte35": " Cue In 120.00 seconds measured duration"
}, - {
- "timestamp": 1641362648,
- "scte35": " Cue Out 120.00 seconds expected duration"
}
]Retrieve all current errors associated with the specified LinkID and the duration between start and end UTC timestamps, for up to the 1000 most recent occurrences. LinkIDs may only be specified for both Master as well as Media playlists.
| apikey required | string Unique API key |
| linkid required | string ID of the stream being monitored |
| start required | string UTC timestamp |
| end required | string UTC timestamp |
[- {
- "timestamp": 1641274384,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream/39-06000.ts \rTimeout condition: (28 'Operation timed out after 9007 milliseconds with 35590 out of 3994624 bytes received')"
}, - {
- "timestamp": 1641274384,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream/33-06000.ts \rTimeout condition: (28 'Operation timed out after 9000 milliseconds with 639406 out of 3997632 bytes received')"
}, - {
- "timestamp": 1641274384,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream/27-06000.ts \rTimeout condition: (28 'Operation timed out after 9001 milliseconds with 304918 out of 4012672 bytes received')"
}, - {
- "timestamp": 1641274356,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream/09-06000.ts \rTimeout condition: (28 'Operation timed out after 9004 milliseconds with 176046 out of 4075840 bytes received')"
}, - {
- "timestamp": 1641274356,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream/03-06000.ts \rTimeout condition: (28 'Operation timed out after 9001 milliseconds with 317950 out of 3919424 bytes received')"
}, - {
- "timestamp": 1641274356,
- "code": " EC-2002",
- "error": " ERROR EC-2002: Could not download segment http://example.com/stream//57-06000.ts \rTimeout condition: (28 'Operation timed out after 9000 milliseconds with 167358 out of 3976576 bytes received')"
}, - {
- "timestamp": 1641274351,
- "code": " EC-2004",
- "error": " ERROR EC-2004: Could not download playlist"
}, - {
- "timestamp": 1641274346,
- "code": " EC-2004",
- "error": " ERROR EC-2004: Could not download playlist"
}
]Retrieve all current warnings associated with the specified LinkID and the duration between start and end UTC timestamps, for up to the 1000 most recent occurrences. LinkIDs may only be specified for both Master as well as Media playlists.
| apikey required | string Unique API key |
| linkid required | string ID of the stream being monitored |
| start required | string UTC timestamp |
| end required | string UTC timestamp |
[- {
- "timestamp": 1641274384,
- "code": " WA-1001",
- "warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 255539.91 seconds"
}, - {
- "timestamp": 1641274356,
- "code": " WA-1001",
- "warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 255511.12 seconds"
}, - {
- "timestamp": 1641274351,
- "code": " WA-1001",
- "warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 255482.81 seconds"
}, - {
- "timestamp": 1641274346,
- "code": " WA-1001",
- "warning": " WARNING WA-1001: Rebuffering Error - Total Outage: 255477.80 seconds"
}
]Add a Master or Media HLS playlist (.m3u8). Monitoring will start immediately after the HLS URI has been added. An internal LinkID will be generated, unless it has been specified on the query string (between 6 and 32 alphanumeric characters), in which case it will be applied to the Master playlist. All variants and their generated LinkIDs will be returned in the JSON response. The available monitoring quota for the API key will be updated.
Custom HTTP Headers can be specified by adding "#http-custom-header=HeaderName:HeaderValue" to the end of any playlist URIs. The custom header will be stripped from the URI link and automatically added as an HTTP header when requesting the URIs and associated segments.
| apikey required | string Unique API key |
| m3u8 required | string HLS URI accessible over the public internet |
| linkid | string Specify an identifier for this stream (between 6 and 32 alphanumeric characters) |
{- "type": "Master",
- "variants": {
}, - "linkid": "d421d046"
}Remove a stream by specifying either the URI or the LinkID of the stream being monitored. Removing a stream will completely delete all its log and alert history from the system. Removing a Master playlist will also affect all of its variants. Only the top-level LinkID for a stream can be specified (individual variants within a Master playlist cannot be removed).
| apikey required | string Unique API key |
| m3u8 | string The URI of the stream to be removed |
| linkid | string The identifier of the link to be removed |
{- "linkid": "d421d046"
}Reset stream statistics by specifying either the URI or the LinkID of the stream being monitored. Resetting a stream will initialize all monitoring parameters and alerts. Similar to the remove process, reseting a Master playlist will also affect all of its variants. Only the top-level LinkID for a stream can be specified (individual variants within a Master playlist cannot be reset).
| apikey required | string Unique API key |
| m3u8 | string The URI of the link to be reset |
| linkid | string The identifier of the link to be reset |
{- "linkid": "d421d046"
}Remove all streams and their associated log and alert records from the system. This API will not wait for the completion status. Use the stream status API to determine all streams have been successfully removed.
| apikey required | string Unique API key |
{- "linkid": "d421d046"
}Get the current status of individual Master or Media playlists. LinkIDs for individual Media playlists, or the top-level Master playlist can be specified. If no parameters are specified, the status for all streams will be returned.
| apikey required | string Unique API key |
| m3u8 | string The URI of the link |
| linkid | string The identifier of the link |
{- "status": {
- "PlaylistStatus": "VOD",
- "SegmentStatus": "Monitoring",
- "NonliveCount": 1,
- "PlaylistType": "Media",
- "LinkID": "a9095a8e6ddb",
- "Errors": 0,
- "Warnings": 10,
- "Outage": 9.14,
- "Buffer": 0,
- "Delta": 0,
- "SegDuration": 2,
- "SegmentDownloadTime": 0.29,
- "SegmentRate": 337,
- "Timestamp": 1641355121,
- "Uptime": 47.14,
- "AlertState": "Enabled",
- "SCTE35State": "Disabled",
- "AlertCount": "2",
- "InAlarm": "Clear",
- "SCTE35CueOut": "False",
- "SCTE35Count": "0",
- "tracks": "VIDEO",
- "vcodec": "h264@Main,L1.3",
- "acodec": "",
- "vres": "426x180",
- "vfr": "24.00",
- "SequenceNumber": 0
}
}Enable or disable downloading of segments for all streams of the specified API key. When disabled, only HLS playlists are monitored for outages and underflows. Segment downloading is enabled by default and is required to monitor VOD streams.
Important: Segment downloading is required for:
Attempting to disable segment downloads when caption extraction is enabled will result in an error. Use the force=true parameter to override this protection.
| apikey required | string Unique API key |
| enable required | string enable (true) or disable (false) segment downloads [default: disabled] |
| force | string Force disable segment downloads even when caption extraction is enabled (optional, default: false) |
{- "enable": true
}Retrieve detailed information about the MPEG Transport Stream (MPEG-TS) structure from HLS video segments. This endpoint provides access to Program Association Table (PAT), Program Map Table (PMT), and Packet Identifier (PID) mappings.
Transport Stream Components:
PAT (Program Association Table):
PMT (Program Map Table):
PID Information:
Use Cases:
Note: This endpoint requires that transport stream parsing is enabled for your API key. Information is extracted from the most recently downloaded segment.
| apikey required | string Unique API key |
| linkid required | string Unique Link ID for the HLS stream |
{- "pids": {
- "0": "PAT",
- "256": "PMT",
- "257": "Video (H.264)",
- "258": "Audio (AAC)"
}, - "pat": {
- "version": 0,
- "programs": {
- "1": 256
}
}, - "pmt": {
- "version": 0,
- "pcr_pid": 257,
- "streams": [
- {
- "pid": 257,
- "stream_type": "H.264",
- "type_code": 27
}, - {
- "pid": 258,
- "stream_type": "AAC",
- "type_code": 15
}
]
}
}Retrieve all currently available closed captions (CEA-608 or CEA-708) extracted from HLS video segments. This endpoint returns a snapshot of captions and closes the connection immediately.
Requirements:
/api/stream/segment?enable=true)Rate Limiting: To prevent excessive API calls, this endpoint enforces a minimum of 30 seconds between requests for the same stream.
Output Formats:
json: Structured JSON with sequence numbers, timestamps, duration, and contentsrt: SubRip subtitle format compatible with most video playersCaption Types:
608: Legacy CEA-608 closed captions (Line 21, CC1-CC4) for Standard Definition708: CEA-708 Digital Television captions for High Definition with enhanced formattingCaptions are extracted in real-time from MPEG-TS segments and cached for quick retrieval. For real-time streaming of captions as they arrive, use the /api/stream/captions/sse endpoint instead.
| apikey required | string Unique API key |
| linkid required | string Stream identifier (LinkID) from which to retrieve captions |
| type | string Default: "608" Enum: "608" "708" Caption type: 608 (legacy SD captions) or 708 (HD digital captions) |
| format | string Default: "json" Enum: "json" "srt" Output format: json (structured data) or srt (SubRip subtitle format) |
{- "linkid": "a9095a8e6ddb",
- "type": "608",
- "format": "json",
- "captions": [
- {
- "sequence": 1,
- "timestamp": 1641355121.5,
- "duration": 3.5,
- "content": "Welcome to our broadcast"
}, - {
- "sequence": 2,
- "timestamp": 1641355125,
- "duration": 4,
- "content": "Today's top story..."
}
], - "count": 2,
- "last_update": 1641355125
}Establish a persistent Server-Sent Events (SSE) connection for real-time caption streaming. Unlike the polling endpoint (/api/stream/captions), this maintains an open connection and pushes captions to the client as they are extracted from the video stream.
Requirements:
/api/stream/segment?enable=true)Connection Behavior:
: heartbeat) sent every 10 seconds to keep connection aliveEvent Types:
data: - Caption data in JSON or SRT format: - Comment lines for heartbeats and connection statusOutput Formats:
json: Each caption as a JSON object with sequence, timestamp, duration, and contentsrt: Each caption as SRT-formatted text blocksCaption Types:
608: Legacy CEA-608 closed captions (Line 21, CC1-CC4) for Standard Definition708: CEA-708 Digital Television captions for High Definition with enhanced formattingUse Cases:
Client Implementation Example:
const eventSource = new EventSource('/api/stream/captions/sse?apikey=KEY&linkid=ID&type=608&format=json');
eventSource.onmessage = (event) => {
const caption = JSON.parse(event.data);
console.log('New caption:', caption);
};
eventSource.onerror = (error) => {
console.error('SSE error:', error);
eventSource.close();
};
| apikey required | string Unique API key |
| linkid required | string Stream identifier (LinkID) from which to stream captions |
| type | string Default: "608" Enum: "608" "708" Caption type: 608 (legacy SD captions) or 708 (HD digital captions) |
| format | string Default: "json" Enum: "json" "srt" Output format: json (structured data) or srt (SubRip subtitle format) |
: connected to caption stream data: {"status":"connected","linkid":"a9095a8e6ddb","type":"608","format":"json"} data: {"sequence":1,"timestamp":1641355121.5,"duration":3.5,"content":"Welcome to our broadcast"} data: {"sequence":2,"timestamp":1641355125.0,"duration":4.0,"content":"Today's top story..."} : heartbeat data: {"sequence":3,"timestamp":1641355129.0,"duration":3.0,"content":"Breaking news update"}
List all associated information about the API, such as the number of variants being monitored, API key expiration, remaining variant quota, etc.
| apikey required | string Unique API key |
{- "StreamLimit": 120,
- "TimeRemaining": "30 days",
- "ActiveStreams": 12
}Check the health status of the various system services, in addition to information about the number of streams being monitored and the aggregate download rate of all segments in kilobits per second (KBPS). This API can be called at most once every 30 seconds.
| apikey required | string Unique API Key |
{- "StatusAlertService": "OK",
- "StatusEmailService": "OK",
- "StatusMonitorService": "OK",
- "InfoDownloadRate": 11016,
- "InfoStreamCount": 8,
- "InfoStreamErrors": 0,
- "InfoMonitoringTime": 108413,
- "InfoCPUPercentage": 30.6
}Get all of the HTTP POST data that are available in the system (limited to the most recent 250 POSTs).
| apikey required | string Unique API Key |
{- "posts": [
- {
- "TotalOutage": {
- "https://hlsanalyzer.com/bunny.m3u8": 34.93
}, - "CurrentOutage": {
- "https://hlsanalyzer.com/bunny.m3u8": 31
}, - "PlaylistStatus": {
- "https://hlsanalyzer.com/bunny.m3u8": "Stalled"
}, - "UUID": {
- "https://hlsanalyzer.com/bunny.m3u8": "3de49b9c83ce"
}, - "Timestamp": {
- "https://hlsanalyzer.com/bunny.m3u8": 1671916179
}, - "AlertMode": {
- "https://hlsanalyzer.com/bunny.m3u8": "outage"
}, - "LinkID": "3de49b9c83ce",
- "AlertType": "STREAM",
- "APIHash": "260e1935f79e",
- "OutageUnits": "seconds"
}
]
}