I’m currently trying to migrate my half-built application from kraken to helix and I’m running into some issues with the new pagination/cursor system for /streams. My goal is to find a stream a certain amount of viewers (10 or so)
Previously my application did the following :
- Start at a given offset to skip all the popular streams (about 3000)
- Check a stream at this offset and alter the offset by 100 up or down to depending on how many viewers it has
- Repeat this till a stream with roughly the right amount of viewers was found.
- Save this offset for later (minutes, hours) so that we can get more streams with the same viewership
With the new pagination system I now have to make about 30 calls to get through to the streams that I’m looking for each time I want to check.
Here are some questions:
- Is it possible to filter/order streams by viewers on the API call?
- How long do are the pagination cursors valid? Can I save one and use it an hour later?
- If I reuse a pagination cursor later, will the results update to reflect new viewer numbers?
If anyone has any other suggestions on how I’d be able to achieve this without hammering the API I’d really appreciate it.