The /streams endpoint is periodically sending a bad next cursor for the /streams endpoint. No direct repro available as it happens when iterating over the next cursor for the following request. One occurrence happened at offset 2400, another occurrence happened at offset 500
https://api.twitch.tv/kraken/streams?game=&limit=100&offset=0
The logic I’m using iterates over each offset in incrementing batches (0, 100, 200, 300, etc) until no additional streams are found (the streams array is empty). It then goes into a forced sleep until a period of time has elapsed.
Instead of getting the expected return results, I received the following:
https://api.twitch.tv/kraken/streams?game=&max_height=-1&limit=100&offset=600&stream_type=live
which returned no results and broke the scan iterating over the next cursor.
Any ideas what happened, and how we can fix it to never happen again?