DotaNoobs main site.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
325 B

  1. import requests
  2. from app import app
  3. def get_steam_userinfo(steam_id):
  4. options = {
  5. 'key': app.config['DOTA2_API_KEY'],
  6. 'steamids': steam_id
  7. }
  8. data = requests.get('http://api.steampowered.com/ISteamUser/' \
  9. 'GetPlayerSummaries/v0001/', params=options).json()
  10. return data['response']['players']['player'][0] or {}