Get Streams endpoint 'forgets' stream after a while

I have an application that monitors a varying set of streams using the Twitch API. It’s currently polling Get Stream By User for each stream, but since that results in tons of requests I wanted to change it to the Get Streams endpoint to batch 100 checks at a time.

However, this is working terribly. If I check for a specific stream for testing, the results I get are:

  • for the first 2-3 minutes after starting the stream, the stream randomly either shows up or it doesn’t (I assume this is due to caching differences between servers. I can work around this)
  • after those 2-3 minutes, the stream stops showing up entirely even though it’s still live.

This happens on both v5 (https://api.twitch.tv/kraken/streams/) and helix (https://api.twitch.tv/helix/streams). I don’t understand what could be causing the stream to just stop showing up. There is no indication on the docs about what condition makes streams not present. The Get Stream By User endpoint from v5 works fine.
This also makes it impossible to migrate to Helix, since the only way to get a specific user’s stream, and the replacement endpoint for Get Stream By User from v5 according to the migration guide, is this one that has this issue.

The first issue you mentioned with issues within the stream going up/down at the start is common if you poll the endpoint excessively fast (eg, faster than once per minute) as the faster you poll the more likely you may fliip/flip between the most recent cache and a stale cache server.

The second issue you have is not something I’ve seen occur, which is why it would be helpful if you could show as the request you’re making.

Here are the requests I’m using for testing:
curl -X GET 'https://api.twitch.tv/helix/streams?user_id=26735539' -H 'Authorization: Bearer REDACTED' -H 'Client-Id: REDACTED'
curl -H "Accept: application/vnd.twitchtv.v5+json" https://api.twitch.tv/kraken/streams/?channel=26735539 -H 'Client-Id: REDACTED'

Where the user ID corresponds to my channel that I’m using for testing (http://twitch.tv/abcric).

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