Live streams health status polling in YouTube v3 API

Viewed 88

I have multiple live streams to YouTube being pushed 24/7 from IP cameras. In YouTube studio live stream interface, there is a column per live stream showing health of inbound connection & data. (see snip below).

This shows for each currently 'live' live stream if the inbound data rate is 'excellent', 'good', 'poor', or 'no data'. I have to believe if the YouTube studio live interface is able to poll and display this, it should be available in the YouTube live v3 API.

However, I can't find anything on it. My need is I want to create automation to query status every 15 min or so and alert me if one of my camera sources goes down. Does anyone have insights on where to get this from the YouTube v3 API?

enter image description here

1 Answers

The answer to your question is straightforward:

Use the LiveStreams.list API endpoint, queried with the request parameter mine set to true and look for the following property of the JSON response:

status.healthStatus (string)

The status code of this stream.

Valid values for this property are:

  • good – There are no configuration issues for which the severity is warning or worse.

  • ok – There are no configuration issues for which the severity is error.

  • bad – The stream has some issues for which the severity is error.

  • noData – YouTube's live streaming backend servers do not have any information about the stream's health status.

Also, don't forget to pass status to the request parameter part too.

Related