How to filter/search by game in helix

Hi, I’m new to the twitch api but have been reading through the docs for some time now. Apologies for such a basic question, one thing I’m struggling to find any information in the docs/forum about is an up-to-date explanation on how to search or filter a query by game.

I found this post for the kraken version but I’m unable to do the same in the helix version, i.e.,

https://api.twitch.tv/helix/streams?game=Art (this one will return results, but it appears to be all streams, not filtered by Art)

https://api.twitch.tv/helix/videos/top?game=Art

I’ve also noticed that there’s a parameter game_id but I’m not finding a list anywhere explaining what id belongs to what game. Does such a list exist? Is it possible to search by game_id instead?

Can someone point me to where in the docs it explains how to search by game for the “helix” version of the API please?

Thanks!

If you look at the docs: https://dev.twitch.tv/docs/api/reference#get-games you’ll see that there is no querystring param called game. That endpoint has 2 params, id, and name and at least one is required.

That isn’t even an endpoint, there is no Top Videos in Helix.

That’s what the Helix Get Games endpoint is for, if you provide it with an id you get given the game which that ID is for. Alternatively you can give it a name. This is a 1 to 1 lookup though, it requires an exact match, there is no ‘search’ in Helix at this time.

1 Like

Thanks so much for your reply @Dist. I used this query to find the game id:

https://api.twitch.tv/helix/games?name=Art

which returned

{
"data": [
    {
        "id": "509660",
        "name": "Art",
        "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/Art-{width}x{height}.jpg"
    }
]

}

Then used the id in the original query for streams of that game:

https://api.twitch.tv/helix/streams?game_id=509660

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