Skip to main content
GET
/
library
/
{libraryId}
/
statistics
Get Video Statistics
curl --request GET \
  --url https://video.bunnycdn.com/library/{libraryId}/statistics \
  --header 'AccessKey: <api-key>'
{
  "viewsChart": {},
  "watchTimeChart": {},
  "countryViewCounts": {},
  "countryWatchTime": {},
  "engagementScore": 123
}

Authorizations

AccessKey
string
header
required

AccessKey based authentication

Path Parameters

libraryId
integer<int64>
required

Query Parameters

dateFrom
string<date-time> | null

Optional start of the time range (UTC). If omitted or invalid, the last 30 days are returned.

dateTo
string<date-time> | null

Optional end of the time range (UTC). If omitted with a valid start, defaults to now; otherwise the last 30 days are returned.

hourly
boolean
default:false

Optional. If true, returns hourly data; otherwise daily (UTC). Default is daily.

videoGuid
string | null

Optional video GUID to filter results. When omitted, returns library-level aggregates.

Response

Statistics including time-series views and watch time, country breakdowns, and engagement score when available.

viewsChart
object

Shows the number of playback starts over time, with each data point representing the count of view starts in the corresponding UTC interval (hourly or daily). It is available at both the library level (aggregated across all videos) and the video level (for a single video). A playback start is counted once per viewer session per video and empty intervals are shown as zero.

watchTimeChart
object

Shows the cumulative time viewers spent watching over time, with each data point representing total watch time in the corresponding UTC interval (hourly or daily). It is available at both the library level (aggregated across all videos) and the video level (for a single video). Rewatches and repeated visits add to the total and empty intervals are shown as zero.

countryViewCounts
object

Shows the total number of playback starts by country for the selected time range. It is available at both the library level (aggregated across all videos) and the video level (for a single video). Each country’s value reflects unique playback starts per viewer session based on IP geolocation at playback start.

countryWatchTime
object

Shows the total watch time by country for the selected time range. It is available at both the library level (aggregated across all videos) and the video level (for a single video). Values reflect cumulative viewing time (rewatches and repeated visits add to the total) based on IP geolocation at playback start.

engagementScore
integer<int32>

Indicates how engaging a specific video is on a 0–100 scale based on viewing duration and viewing patterns; higher values reflect stronger viewer retention. Reported at the video level only and may be unavailable when there isn’t enough viewing data.