Viewcount for Games/Categories

Regarding AND

Is there ANY way to get a viewcount for a category in the current api?
I know you can just use the Legacy Twitch API v5, but I want to be future proof.

You would need to use the Get Streams endpoint with the game_id param for the game you wish to know the viewer count of, and page through the streams and sum the results yourself.

Game developers can access the Get Game Analytics endpoint which will give accurate data, but for 3rd party developers the only option is to page through the Get Streams endpoint which is inherently inaccurate so you will always have some degree of error.

Here is an example to demonstrate the logic

Uses implict auth for demo purposes

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