Live Stream Analytics - Viewers

Get viewer analytics for an event

Info

Required scopes: stream.read

Warning

This method requires authentication

Retrieve viewer analytics for a specific event, both as a combined total and broken down per channel.

  • total — aggregated viewer metrics across all channels for the event.
  • byChannel — the same metrics keyed by channel id, with one entry per channel the event streamed to.

Each section reports:

  • mean — average concurrent viewers.
  • max — peak concurrent viewers.
  • viewsTotal — total number of views.
  • peakTime — Unix timestamp (seconds) when peak viewers was reached.
  • watchedTime — total watched time in seconds.
  • viewersPerMinute — time series of concurrent viewers, one point per minute (timestamp in seconds).
curl -H "Authorization: Bearer [access token]" \
     https://api.restream.io/v2/user/events/{eventId}/analytics/viewers

Path Parameters:

ParameterTypeDescription
eventIdstring (UUID)The UUID of the event (required)

Response

Success
Error
{
  "total": {
    "mean": 42,
    "max": 87,
    "viewsTotal": 1530,
    "peakTime": 1599983310,
    "watchedTime": 372840,
    "viewersPerMinute": [
      { "timestamp": 1599983310, "viewers": 35 },
      { "timestamp": 1599983370, "viewers": 41 }
    ]
  },
  "byChannel": {
    "123456": {
      "mean": 28,
      "max": 60,
      "viewsTotal": 980,
      "peakTime": 1599983310,
      "watchedTime": 248560,
      "viewersPerMinute": [
        { "timestamp": 1599983310, "viewers": 22 },
        { "timestamp": 1599983370, "viewers": 27 }
      ]
    }
  }
}
Info

Returns 404 when the event has no analytics — for example, an event that never received an incoming stream.