Getting top videos for a game

I need to fetch the top videos for a particular game, say hearthstone.
After reading the api I figured that https://github.com/justintv/Twitch-API/blob/master/v3_resources/videos.md#get-videostop is the API I should use.

However, the API does not give correct results.
For example, https://api.twitch.tv/kraken/videos/top/?game=Hearthstone:%20Heroes%20of%20Warcraft returns me 10 games, but all have very few (< 500) views.
Those videos do not match with what I see at https://www.twitch.tv/directory/game/Hearthstone%3A%20Heroes%20of%20Warcraft/videos/week

Please let me know how I can get the top videos for a given game.

Thank you!

Adding @DallasNChains because he mentioned this API endpoint in this post: Retrieve Most Popular Videos On Particular channel via API call

Huh. I’ll have to look into the default behavior. I added &broadcast_type=all and seem to get the same results as the page you referenced. Try this: https://api.twitch.tv/kraken/videos/top?game=Hearthstone:%20Heroes%20of%20Warcraft&broadcast_type=all

Thanks @DallasNChains. That does work.
So, is the documentation a bit out of date? I could not find broadcast_type as a parameter in https://github.com/justintv/Twitch-API/blob/master/v3_resources/videos.md#get-videostop

That’s exactly what I have to figure out. :slight_smile: I found out about broadcast_type by doing a network inspection of the page you linked to. That’s where I spotted the difference!

Interesting. I did see the network calls, but I missed that parameter.
Now, looking at it, I see another parameter “on_site=1”. I tried using 0,1,2,3 etc, but could not find any change. Out of curiosity, what does that do?

That’s probably a true/false flag, which likely relates to vods auto deleting after 60 days

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