twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
73 stars 6 forks source link

Top Games confusion #28

Open BarryCarlyon opened 4 years ago

BarryCarlyon commented 4 years ago

Brief description

Top Games causes confusion as "game ID" 0 or blank is omitted from the response. Resulting in a request for the Top 100 games returning 99.

https://dev.twitch.tv/docs/api/reference#get-top-games

And having to do an extra request(s) to determine where gameID unset is in the rankings.

How to reproduce

Call get top games with first=100 and get 99 results

Expected behavior

Get 100 results including the "blank" game/game_Id = 0

Additional context or questions

https://discuss.dev.twitch.tv/t/top-games-returning-n-1-results/23638

DTX-Elliot commented 3 years ago

Any updates on this? Trying to get a complete list of games on Twitch using this endpoint but every time we loop through we get a different number of total results. It doesn't matter how many results we request on each call, whether it's 10, 20, 50 or 100, at the end of the looping when "cursor" is null, we end up with a different total

BarryCarlyon commented 3 years ago

Trying to get a complete list of games on Twitch using this endpoint

This API is only gonna return a list of games being streamed to. Hence you get differing results espeically when you get down to the weeds of "low viewership".

And whilst running a streamer could go live with a game and instantly appear on page 1 and you wouldn't know until your next run. This endpoint isn't designed to load everything from it really and won't return a valid category that has no on streaming to it.

If you want "all games" on the platform you probably want to be using the IGDB API or the Category Search API.

Twitch doesn't provide a list of all games

If you go the IGDB route then you want to return all games from IGDB that have an external game ID of enum 14.

DTX-Elliot commented 3 years ago

Ahh, that clears up the confusion. Thank you for your help!