The Live Streaming Statistics API, which is a versioned API, retrieves the latest statistics for your live streams, such as:
Using the same asset for missing content slate and ad slate causes inaccurate reporting of missing content slate and ad slate statistics. Ensure accurate statistics by configuring missing content slate and ad slate to use unique assets.
The Live Streaming Statistics API returns statistics for activity that occurred approximately one minute behind when the content was streamed to the viewer. This API will continue to serve statistics for at least 24 hours after the last viewer stops streaming your live channel or live event.
It supports the following endpoints:
Endpoint | Description |
---|---|
Get Enhanced Statistics - Single Live Stream GET /monitoring/stream_stats_enhanced/Live Channel or Live Event ID
|
Retrieves the latest statistics for a single live channel or live event. |
Get Enhanced Statistics - Multiple Live Streams POST /monitoring/stream_stats_enhanced
|
Retrieves the latest statistics for multiple live channels or live events. |
Get Latest Statistics - Single Live Stream Deprecated |
This endpoint has been deprecated in favor of the Get Enhanced Statistics - Single Live Stream endpoint that returns a richer set of statistics. Update your scripts to use the new endpoint at your earliest convenience. Retrieves the latest statistics for a single live channel or live event. |
Get Latest Statistics - Multiple Live Streams Deprecated |
This endpoint has been deprecated in favor of the Get Enhanced Statistics - Multiple Live Streams endpoint that returns a richer set of statistics. Update your scripts to use the new endpoint at your earliest convenience. Retrieves the latest statistics for multiple live channels or live events. |
Use the following base URL:
Retrieves the latest enhanced statistics for a live channel or live event provided that it has viewership. Identify a live channel or live event by its system-defined ID.
Request syntax:
Pass a digital signature based off of msg.
The response for a successful request contains the following properties:
Name |
Data Type |
Description |
---|---|---|
@id |
String |
Indicates the relative path to this resource. |
@type |
String |
Returns StreamStats. |
id |
String |
Identifies the live channel or live event by its system-defined ID. |
Dictionary |
Provides statistics for the live channel or live event identified by the id property. Statistics are measured over the minute prior to the time identified by the ts_iso property. |
|
ts |
Integer |
Indicates the Unix time, in milliseconds, at which the statistics were gathered. |
ts_iso |
String |
Indicates the date and time (UTC) at which the statistics were gathered. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ
Example: 2024-01-08T20:31:11.510000Z
|
The stats dictionary provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
auth_failures |
Integer |
Indicates the number of authentication failures that occurred. |
Dictionary |
Contains statistics for concurrent playback sessionsIdentifies a playback session with a duration of at least 1 minute. . |
|
List of dictionaries |
Contains the domains through which viewers requested your live stream. |
|
List of dictionaries |
Contains the locations from which viewers requested your live stream. |
|
Dictionary |
Contains statistics for new playback sessionsIdentifies a playback session whose duration is less than 1 minute.. |
|
List of dictionaries |
Contains the platforms (e.g., android or ios) from which viewers requested your live stream. |
|
type |
String |
Identifies the type of live stream. Valid values are: channel | event
|
The concurrent dictionary provides statistics for playback sessions with a duration of at least 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Dictionary |
Contains ad slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that ad slate was served. Reasons for ad slate are identified by their numeric code. Each of these dictionaries contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. View ad slate codes.
Ad slate codes are defined below.
|
mcs |
Dictionary |
Contains missing content slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
sessions |
Integer |
Indicates the number of concurrent playback sessions over a given minute. |
total_time |
Float |
Indicates the number of seconds of video served for concurrent playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
The domains dictionary provides statistics for each domain through which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
domain |
String |
Indicates the domain through which the live stream was requested. Example: This property reports content.uplynk.com for the following playback URL: https://content.uplynk.com/channel/cd772adbd60a4e898d1c3b1f46c58cea.m3u8
|
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream from the domain identified in the domain property over a given minute. |
The locations dictionary provides statistics for each location from which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
location |
String |
Identifies the location from which the viewer requested your live stream. Syntax: Country CodeRepresents a two-character ISO 3166 country code.:RegionRepresents an abbreviation for the region from which the live stream was requested.
If our service cannot determine a viewer's region, then we return a ?? value for the region (e.g., il:??). Example: The following location identifies a viewer that requested your live stream from California, USA. us:ca
|
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream from the location identified in the location property over a given minute. |
The new dictionary provides statistics for playback sessions whose duration is less than 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Dictionary |
Contains ad slate statistics for new playback sessions. This dictionary contains a dictionary for each reason that ad slate was served. Reasons for ad slate are identified by their numeric code. Each of these dictionaries contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. View ad slate codes.
Ad slate codes are defined below.
|
mcs |
Dictionary |
Contains missing content slate statistics for new playback sessions. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
sessions |
Integer |
Indicates the number of new playback sessions over a given minute. |
total_time |
Float |
Indicates the number of seconds of video served for new playback sessions. |
The platforms dictionary provides statistics for each platform from which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
platform |
String |
Indicates the platform (e.g., windows and mac) on which the live stream was requested. |
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream on the platform identified in the platform property over a given minute. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
Call the get_enhanced_stats_single_live_stream_v4 module (Python 3) to retrieve the latest statistics for a live channel whose system-defined ID is "114n9q6a847ieldd8bb8dbf67afef96b." This module imports names from the api_auth module.
import json import requests from api_auth import APICredentials, APIParams class GetEnhancedStatsSingleLiveStream: def __init__(self): self.host = "https://services.uplynk.com" def run(self): """ Get enhanced statistics for a single live stream. """ self._get_enhanced_stats_single_live_stream() def _get_enhanced_stats_single_live_stream(self): stream_id = '114n9q6a847ieldd8bb8dbf67afef96b' # Replace with a live event or live channel ID. url = "{}{}{}".format(self.host, "/api/v4/monitoring/stream_stats_enhanced/", stream_id) response = requests.get( url, params=APIParams(APICredentials()).get_params({}) ) print(response.json()) GetEnhancedStatsSingleLiveStream().run()
Response:
{ "@id": "/api/v4/monitoring/stream_stats_enhanced/114n9q6a847ieldd8bb8dbf67afef96b", "@type": "StreamStats", "id": "114n9q6a847ieldd8bb8dbf67afef96b", "stats": { "concurrent": { "sessions": 8193, "total_time": 494023.5793121638, "mcs": { "1": { "time": 60.416000000000004, "sessions": 1 } } }, "locations": [{ 'location': 'us:ca', 'sessions': 4215, 'mcs': 0, 'ad_slate': 0 }, { "location": "us:ny", "sessions": 3978, "mcs": 1, "ad_slate": 0 } ], "platforms": [{ "platform": "mac", "sessions": 701, "mcs": 1, "ad_slate": 0 }, { 'platform': 'windows', 'sessions': 7492, 'mcs': 0, 'ad_slate': 0 } ], "domains": [{ "domain": "content.uplynk.com", "sessions": 8193, "mcs": 1, "ad_slate": 0 } ], "type": "channel" }, "ts": 1649318700773, "ts_iso": "2022-04-07T08:05:00.773Z" }
Retrieves the latest statistics for all of the live channels or live events defined in the stream_ids request body property.
Request syntax:
Request body:
Define the desired live channels or live events by passing the following property within a JSON body:
Property |
Data Type |
Description |
---|---|---|
stream_ids |
List of string values |
Defines the set of live channels or live events for which statistics will be returned. Identify each live channel or live event by its system-defined ID. Where can I find a live channel ID?
Where can I find a live event ID?
|
The response for a successful request contains the following properties:
Name |
Data Type |
Description |
---|---|---|
@id |
String |
Indicates the relative path to this endpoint. |
@type |
String |
Returns Collection. |
List of dictionaries |
Provides the latest statistics for each live channel or live event that satisfies the following conditions:
|
|
total_items |
Integer |
Indicates the number of live channels or live events for which statistics were reported. |
The items list provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
@id |
String |
Indicates the relative path to this resource. |
@type |
String |
Returns StreamStats. |
id |
String |
Identifies the live channel or live event by its system-defined ID. |
Dictionary |
Provides statistics for the live channel or live event identified by the id property. Statistics are measured over the minute prior to the time identified by the ts_iso property. |
|
ts |
Integer |
Indicates the Unix time, in milliseconds, at which the statistics were gathered. |
ts_iso |
String |
Indicates the date and time (UTC) at which the statistics were gathered. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ
Example: 2024-01-08T20:31:11.510000Z
|
The stats dictionary provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
auth_failures |
Integer |
Indicates the number of authentication failures that occurred. |
Dictionary |
Contains statistics for concurrent playback sessionsIdentifies a playback session with a duration of at least 1 minute. . |
|
List of dictionaries |
Contains the domains through which viewers requested your live stream. |
|
List of dictionaries |
Contains the locations from which viewers requested your live stream. |
|
Dictionary |
Contains statistics for new playback sessionsIdentifies a playback session whose duration is less than 1 minute.. |
|
List of dictionaries |
Contains the platforms (e.g., android or ios) from which viewers requested your live stream. |
|
type |
String |
Identifies the type of live stream. Valid values are: channel | event
|
The concurrent dictionary provides statistics for playback sessions with a duration of at least 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Dictionary |
Contains ad slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that ad slate was served. Reasons for ad slate are identified by their numeric code. Each of these dictionaries contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. View ad slate codes.
Ad slate codes are defined below.
|
mcs |
Dictionary |
Contains missing content slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
sessions |
Integer |
Indicates the number of concurrent playback sessions over a given minute. |
total_time |
Float |
Indicates the number of seconds of video served for concurrent playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
The domains dictionary provides statistics for each domain through which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
domain |
String |
Indicates the domain through which the live stream was requested. Example: This property reports content.uplynk.com for the following playback URL: https://content.uplynk.com/channel/cd772adbd60a4e898d1c3b1f46c58cea.m3u8
|
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream from the domain identified in the domain property over a given minute. |
The locations dictionary provides statistics for each location from which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
location |
String |
Identifies the location from which the viewer requested your live stream. Syntax: Country CodeRepresents a two-character ISO 3166 country code.:RegionRepresents an abbreviation for the region from which the live stream was requested.
If our service cannot determine a viewer's region, then we return a ?? value for the region (e.g., il:??). Example: The following location identifies a viewer that requested your live stream from California, USA. us:ca
|
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream from the location identified in the location property over a given minute. |
The new dictionary provides statistics for playback sessions whose duration is less than 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Dictionary |
Contains ad slate statistics for new playback sessions. This dictionary contains a dictionary for each reason that ad slate was served. Reasons for ad slate are identified by their numeric code. Each of these dictionaries contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. View ad slate codes.
Ad slate codes are defined below.
|
mcs |
Dictionary |
Contains missing content slate statistics for new playback sessions. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
sessions |
Integer |
Indicates the number of new playback sessions over a given minute. |
total_time |
Float |
Indicates the number of seconds of video served for new playback sessions. |
The platforms dictionary provides statistics for each platform from which your live stream was requested for playback sessions with a duration of at least 1 minute:
Name |
Data Type |
Description |
---|---|---|
ad_slate |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
platform |
String |
Indicates the platform (e.g., windows and mac) on which the live stream was requested. |
mcs |
Integer |
Indicates the number of playback sessions over a given minute that meet the following conditions:
|
sessions |
Integer |
Indicates the number of playback sessions that requested the live stream on the platform identified in the platform property over a given minute. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
Call the get_enhanced_stats_multiple_live_streams_v4 module (Python 3) to retrieve the latest statistics for three live channels. This module imports names from the api_auth module.
import json import requests from api_auth import APICredentials, APIParams class GetEnhancedStatsMultipleLiveStreams: def __init__(self): self.host = "https://services.uplynk.com" def run(self): """ Get the enhanced statistics for multiple live streams. """ self._get_enhanced_stats_multiple_live_streams() def _get_enhanced_stats_multiple_live_streams(self): url = "{}{}".format(self.host, "/api/v4/monitoring/stream_stats_enhanced") stream_ids = ['114n9q6a847ieldd8bb8dbf67afef96b', 'k30y636fa2f143eb95c7a41d96d581c4', 'n2fj4f8knf83nf81347fh12347fhjwse'] # Replace with the IDs for the desired live channel(s) and live event(s). headers = {'Content-Type': 'application/json'} response = requests.post( url, params=APIParams(APICredentials()).get_params({}), json={"stream_ids": json.dumps(stream_ids)}, headers=headers ) print(response.json()) GetEnhancedStatsMultipleLiveStreams().run()
Response:
{ '@id': '/api/v4/monitoring/stream_stats_enhanced', '@type': 'Collection', 'items': [{ "@id": "/api/v4/monitoring/stream_stats_enhanced/114n9q6a847ieldd8bb8dbf67afef96b", "@type": "StreamStats", "id": "114n9q6a847ieldd8bb8dbf67afef96b", "stats": { "concurrent": { "sessions": 8193, "total_time": 494023.5793121638, "mcs": { "1": { "time": 60.416000000000004, "sessions": 1 } } }, "locations": [{ 'location': 'us:ca', 'sessions': 4215, 'mcs': 0, 'ad_slate': 0 }, { "location": "us:ny", "sessions": 3978, "mcs": 1, "ad_slate": 0 } ], "platforms": [{ "platform": "mac", "sessions": 701, "mcs": 1, "ad_slate": 0 }, { 'platform': 'windows', 'sessions': 7492, 'mcs': 0, 'ad_slate': 0 } ], "domains": [{ "domain": "content.uplynk.com", "sessions": 8193, "mcs": 1, "ad_slate": 0 } ], "type": "channel" }, "ts": 1649318700773, "ts_iso": "2022-04-07T08:05:00.773Z" }, { '@id': '/api/v4/monitoring/stream_stats_enhanced/k30y636fa2f143eb95c7a41d96d581c4', '@type': 'StreamStats', 'id': 'k30y636fa2f143eb95c7a41d96d581c4', 'stats': { 'concurrent': { 'sessions': 4, 'total_time': 258.048 }, 'locations': [{ 'location': 'us:ca', 'sessions': 4, 'mcs': 0, 'ad_slate': 0 } ], 'platforms': [{ 'platform': 'windows', 'sessions': 3, 'mcs': 0, 'ad_slate': 0 }, { 'platform': 'mac', 'sessions': 1, 'mcs': 0, 'ad_slate': 0 } ], 'domains': [{ 'domain': 'content.uplynk.com', 'sessions': 4, 'mcs': 0, 'ad_slate': 0 } ], 'type': 'channel' }, 'ts': 1649801640042, 'ts_iso': '2022-04-12T22:14:00.042Z' }, { '@id': '/api/v4/monitoring/stream_stats_enhanced/n2fj4f8knf83nf81347fh12347fhjwse', '@type': 'StreamStats', 'id': 'n2fj4f8knf83nf81347fh12347fhjwse', 'stats': None, 'ts': None, 'ts_iso': None } ], 'total_items': 3 }
This endpoint has been deprecated in favor of the Get Enhanced Statistics - Single Live Stream endpoint that returns a richer set of statistics. Update your scripts to use the new endpoint at your earliest convenience.
Retrieves the latest statistics for a live channel or live event provided that it has viewership. Identify a live channel or live event by its system-defined ID.
Request syntax:
Pass a digital signature based off of msg.
The response for a successful request contains the following properties:
Name |
Data Type |
Description |
---|---|---|
ts_iso |
String |
Indicates the date and time (UTC) at which statistics were gathered. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ
Example: 2024-01-08T20:31:11.510000Z
|
Dictionary |
Provides statistics for the live channel or live event identified by the id property. Statistics are measured over the minute prior to the time identified by the ts_iso property. |
|
ts |
Integer |
Indicates the Unix time, in milliseconds, at which the statistics were gathered. |
@id |
String |
Indicates the relative path to this endpoint. |
@type |
String |
Returns StreamStats. |
id |
String |
Identifies a live channel or live event by its system-defined ID. |
The stats dictionary provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Contains statistics for concurrent playback sessionsIdentifies a playback session with a duration of at least 1 minute. . |
|
Dictionary |
Contains statistics for new playback sessionsIdentifies a playback session whose duration is less than 1 minute.. |
|
auth_failures |
Integer |
Indicates the number of authentication failures that occurred. |
type |
String |
Identifies the type of live stream. Valid values are: channel | event
|
The concurrent dictionary provides statistics for playback sessions with a duration of at least 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
sessions |
Integer |
Indicates the number of concurrent playback sessions over a given minute. |
mcs |
Dictionary |
Contains missing content slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
ad_slate |
Dictionary |
Contains ad slate statistics for concurrent playback sessions. This dictionary contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
total_time |
Float |
Indicates the number of seconds of video served for concurrent playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
The new dictionary provides statistics for playback sessions whose duration is less than 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
sessions |
Integer |
Indicates the number of new playback sessions over a given minute. |
mcs |
Dictionary |
Contains missing content slate statistics for new playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
ad_slate |
Dictionary |
Contains ad slate statistics for new playback sessions. This dictionary contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
total_time |
Float |
Indicates the number of seconds of video served for new playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
Call the get_latest_stats_single_live_stream_v4 module (Python 3) to retrieve the latest statistics for a live channel whose system-defined ID is "114n9q6a847ieldd8bb8dbf67afef96b." This module imports names from the api_auth module.
import json import requests from api_auth import APICredentials, APIParams class GetLatestStatsSingleLiveStream: def __init__(self): self.host = "https://services.uplynk.com" def run(self): """ Get the latest statistics for a single live stream. """ self._get_latest_stats_single_live_stream() def _get_latest_stats_single_live_stream(self): url = "{}{}".format(self.host, "/api/v4/monitoring/stream_stats/114n9q6a847ieldd8bb8dbf67afef96b") response = requests.get( url, params=APIParams(APICredentials()).get_params({}) ) print(response.json()) GetLatestStatsSingleLiveStream().run()
Response:
{ "ts_iso": "2020-04-04T13:08:40.631000Z", 'stats': { 'type': 'channel', "new": { "total_time": 3788.800000000003, "sessions": 113 }, "auth_failures": 65, "concurrent": { "total_time": 397096.7193541689, "mcs": { "12": { "sessions": 2, "time": 89.08800000000001 } }, "sessions": 6596 } }, "ts": 1586005720631, "id": "d0695f6fa2f143eb95c7a41d96d581c4", "@id": "/api/v4/monitoring/stream_stats/d0695f6fa2f143eb95c7a41d96d581c4", "@type": "StreamStats" }
This endpoint has been deprecated in favor of the Get Enhanced Statistics - Multiple Live Streams endpoint that returns a richer set of statistics. Update your scripts to use the new endpoint at your earliest convenience.
Retrieves the latest statistics for all of the live channels or live events defined in the stream_ids request body property.
Request syntax:
Request body:
Define the desired live channels or live events by passing the following property within a JSON body:
Property |
Data Type |
Description |
---|---|---|
stream_ids |
List of string values |
Defines the set of live channels or live events for which statistics will be returned. Identify each live channel or live event by its system-defined ID. Where can I find a live channel ID?
Where can I find a live event ID?
|
The response for a successful request contains the following properties:
Name |
Data Type |
Description |
---|---|---|
total_items |
Integer |
Indicates the number of live channels or live events for which statistics were reported. |
List of dictionaries |
Provides the latest statistics for each live channel or live event that satisfies the following conditions:
|
|
@id |
String |
Indicates the relative path to this endpoint. |
@type |
String |
Returns Collection. |
The items list provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
ts_iso |
String |
Indicates the date and time (UTC) at which the statistics were gathered. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ
Example: 2024-01-08T20:31:11.510000Z
|
Dictionary |
Provides statistics for the live channel or live event identified by the id property. Statistics are measured over the minute prior to the time identified by the ts_iso property. |
|
ts |
Integer |
Indicates the Unix time, in milliseconds, at which the statistics were gathered. |
@id |
String |
Indicates the relative path to this resource. |
@type |
String |
Returns StreamStats. |
id |
String |
Identifies the live channel or live event by its system-defined ID. |
The stats dictionary provides statistics for one or more live channels/live events through the following properties:
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Contains statistics for concurrent playback sessionsIdentifies a playback session with a duration of at least 1 minute. . |
|
Dictionary |
Contains statistics for new playback sessionsIdentifies a playback session whose duration is less than 1 minute.. |
|
auth_failures |
Integer |
Indicates the number of authentication failures that occurred. |
type |
String |
Identifies the type of live stream. Valid values are: channel | event
|
The concurrent dictionary provides statistics for playback sessions with a duration of at least 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
sessions |
Integer |
Indicates the number of concurrent playback sessions over a given minute. |
mcs |
Dictionary |
Contains missing content slate statistics for concurrent playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
ad_slate |
Dictionary |
Contains ad slate statistics for concurrent playback sessions. This dictionary contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
total_time |
Float |
Indicates the number of seconds of video served for concurrent playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
The new dictionary provides statistics for playback sessions whose duration is less than 1 minute through the following properties:
Name |
Data Type |
Description |
---|---|---|
sessions |
Integer |
Indicates the number of new playback sessions over a given minute. |
mcs |
Dictionary |
Contains missing content slate statistics for new playback sessions over a given minute. This dictionary contains a dictionary for each reason that missing content slate was served. Reasons for missing content slate are identified by their numeric code. Each of these dictionaries contains the following properties:
View missing content slate codes.
Missing content slate codes are defined below.
|
ad_slate |
Dictionary |
Contains ad slate statistics for new playback sessions. This dictionary contains the following properties:
Ad slate delivery is the expected behavior when ad duration is shorter than the total ad break duration. Typically, ad slate delivery will not exceed a few seconds when this occurs. This metric does not include sessions experiencing slate when an ad has not been requested. For example, it is not triggered if an ad configuration is not defined in the URL query string or if an invalid ad configuration is defined. |
total_time |
Float |
Indicates the number of seconds of video served for new playback sessions. |
Statistics are measured over the minute prior to the time identified by the ts_iso property.
Call the get_latest_stats_multiple_live_streams_v4 module (Python 3) to retrieve the latest statistics for three live channels. This module imports names from the api_auth module.
import json import requests from api_auth import APICredentials, APIParams class GetLatestStatsMultipleLiveStreams: def __init__(self): self.host = "https://services.uplynk.com" def run(self): """ Get the latest statistics for multiple live streams. """ self._get_latest_stats_multiple_live_streams() def _get_latest_stats_multiple_live_streams(self): url = "{}{}".format(self.host, "/api/v4/monitoring/stream_stats") stream_ids = ['114n9q6a847ieldd8bb8dbf67afef96b', 'k30y636fa2f143eb95c7a41d96d581c4', 'n2fj4f8knf83nf81347fh12347fhjwse'] headers = {'Content-Type': 'application/json'} response = requests.post( url, params=APIParams(APICredentials()).get_params({}), json={"stream_ids": json.dumps(stream_ids)}, headers=headers ) print(response.json()) GetLatestStatsMultipleLiveStreams().run()
Response:
{ "total_items": 2, "items": [{ "ts_iso": "2020-04-04T13:05:36.794000Z", 'stats': { 'type': 'channel', "new": { "total_time": 13033.471999999958, "sessions": 391 }, "auth_failures": 2, "concurrent": { "total_time": 686170.6169999979, "mcs": { "12": { "sessions": 7, "time": 484.39006250000006 } }, "sessions": 11402 } }, "ts": 1586005536794, "id": "3324f2467c414329b3b0cc5cd987b6be", "@id": "/api/v4/monitoring/stream_stats/3324f2467c414329b3b0cc5cd987b6be", "@type": "StreamStats" }, { "ts_iso": "2020-04-04T13:05:33.145000Z", 'stats': { 'type': 'channel', "new": { "total_time": 6164.4799999999905, "sessions": 182 }, "auth_failures": 71, "concurrent": { "total_time": 390683.2433750022, "mcs": { "5": { "sessions": 1, "time": 17.28 } }, "sessions": 6503 } }, "ts": 1586005533145, "id": "d0695f6fa2f143eb95c7a41d96d581c4", "@id": "/api/v4/monitoring/stream_stats/d0695f6fa2f143eb95c7a41d96d581c4", "@type": "StreamStats" } ], "@id": "/api/v4/monitoring/stream_stats", "@type": "Collection" }