The Streamroot Data API gives access to overall traffic, audience and bandwidth stats for P2P and CDN delivery. This article explains how to get the data in an aggregates format.
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. |
Traffic overall
Endpoint
GET https://apiv2.streamroot.io/data/traffic
Response
{
"cdn": 1.37629688435669e+14, // Bytes downloaded through CDN during the period
"p2p": 1.41125192621073e+14 // Bytes downloaded through P2P during the period
}
Bandwidth overall
Endpoint
GET https://apiv2.streamroot.io/data/bandwidth
Response
{
"averagep2p": 2456328260, // Average P2P bandwidth during the period in bits/second
"maxcdn": 6133702320, // Maximum CDN bandwidth during the period in bits/second
"maxp2p": 2111377784, // Maximum P2P bandwidth during the period in bits/second
"max": 8245080104, // Maximum bandwidth (P2P + CDN) during the period in bits/second
"p2p95th": 7845080104 // 95th bandwidth percentile during the period in bits/second
}
Audience overall
Endpoint
GET https://apiv2.streamroot.io/data/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
}