If a channel is online it will be under the stream endpoints ex: https://api.twitch.tv/kraken/streams/imaqtpie. That will return something like "created_at": "2016-03-02T12:04:21Z", which is the timestamp for when the stream started
The created_at does not change, the whole stream object does. If a streamer’s connection gets interrupted, it will create a new stream from Twitch’s perspective.
When a stream gets quality options, what actually happens is Twitch creates a new stream with quality options and drops the old one.
Can this still happen even if the stream doesn’t actually go offline?
& yea I was aware about the new stream with the quality options. Just sucks when trying to get the current uptime because it goes to zero when this happens.
I’ve only seen it happen if the streamer’s connection to the ingest server drops or quality options get applied. If VODs are enabled, you can use the recorded_at and length in those to calculate full uptime ignoring small interruptions or stream restarts.
My assumption is that the stream actually went briefly offline (possibly for less than a second), which would regenerate the stream object but not have a noticeable issue to viewers.