Get viewer analytics in Wowza Video with the Wowza Video REST API
Viewer analytics provide information regarding viewers, renditions, devices, and countries. This data is crucial for streaming platforms and content providers to enhance user experience, optimize content libraries, and drive engagement.
- Rendition metrics ensure that viewers receive content at the appropriate quality level and viewer count data highlights content popularity.
- Device metrics provide insight into device types which helps with optimizing content delivery and user experience.
- Country metrics enable content and marketing strategies to be tailored to specific regions.
Get viewer analytics for a live stream
See viewer data for a live stream by sending a GET
request to the /analytics/viewers/live_streams/{id}
endpoint.
You can use the following sample request, making sure to:
-
Set
from
andto
query parameters to query historic viewer data. This sets the range of time you want to view. To get data for streams that are currently live, do not sendfrom
andto
values. -
Send the
include
query parameter to specify what data you want to return, includingcountries
,renditions
,devices
, andtrend
data.
Sample Request
curl -H "Authorization: Bearer ${WV_JWT}" \
-H "Content-Type: application/json" \
-X "GET" \
"${WV_HOST}/api/${WV_VERSION}/analytics/viewers/live_streams/[live_stream_id]?from=2024-03-14T10:31:54.486Z&to=2024-04-13T10:31:54.486Z&include=countries,renditions,devices,trend"
Sample Response
The response includes:
Detailed information for an account including viewers
, countries
, renditions
, devices
, and trend
data.
{
"live_stream": {
"id": "tvctq36g",
"viewers": 7,
"countries": [
{
"code": "US",
"viewers": 4
},
{
"code": "DE",
"viewers": 3
}
],
"renditions": [
{
"name": 720,
"viewers": 7
}
],
"devices": [
{
"name": "Desktop",
"viewers": 7
}
],
"trend": [
{
"sampled_at": "2024-03-15T12:59:00.000Z",
"viewers": 7
},
{
"sampled_at": "2024-03-16T13:00:00.000Z",
"viewers": 7
}
]
},
"limits": {
"from": "2024-03-14T10:31:54.000Z",
"to": "2024-04-13T10:31:54.000Z"
}
}
Related API requests
- GET /analytics/viewers/account/{id} — Fetch viewer analytics for all the streams in an account.
- GET /analytics/viewers/vod_streams/{id} – Fetch viewer analytics for a specific VOD stream.
- GET /analytics/viewers/stream_targets/{id} – Fetch viewer analytics for a specific stream target.
- GET /analytics/viewers/live_streams - Fetch viewer data for the top 100 live streams in an account.
- GET /analytics/viewers/vod_streams - Fetch viewer data for the top 100 VOD streams in an account.