Live Stream Analytics API Endpoint

Hi,

I cannot find API end point for live stream analytics. We could check viewer count, but there is no information about how many minutes viewers consume.

It seems “/client/v4/accounts/$ACCOUNT/stream/analytics/views” end point doesn’t have dimension option other than videoID.

Do I miss something?

Hi,

This documentation page provides examples that include the metrics totalImpressions and totalTimeViewedMs, which would return the total time in milliseconds.

https://developers.cloudflare.com/stream/getting-analytics/fetching-per-video-analytics/

Thanks for the answer. I’ve expect live streams have different behavior, but they linked to videoid(s).

For future viewers;

First you need to get videoId(s) of the live stream. It could be more than 1, if input stops then starts the broadcast again or disconnects and connects again.

https://api.cloudflare.com/client/v4/accounts/$ACCOUNT/stream/live_inputs/$LIVE_INPUT_ID/videos

After that you can get per-video analytics or bulk analytics.

1 Like