Search code examples
pythonpython-requestssteam-web-api

How to get steamwebapi to return data


I'm trying to pull player stats for specific games. When I try to request data from the steam API, it throws an error. From what I have seen this URL format has worked for many others, I'm not sure why it throws errors.

import requests
key = ''
steamid = ''
r = requests.get(f'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v2/?appid=252490&key={key}&steamid={(steamid)}')
data = r.json()
print(data)
Returns: <Response [500]>

Solution

  • I noticed that you are using http.

    Have you tried https?

    You may need to pass the verify=False parameter in the request.get call.