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 and to 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 send from and to values.
  • Send the include query parameter to specify what data you want to return, including countries , renditions , devices , and trend data.

Sample Request

Endpoint Reference

Copy
Copied
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.

Copy
Copied
{ 
  "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