Getting stream viewer count webhook notifications

I assumed that the Stream Changed webhook topic would be triggered when stream viewer count changes, but it does not seem to be. Is there any way I subscribe to get this update or will I need to poll?

You’ll need to poll

StreamChange triggers when the title/game/tags change, view count is ignored as it would just be too many webhooks

1 Like

Thanks for your answer. Any suggestions on how often to poll? Could I do it once a minute without being rate limited?

Depends how many channels you are checking. If it’s singular then thats fine. Usually.

Rate limits are covered here:

1 Like

In my experience, you should vary your polling rate depending on the channel you’re analyzing. A channel with <100 concurrent viewers isn’t likely to get a lot of value with per-minute polling. You could get away with five minutes. Channels like shroud, ninja, etc., need higher polling rates.

From an analytics point of view, varying your polling rate can lead to even more inconsistent data.

For example, a channel with ~100 concurrent viewers and polling every 5 minutes could very easily miss a lot of data when that channel gets a raid, which results in a burst of viewers but often a quick drop off, and for channels with a small number of viewers that raid can have a significant impact on viewership which polling every 5 minutes can completely miss.

Ideally you should poll as fast as is required for the application you’re developing (not all apps need per minute viewership accuracy), but not faster than the API cache (so polling faster than once a minute is somewhat of a waste, and polling too fast can actually increase erroneous data by hitting cache servers with older data than the previous request).


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