How to just check if a channel is live?

It’s probably not best to to determine the online/offline status of a stream based on the value of the viewers field, because that field, along with the whole stream object itself, wont exist if the stream is offline.

A better way would be to see if a stream object exists for the channel you’re looking up. If it exists the stream is online, else it’s offline.