0

When fetching a users stats for a game from the steam API using:

url = f"http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/"
params = {
    'appid': self.appid,
    'key': apikey,
    'steamid': steamid
}
response = requests.get(url, params=params)

If the game isn't owned it returns None. However whether or not the game is owned I would like to be able to view the available stat names as I would like to display them. Is there any way to do this? Do I need to find an account with all games on? Thanks.

1 Answer 1

0

Found a simple solution - using the game schema endpoint instead returns stat names as well as their display names which is incredibly helpful, as well as some useful information.

def gameschema(appid):
    url = "http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/"
    params = {
        'appid': appid,
        'key': apikey
    }
    response = requests.get(url, params=params)
    return response.json()

This returns this (snippet):

This shows part of a response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.