There is a possibility to check how long single streamers was online?
I see in the /streams API something like created_at (time when went live), but it’s any way to check when its not live?
Im thinking in programming way, i’ve to write function which daily (23:59 time) check created_at, but how to check end time?
i.e each 5 minutes checking created_at and comapring it to stream live?
If the channel is not live the only way to check would be to query the VODs if they are enabled and use the recorded_at and length fields.
if they enabled…
but what if no. I’m thinking and thinking about good solution for that.
Only way I think its checking each 5 minutes, and if stream is null then count difference from that time and created_at.
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
I’ve encountered “created_at” changing without reason. Or it changes if a user gets quality options…
currently the “created_at” isn’t very useful until they fix some issues.
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.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.