45ec26f342b6
Retrieve aggregated metrics
Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time.
Path parameters
Use this path parameter to select a metric that you want analytics for.
- play is the number of times your content has been played. You can use the aggregations count, rate, and total with the play metric.
- start is the number of times playback was started. You can use the aggregation count with this metric.
- end is the number of times playback has ended with the content watch until the end. You can use the aggregation count with this metric.
- impression is the number of times your content has been loaded and was ready for playback. You can use the aggregation count with this metric.
- impression-time is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations average and sum with this metric.
- watch-time is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations average and sum with this metric.
- ccv: is the number of concurrent viewers, or users watching at the same time.
- view: the total number of viewers until this point in time.
Use this path parameter to define a way of collecting data for the metric that you want analytics for.
- count returns the overall number of events for the play metric.
- rate returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the play metric.
- total calculates the total number of events for the play metric.
- average calculates an average value for the selected metric.
- sum adds up the total value of the select metric.
- peak shows the highest value of the ccv metric in the timeframe of your request. You can use this aggregation only with the ccv metric.
- live shows the highest value of the ccv metric from the last 20 seconds. You can use this aggregation only with the ccv metric.
Query parameters
Use this query parameter to define the starting date-time of the period you want analytics for.
- If you do not set a value for from, the default assigned value is 1 day ago, based on the to parameter.
- The maximum value is 30 days ago.
- The value you provide should follow the ATOM date-time format: 2024-02-05T00:00:00+01:00
- The API ignores this parameter when you call /data/metrics/play/total.
Use this query parameter to define the ending date-time of the period you want analytics for.
- If you do not set a value for to, the default assigned value is now.
- The API ignores this parameter when you call /data/metrics/play/total.
- The value for to is a non-inclusive value: the API returns data before the date-time that you set.
Use this query parameter to control how viewer data is counted:
- true means that a single user watching multiple times counts as 1 unique viewer
- false means that all views count, even if from the same user.
The API accepts this parameter only when you use the ccv or view metric.
Viewers are unique for 1 day.
The API determines uniqueness based on a viewer's user-agent and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times.
Use this query parameter to define how many seconds a view has to last to be counted in analytics data.
- You can only use this parameter with the view metric.
- The accepted values are 3s, 5s, 10s, and 30s.
- If you do not set this parameter, the API defaults to 5s.
Parameters
Response
Success
Example response
{
"data": 356.2,
"context": {
"timeframe": {
"from": "2024-05-28T11:15:07Z",
"to": "2024-05-29T11:15:07Z"
},
"metric": "impression",
"aggregation": "count"
}
}