The Streamroot Data API gives access to stats for CDN Load Balancer. This article explains how to get the data.
Time series
Query parameters
Parameter | Type | Description |
since | string |
Since given elapsed time - (s=seconds, d=days, h=hours, w=weeks). |
from | string | YYYY-MM-DD or Unix timestamp. Required if param 'to' present. |
to | string |
YYYY-MM-DD or Unix timestamp. Required if param 'from' present. |
interval | string |
Time between 2 timestamps - (s=seconds, d=days, h=hours, w=weeks). |
stream | string |
Filter for a given manifest. |
live | boolean | Filter to get only live or only VoD. |
Traffic by CDN
Endpoint
GET https://apiv2.streamroot.io/data/compass/timeseries/traffic
Response
{
"bandwidth": [
{
"cdn_id": "5c3e11168ec430a0f2c7982d",
"bandwidth": [
[
1548172800000, // UNIX timestamp
1590794784.853333 // Average CDN Bandwidth during the period (in bits/seconds)
],
[
1548176400000,
1431862674.453333
],
[
1548180000000,
1590794784.853333
]
]
},
{
"cdn_id": "5c3e11170ec430a0f2c7982d",
"bandwidth": [
[
1548172800000,
1431862674.453333
],
[
1548176400000,
1590794784.853333
],
[
1548180000000,
1590794784.853333
]
]
}
]
}
CDN download errors
Endpoint
GET https://apiv2.streamroot.io/data/compass/timeseries/cdnerrors
Response
{
"cdnErrors": [
{
"cdn_id":"5c3e11168ec530a0f2c7982d",
"seg_count": [
[
1459866300000, // UNIX timestamp
72998368 //Number of downloaded video segments
],
[
1459866600000,
902998368
],
],
"seg_err_count": [
[
1459866300000, // UNIX timestamp
10 //Number of segments download errors
],
[
1459866600000,
4
],
],
},
{
"cdn_id":"5c3e11168ec530a0f7c7982d",
"seg_count": [
[
1459866300000, // UNIX timestamp
72998368 //Number of downloaded video segments
],
[
1459866600000,
902998368
],
],
"seg_err_count": [
[
1459866300000, // UNIX timestamp
10 //Number of segments download errors
],
[
1459866600000,
4
],
],
},
]
}
Audience
Endpoint
GET https://apiv2.streamroot.io/data/compass/timeseries/audience
Response
{
"audience": [
[
1459866600000, // Unix timestamp
5108 // Count of distinct viewers
],
[
1459866900000,
5284
],
[
1459867200000,
5445
],
[
1459867500000,
5663
],
[
1459867800000,
5805
],
[
1459868100000,
6012
]
]
}
Bandwidth over time
Endpoint
GET https://apiv2.streamroot.io/data/timeseries/bandwidth
Response
{
"bandwidth": [
{
"cdn_id": "5c3e11168ec430a0f2c7982d",
"bandwidth": [
[
1548172800000, // UNIX timestamp
1590794784.853333 // Average CDN bandwidth during the period (in bits/seconds)
],
[
1548176400000,
1431862674.453333
],
[
1548180000000,
1590794784.853333
]
]
},
{
"cdn_id": "5c3e11170ec430a0f2c7982d",
"bandwidth": [
[
1548172800000,
1431862674.453333
],
[
1548176400000,
1590794784.853333
],
[
1548180000000,
1590794784.853333
]
]
}
]
}
Aggregates
Query parameters
Parameter | Type | Description |
since | string |
Since given elapsed time - (s=seconds, d=days, h=hours, w=weeks). |
from | string | YYYY-MM-DD or Unix timestamp. Required if param 'to' present. |
to | string |
YYYY-MM-DD or Unix timestamp. Required if param 'from' present. |
stream | string |
Filter for a given manifest. |
live | boolean | Filter to get only live or only VoD. |
CDN Errors
Endpoint
GET https://apiv2.streamroot.io/data/compass/cdnerrors
Response
[
{
"cdn_id": "5c3e11168ec430a0f2c7982d",
"seg_count": 432, //Number of downloaded video segments
"seg_err_count": 0 //Number of segments download errors
},
{
"cdn_id": "5c3e11318ec430a0f2c79ca6",
"seg_count": 52,
"seg_err_count": 3
}
]
Traffic
Endpoint
GET https://apiv2.streamroot.io/data/compass/traffic
Response
[
{
"cdn_id": "5c3e11168ec430a0f2c7982d",
"sum_bytes": 188358568 // Bytes downloaded through CDN during the period
},
{
"cdn_id": "5c3e11318ec430a0f2c79ca6",
"sum_bytes": 25966568
}
]
Bandwidth
Endpoint
GET https://apiv2.streamroot.io/data/compass/bandwidth
Response
[
{
"cdn_id": "5c3e11168ec430a0f2c7982d",
"bandwidth": 188358568 // Average CDN bandwidth during the period in bits/second
},
{
"cdn_id": "5c3e11318ec430a0f2c79ca6",
"bandwidth": 25966568 // Average CDN bandwidth during the period in bits/second
}
]
Audience overall
Endpoint
GET https://apiv2.streamroot.io/data/compass/audience
Response
{
"max": 6809, // Maximum number of concurrent viewers during the period
"average": 1559 // Average number of concurrent viewers during the period
"audience95th" : 1234 // 95th percentile of concurrent viewer during the period
}