Get Enhanced Statistics - Single Live Stream

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.

Where can I find a live channel ID?

  1. From the CMS, click the Live Channels tab.
  2. Select the desired live channel.
    Basic options and live channel information will be displayed on the Details tab.
  3. Find the live channel's system-defined ID under the GUID label.

Where can I find a live event ID?

  1. Navigate to the Live Events page. How? From the main menu, navigate to Events | Live Events.
  2. Select the desired live event.
  3. Verify that the Details tab is selected.
  4. Find the live event's system-defined ID under the GUID label.

Request

Request syntax:

GET /monitoring/stream_stats_enhanced/Live Channel or Live Event ID

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to this resource.
@typeStringReturns StreamStats.
idStringIdentifies the live channel or live event by its system-defined ID.
statsDictionaryProvides 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.
tsIntegerIndicates the Unix time, in milliseconds, at which the statistics were gathered.
ts_isoStringIndicates the date and time (UTC) at which the statistics were gathered. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ Example: 2023-01-08T20:31:11.510000Z

stats Dictionary

The stats dictionary provides statistics for one or more live channels/live events through the following properties:

NameData TypeDescription
auth_failuresIntegerIndicates the number of authentication failures that occurred.
concurrentDictionaryContains statistics for concurrent playback sessionsIdentifies a playback session with a duration of at least 1 minute. .
domainsList of dictionariesContains the domains through which viewers requested your live stream.
locationsList of dictionariesContains the locations from which viewers requested your live stream.
newDictionaryContains statistics for new playback sessionsIdentifies a playback session whose duration is less than 1 minute..
platformsList of dictionariesContains the platforms (e.g., android or ios) from which viewers requested your live stream.
typeStringIdentifies the type of live stream. Valid values are: channelevent
concurrent Dictionary

The concurrent dictionary provides statistics for playback sessions with a duration of at least 1 minute through the following properties:

NameData TypeDescription
ad_slateDictionaryContains 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: time: Indicates the number of seconds that ad slate was served over a given minute. sessions: Indicates the number of playback sessions over a given minute that served ad slate. 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. ClosedView ad slate codes. Ad slate codes are defined below. 1: The system could not stream an ad either due to insufficient ad content for the current ad break or the current ad contains missing slices. 2: The system could not stream an ad due to insufficient time left in the ad break. 3: The system served slate after chopping an ad. 4: The system served slate after the completion of the ad break. 5: The system served slate after streaming all ads within a linear playlist. 6: The system served slate upon the completion of an ad break due to insufficient content. 7: The system served slate because the scheduled asset was either missing or the current user is not authorized to stream it. 8: The system served slate after the completion of the ad break. 9: The system served slate because it has not received ad content yet. 12: The system served slate upon the completion of an asset. 97: The system served slate for an unknown reason. 98: The system served slate during a live event due to insufficient content.
mcsDictionaryContains 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: time: Indicates the number of seconds that missing content slate was served over a given minute for the reason indicated by the missing content slate code. sessions: Indicates the number of playback sessions over a given minute that served missing content slate for the reason indicated by the missing content slate code. ClosedView missing content slate codes. Missing content slate codes are defined below. 1: The system could not find the asset. 2: The user account corresponding to the Live Slicer was unauthorized to play that asset. 3: The system attempted to play an asset, but it ended prior to playback. 4: The system attempted to play alternate content for a blacked out program, but it could not find the asset. 5: The system could not find the subsequent asset. 6: The system either could not find the asset or the user account corresponding to the Live Slicer was unauthorized to play that asset. 7: The system either could not find the asset or the user account corresponding to the Live Slicer was unauthorized to play that asset. 8: The system could not identify the user account corresponding to the Live Slicer. 9: The system could not find the asset. 10: The user account corresponding to the Live Slicer was unauthorized to play that asset. 11: The system could not retrieve the asset from the database or it was scheduled too far into the future. 12: The system attempted to request content past the end of the asset. 13: The system attempted to play content past the end of the program and content is not currently being played. 14: The system switched to a different asset after attempting to play an asset whose duration exceed the available playback window. 15: The system could not find the next slice within replacement content. 16:The system encountered missing content. 97: The system could not identify the reason why missing content slate was streamed. 98: The system played default slate because an asset was not defined for playback. 100: The live event has not started. 101: The live event has ended. 102: The live event instructed our service to stream slate. 103: A Live Slicer has not been assigned to the live event. 104: The system could not find content for the requested timestamp. 105: The system could not find content for the requested timestamp. 106: The system could not find content for the requested timestamp. 107: The system played slate. 108: The system could not find content for the requested timestamp. 109: A viewer was watching ad slate when operator-defined slate was scheduled to start. 110: The live event has not started. 111: The live event has ended. 112: The live event has ended. 113: The live event has ended. 114: A viewer was watching slate when a different type of slate was scheduled to start. 115: The service streamed the last beamA single piece of content prepared for streaming. A beam is composed of one or more rays., but could not find additional content generated by a Live Slicer. 116: The service played slate due to either missing content or because the operator requested it. 117: The service could not find content for the specified timestamp. 200: The service attempted to stream an empty playlist. 201: The service played slate upon the completion of the playlist. * 202: The service detected an invalid entry within the playlist.
sessionsIntegerIndicates the number of concurrent playback sessions over a given minute.
total_timeFloatIndicates 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.

domains Dictionary

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:

NameData TypeDescription
ad_slateIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the domain identified in the domain property. It served ad slate. 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.
domainStringIndicates 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
mcsIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the domain identified in the domain property. It served missing content slate.
sessionsIntegerIndicates the number of playback sessions that requested the live stream from the domain identified in the domain property over a given minute.
locations Dictionary

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:

NameData TypeDescription
ad_slateIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the location identified in the location property. It served ad slate. 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.
locationStringIdentifies 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. View a list of country codes. 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
mcsIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the location identified in the location property. It served missing content slate.
sessionsIntegerIndicates the number of playback sessions that requested the live stream from the location identified in the location property over a given minute.
new Dictionary

The new dictionary provides statistics for playback sessions whose duration is less than 1 minute through the following properties:

NameData TypeDescription
ad_slateDictionaryContains 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: time: Indicates the number of seconds that ad slate was served over a given minute. sessions: Indicates the number of playback sessions over a given minute that served ad slate. 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. ClosedView ad slate codes. Ad slate codes are defined below. 1: The system could not stream an ad either due to insufficient ad content for the current ad break or the current ad contains missing slices. 2: The system could not stream an ad due to insufficient time left in the ad break. 3: The system served slate after chopping an ad. 4: The system served slate after the completion of the ad break. 5: The system served slate after streaming all ads within a linear playlist. 6: The system served slate upon the completion of an ad break due to insufficient content. 7: The system served slate because the scheduled asset was either missing or the current user is not authorized to stream it. 8: The system served slate after the completion of the ad break. 9: The system served slate because it has not received ad content yet. 12: The system served slate upon the completion of an asset. 97: The system served slate for an unknown reason. 98: The system served slate during a live event due to insufficient content.
mcsDictionaryContains 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: time: Indicates the number of seconds that missing content slate was served over a given minute for the reason indicated by the missing content slate code. sessions: Indicates the number of playback sessions over a given minute that served missing content slate for the reason indicated by the missing content slate code. ClosedView missing content slate codes. Missing content slate codes are defined below. 1: The system could not find the asset. 2: The user account corresponding to the Live Slicer was unauthorized to play that asset. 3: The system attempted to play an asset, but it ended prior to playback. 4: The system attempted to play alternate content for a blacked out program, but it could not find the asset. 5: The system could not find the subsequent asset. 6: The system either could not find the asset or the user account corresponding to the Live Slicer was unauthorized to play that asset. 7: The system either could not find the asset or the user account corresponding to the Live Slicer was unauthorized to play that asset. 8: The system could not identify the user account corresponding to the Live Slicer. 9: The system could not find the asset. 10: The user account corresponding to the Live Slicer was unauthorized to play that asset. 11: The system could not retrieve the asset from the database or it was scheduled too far into the future. 12: The system attempted to request content past the end of the asset. 13: The system attempted to play content past the end of the program and content is not currently being played. 14: The system switched to a different asset after attempting to play an asset whose duration exceed the available playback window. 15: The system could not find the next slice within replacement content. 16:The system encountered missing content. 97: The system could not identify the reason why missing content slate was streamed. 98: The system played default slate because an asset was not defined for playback. 100: The live event has not started. 101: The live event has ended. 102: The live event instructed our service to stream slate. 103: A Live Slicer has not been assigned to the live event. 104: The system could not find content for the requested timestamp. 105: The system could not find content for the requested timestamp. 106: The system could not find content for the requested timestamp. 107: The system played slate. 108: The system could not find content for the requested timestamp. 109: A viewer was watching ad slate when operator-defined slate was scheduled to start. 110: The live event has not started. 111: The live event has ended. 112: The live event has ended. 113: The live event has ended. 114: A viewer was watching slate when a different type of slate was scheduled to start. 115: The service streamed the last beamA single piece of content prepared for streaming. A beam is composed of one or more rays., but could not find additional content generated by a Live Slicer. 116: The service played slate due to either missing content or because the operator requested it. 117: The service could not find content for the specified timestamp. 200: The service attempted to stream an empty playlist. 201: The service played slate upon the completion of the playlist. * 202: The service detected an invalid entry within the playlist.
sessionsIntegerIndicates the number of new playback sessions over a given minute.
total_timeFloatIndicates the number of seconds of video served for new playback sessions.
platforms Dictionary

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:

NameData TypeDescription
ad_slateIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the platform identified in the platform property. It served ad slate. 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.
platformStringIndicates the platform (e.g., windows and mac) on which the live stream was requested.
mcsIntegerIndicates the number of playback sessions over a given minute that meet the following conditions: It requested the live stream from the platform identified in the platform property. It served missing content slate.
sessionsIntegerIndicates 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.

Sample Request/Response

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"
}