steamapi
steamapi copied to clipboard
Fix achievements API version number.
Calling achievements
on an app object is returning an error. This fixes the problem by updating the version number of the API. Oddly, a direct browser-based call with “v2” in the URL still works, but the python library invocation isn’t happy.
I may come across other examples as I go, I can add to this PR if need be. Nice library BTW, thanks.
Huh, weird. The server originally didn't mind and some examples used the v000x
syntax, while others used vx
. (Any amount of zeroes worked)
Maybe the server-side implementation changed and broke this.
Actually it may not be that simple - I'm now hitting an APIBadCall error with a different game, with no clear reason why - below is the output of my program.
GET 'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v2/' with '{'steamid': 76561197970347865, 'format': 'json', 'key': '1DFEE0F6034695D0833027EAC609F84F', 'appid': 320}'
Traceback (most recent call last):
File "./extract.py", line 18, in <module>
for achievement in game.achievements:
File "/Users/jsiddle/workspaces/my_projects/steam-recs/lib/python2.7/site-packages/steamapi-0.1-py2.7.egg/steamapi/decorators.py", line 71, in __get__
value = self.fget(inst)
File "/Users/jsiddle/workspaces/my_projects/steam-recs/lib/python2.7/site-packages/steamapi-0.1-py2.7.egg/steamapi/app.py", line 66, in achievements
steamid=userid)
File "/Users/jsiddle/workspaces/my_projects/steam-recs/lib/python2.7/site-packages/steamapi-0.1-py2.7.egg/steamapi/core.py", line 440, in call
errors.check(response)
File "/Users/jsiddle/workspaces/my_projects/steam-recs/lib/python2.7/site-packages/steamapi-0.1-py2.7.egg/steamapi/errors.py", line 110, in check
raise APIBadCall()
steamapi.errors.APIBadCall
I've installed the library locally, and I'm debugging in my local version...
I've actually been seeing the opposite. Some of the calls made in user.py
which have multiple 0s seem to error with bad request. When you remove the extra 0s, it works.