Api.twitch.tv/kraken/streams/ endpoint unstable

This is a known issue for me with the /streams?offset=0&limit=100&channel=.. endpoint. Sometimes a stream object for the channels I requested will be missing, even though it’s in the middle of the stream.

I’m using this clientside in a chat client, and it tells the user about the stream being offline, so that is a source of confusion for many people who don’t know that it can sometimes report a wrong status. I added a secondary check after at least 10 seconds to verify that the stream is offline, which probably catches about 50% of these occurences before showing the wrong status to the user.

Since it’s clientside I can only rely on my own personal logs, it seems to be happening occasionally. I don’t request the endpoint that often though, only every few minutes.

Finally i got a screenshot of twitch.tv during an api fail:

The image shows the chat is active, the offline overlay is visible but viewercount (cached?) is displayed. the channel was live during this screenshot and for abount 5minutes refreshing the page and trying to start to play the stream didn’t work, so basically the stream was not watchable for me at this time but the stream was live.

1 Like

Just an update, I’m still looking into this. Sorry for the wait!

1 Like

I’m having problems that the endpoint is not displaying the delay! Is this related?

null values for the delay? I can confirm I’m seeing this too, but I’m not familiar with the delay values, so I’m not sure if this is expected behavior.

Delay = null (or any other field = null) means the field has never been set by the user. The value can be assumed to be the default (for delay, it’s 0 [seconds]). Null allows you to differentiate between ‘never set’ and ‘not enabled’

That makes sense, thanks. I’m not seeing anything out of the ordinary with delay then.

Just to add to this, I noticed a similar hiccup in a Discord bot that I manage this past Sunday ( June 12th)

For now, all it does is a simple @here announcement for when the streamer goes live and then a “Thanks for watching” message when it polls that he’s gone offline, using the usual ~/streams endpoint and parsing out the contents (or lack thereof) of the streams[] id…

I poll at a very generous 1 call/7 minutes, and it pulled a null value for the response at 5:02 PM EST when he had been streaming since 2PM EST and didn’t actually go offline until around 8PM EST

Another quick update here. We’ve added some sampling code to this endpoint and are collecting data now. Once I’m back from E3 and get to delve into the data, I will be having discussions with the team that own this API to see how we can fix the problem. As always, I’ll keep you posted. :slight_smile:


Today we experienced another “downtime”, but it is unrelated to this issues origin.

https://api.twitch.tv/kraken/streams?channel=SirBerlinStyle online
https://api.twitch.tv/kraken/streams?channel=sirberlinstyle online
https://api.twitch.tv/kraken/streams/SirBerlinStyle online
https://api.twitch.tv/kraken/streams/sirberlinstyle offline

I guess we have a case sensitive issue here.

1 Like

Thats interesting because I would assume the endpoint would be looking at the name, not the display_name. You think it could be a coincidence, perhaps their cache keys are case sensitive?

That seems to be the case,

shows a different viewer count than
for me

I am seeing users drop with name or display name. Makes no difference.

I am not sure if this is the right place for this, but i am getting unexpected results from this endpoint since earlier today.

I am querying with a game parameter like https://api.twitch.tv/kraken/streams?game=Quake+World which has worked fine for months but today i’m suddenly getting the top streams on twitch back at seemingly random times instead of something relevant to my game query. I’m still getting the right result most of the time though.

I noticed it happening with Quake World and Quake Champions so might be related with spaces in the game title but i’m url encoding them.

Any ideas?

Edit: This time it happened with “Warsow”, so spaces don’t matter.

Edit2: Some more info: I’m doing multiple queries after another for different games with 100ms sleep inbetween each. I just raise it to 200ms to see it makes a difference.

1 Like

@noctistv Please open a new thread. This is a thread for tracking a bug. This might be a slight behavior change or bug depending on what it is exactly.

@betz0r @tduva: The issue of the missing streamers should be resolved. We deployed a fix a couple of days ago. Please let me know if you see this problem again.

Big shout out to @jwmalara who was kind enough to provide a lot of data and access to his platform.

Thank you all for the patience as we tracked down the issue. :slight_smile:

Quote your game name.

No more errors on my system, thank you for fixing this issue.

Cheers @DallasNChains + Team !

1 Like

Sorry it took so long! I had to fly to San Francisco and stand at people’s desks. :wink: I kid. Kind of.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.