문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top