Best way to calculate stream viewers average

Hi everyone.

I have an app that fetches data, minute to minute, from Twitch, YouTube and Facebook streams and it calculates stream viewers average of each stream and draws minute a minute graphics.

Many times, in Twitch, when you use “Get Streams” endpoint, “viewer_count” response field doesn’t change during several minutes (due to caching?). However, when you’re watching a stream you can see how this data is refreshed each 20-25 seconds (so it doesn’t seem caching works in the same way here ).

To improve accuracy, does it exist alternative methods?. Does PubSub have any topic to fetch real time “viewer_count”?

In the image below, it can see an example of how Twitch graphics contains more straight lines due to data takes more time in changing:

Sorry for my english, it’s difficult for me :slight_smile:

Thank you.

Best regards.

Nope the only documented method involves doing what you are already doing.

Polling the Streams API every minute.

I do it but caching is present too and graphics have many straight lines … :disappointed_relieved:

That the best you can do with the current API offerings that Twitch provides.

1 Like

Thank you so much

that said might be worth opening a uservoice to see if Twitch wants/can look into providing something “more accurate”

1 Like

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