Question

I'm trying to use the Steam API to fetch some information about the games users have in their library.

When I get the games with my SteamID I see stuff like Source SDK and a lot of demos and other stuff that technically aren't games I bought.

Is there any sort of filter know to hide these things?

This is the API information about the GetOwnedGames call

Was it helpful?

Solution

One possibility is to filter 'games' that have "playtime_forever": 0.

As an example, this would filter appids 9, 92, 211 from the below snippet.

        {
            "appid": 9,
            "playtime_forever": 0
        },
        {
            "appid": 92,
            "playtime_forever": 0
        },
        {
            "appid": 211,
            "playtime_forever": 0
        },
        {
            "appid": 440,
            "playtime_2weeks": 188,
            "playtime_forever": 107307
        },

This is going to catch everything for you though, because people that have 'played' these games will have play time. So, for the above you would have filtered out the Source SDK, but for another user that has used it the SDK would appear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top