• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

Steam Steam Web API - Issues grabbing achievements for current user?

Japster

Member
Hi guys - I've just put in-game achievements summaries into TetraLogical, and I'm getting quite frustrated, as there MUST be a way to do what I'm trying to do, WITHOUT users having to faff about setting their STEAM 'Game details' profile setting to PUBLIC?

I've been challenged by users who rightly say that their other games show in-game achievements without them needing to set this, and unless the other games are using Cloud saves to record this (which I can't retrospectively *easily* do, although it's of course possible, to again 'walk' the user's achievements by making individual steam API GET calls, saving to a file, etc), I'm wondering if I'm being daft, and missing something like a simply call that CAN do this without needing a PUBLIC status for retrieving Achievements info?

I've got my API key, all of the normal functionality is working, and if I change the value, I get different JSON info back, but I've tried both of the following commands:-

Code:
http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=<TETRALOGICAL_APPID>&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&steamid=<USER'S_ID>
(Which ONLY works if I set my setting above to PUBLIC, otherwise I get an internal 500 server error)...

and the other available method:-

Code:
http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?appid=<TETRALOGICAL_APPID>&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&steamid=<USER'S_ID>"
Gives the same kind of result, albeit with a more usable JSON message, but still a failure unless I set that setting to PUBLIC:-

{"playerstats":{"error":"Profile is not public","success":false}}


SO frustrating.... ...any help would be greatly appreciated, cheers guys!
 
Last edited:

Japster

Member
Hmm.... Seems there are 2 types of keys - the standard one you can request with no need to jump through hoops, and THIS:-

Creating a Publisher Web API Key
To create a publisher Web API key, you will need to have administrator permissions within an existing Steamworks account. If you are not an administrator yourself, you can see a list of administrators for your partner account by visiting your Steamworks Home Page and viewing the list on the right-hand side. Any one of them can create your Publisher Web API Key or can promote you to admin if appropriate.

To create a Publisher Web API key:
  1. As a user with administrative rights in your Steamworks account, first visit your groups list.
  2. From the list of groups, select or create a group that contains the App IDs for which you wish to have access with the WebAPI key.
  3. Then click into that group to view the users and applications in that group.
  4. If you have administrative permissions, you should then see the option to "Create WebAPI Key" on the right-hand side. Or you should see the key listed if it has already been created.

I think I'll check into this, in case it's the solution, but I have to stop right here, as the server room is down in my day job... darn it!
 

Japster

Member
Okay, after setting a PUBLISHER Web API Key, I've now found that THIS method:-

Code:
http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/........
Seems to work for the specified app ID set up with that particular key, regardless of the target user ID queried being public or private... - Need to do more testing....


However, even with that key, the method below STILL does not work for me, so may be worth noting, to avoid the same frustration:-
Code:
http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/.....

Not sure why it was such a struggle to find good info on this, or if I'm just not looking properly!

Ah well, looks like I'm maybe sorted now!...


EDIT:- YEP, that Publisher Key works a treat - my users can now see their own achievements in my game, WITHOUT having to set privacy settings.... more unclear internet info.... sigh... All I needed to see was "PUBLISHER Web API key", and so hoping that this helps others with this type of query... :)
 
Last edited:
Top