Stream Analytics

The following set of APIs are used to query analytical data from video streams

API Calls

Live and Video On-Demand (VOD) Stream Analytics

GET /mm-apis/qbrData/vod/{customerId}

Content-Type: application/jsonRetrieves analytics of live and on-demand video streams sourced from video players.

QBR-enabled Packager Analytics

GET /mm-apis/qbrData/live/{customerId}

Content-Type: application/jsonRetrieves analytics of QBR-enabled streams sourced from Packagers/Transcoders. Available only when the encoder has been configured with the MediaMelon QBR SDK.

Required Parameters

The following request parameters are common to both APIs and are required for all queries.

Request Parameter

Data Type

Data Format

Description

Example

dimension

String

Comma-separated

Required. The attribute(s) of video stream, such as the playback asset.

dimmension=asset

metrics

String

Comma-separated

Quantifiable attributes of a dimension, such as the number of times an asset was played.

metrics=viewercount

period

String

Comma-separated key-value pairs

The time range to be queried, with start and end in epoch timestamps.

period=start=1495599056, end=1495599116

Optional Parameters

The following request parameters are common to both APIs and are optional.

Request Parameter

Data Type

Data Format

Description

Example

agg

Integer

One of 0 or 1

agg=1

aggby

String

Single value

aggby=device

count

Integer

One of 0 or 1

count=0

filter

String

Commma-separated key-value pairs

filter=city=Bengaluru | SanDiego, device= Smartphone

[Returns data for Smartphone devices in Bengaluru and San Diego cities.]

limit

Integer

Single value

limit=10

offset

Integer

Single value

offset=17

orderas

String

One of ASC or DESC

orderas=ASC

orderby

String

Single value

orderby=country

Response

The response is a JSON object containing the following fields.

Response Field

Data Type

Description

totalcount

Integer

The total number of records in the result set.

pagecount

Integer

The number of records returned in the current result set. Will be the size of page in paginated requests. By default, returns all records.

response

Array

The response is an array of objects, where each object contains key-value pairs of the metrics that are queried for.

Sample Request and Response

https://smartsight.mediamelon.com/api/mm-apis/qbrData/vod/123456?period=start%3D1499773995%2Cend%3D1499775795&metrics=assetid&dimension=asset&count=1&agg=1&aggby=assetid

{“totalcount”:8,”pagecount”:8,”response”:[{“assetid”:”X-Men”},{“assetid”:”PrisonBreak”},{“assetid”:”Simpsons”},{“assetid”:”GameOfThrones”},{“assetid”:”RaceCar”},{“assetid”:”TearsOfSteel”},{“assetid”:”BigBuckBunny”},{“assetid”:”RickAndMorty”}]}

Last updated