The Streamroot Data API gives access to traffic, audience and bandwidth stats for P2P and CDN delivery. This article explains how to get the data in a time series 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. |
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 over time
Endpoint
GET https://apiv2.streamroot.io/data/timeseries/usage
Response
{
"cdn": [
[
1459866300000, // Unix timestamp
20072998368.000000 // Bytes downloaded through CDN
],
[
1459866600000,
50963617612.000000
],
[
1459866900000,
56408763304.000000
]
],
"p2p": [
[
1459866300000,
25152655104.000000 // Bytes downloaded through peer to peer
],
[
1459866600000,
64738301462.000000
],
[
1459866900000,
66325543683.000000
]
]
}
Audience over time
Endpoint
GET https://apiv2.streamroot.io/data/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
{
"cdn": [
[
1459866900000, // Unix timestamp
0.000000 // Maximum CDN bandwidth between this timestamp and the next the interval
// Bytes/second
],
[
1459867200000,
1590794784.853333
],
[
1459867500000,
1431862674.453333
]
],
"p2p": [
[
1459866900000,
0.000000 // Maximum P2P bandwidth in the interval in Bytes/second
],
[
1459867200000,
1801694511.573333
],
[
1459867500000,
1855446349.653333
]
]
}