Getting Current Streamer and Viewer Count Per Game

Hello

TLDR
Is there similar functionality in helix to the endpoint in version 5 to https://dev.twitch.tv/docs/v5/reference/games. Would love to save API requests to get the total number of channels and viewers.

I am working on a little side project and I was looking to see how I could get the current number of channels streaming a game and the total count of viewers across all channels.

I see in version 5 of the API if I called the games reference endpoint https://dev.twitch.tv/docs/v5/reference/games it would return the top games and keys for the number of channels and the number of viewers.

Looking at the new version/helix I do not see the same functionality. I have implemented the same functionality calling the Get top games endpoint, using the cursor to make recursive calls to get a list of all the games being played. I store those in a database.

I then call the get streamers endpointfor each game id and resursivley call that endpoint for each cursor but as you can imagine this is a lot of HTTP calls. Doing it synchronously takes a long time, async I run into rate limit issues.

Long way to ask is there an endpoint in helix I am missing that returns the total streamers and viewers for each game without having to make so many requests?

Thanks

Here is my solution

https://barrycarlyon.github.io/twitch_misc/examples/browse_categories/

Code: https://github.com/BarryCarlyon/twitch_misc/tree/master/examples/browse_categories

Get Top Games, then load a chunk of pages from Get Streams and math up the viewers and stop after 10/20 pages or so.

No.

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