clanster Mar 25, 2014 @ 9:31pm
Steam API Achievement Progress
Is anyone aware of how to use the API to obtain Achievement Progress? I see it shows on the user page, but no obvious way to link Achievement to Stat(s) or what the total Stat amount required for each achievement is..
< >
Showing 1-13 of 13 comments
MalikQayum Mar 25, 2014 @ 11:05pm 
not sure what u mean by that but the api is here:
https://developer.valvesoftware.com/wiki/Steam_Web_API
Femins Mar 25, 2014 @ 11:10pm 
weriweri
clanster Mar 25, 2014 @ 11:27pm 
Sorry, let me explain myself a little bit better.

See this page:
http://steamcommunity.com/id/ChetFaliszek/stats/224260/?tab=achievements

Notice how the achievements have: 0/500

But working through the API I don't see how to get the "0/500" data for the users. I also don't see any way of associating the achievement to the total "500" it needs - Is it possible to get this data? If so, how?
MalikQayum Mar 26, 2014 @ 12:37am 
Originally posted by clanster:
Sorry, let me explain myself a little bit better.

See this page:
http://steamcommunity.com/id/ChetFaliszek/stats/224260/?tab=achievements

Notice how the achievements have: 0/500

But working through the API I don't see how to get the "0/500" data for the users. I also don't see any way of associating the achievement to the total "500" it needs - Is it possible to get this data? If so, how?
{ "playerstats": { "steamID": "76561197968575517", "gameName": "No More Room in Hell", "achievements": [ { "apiname": "KILLS_DEER_HUNTER_500", "achieved": 0 }, { "apiname": "KILLS_500A_500", "achieved": 0 }, doesnt this "achieved": 0 show what u need? excuse me if it is me not getting the question and feel free to ignore me if so, just trying to help.
Last edited by MalikQayum; Mar 26, 2014 @ 12:39am
clanster Mar 26, 2014 @ 12:06pm 
The "achieved" can only be "1" or "0" as completed or not completed.

For example with Team Fortress 2 you will see a bunch of achievements & stats, some of the STATS are the achievement name followed by _STATS, so you can see the total # of stats needed to complete the achievement (if the achievement has been completed).

I don't see anything that links STAT to Achievement - but obviously somewhere there is since Steam can do it. Maybe Steam just doesn't want anyone else to have this information?

the _STAT appears only on two games from what I found - otherwise I would just look for that field to track it.

Thank you for trying to help either way!
Last edited by clanster; Mar 26, 2014 @ 12:10pm
twitch.tv/Apryed Jan 2, 2023 @ 3:57am 
Originally posted by clanster:
The "achieved" can only be "1" or "0" as completed or not completed.

For example with Team Fortress 2 you will see a bunch of achievements & stats, some of the STATS are the achievement name followed by _STATS, so you can see the total # of stats needed to complete the achievement (if the achievement has been completed).

I don't see anything that links STAT to Achievement - but obviously somewhere there is since Steam can do it. Maybe Steam just doesn't want anyone else to have this information?

the _STAT appears only on two games from what I found - otherwise I would just look for that field to track it.

Thank you for trying to help either way!
Did you find it? Looking for the same a few years later xDD jajaja
Originally posted by twitch.tv/Apryed:
Originally posted by clanster:
The "achieved" can only be "1" or "0" as completed or not completed.

For example with Team Fortress 2 you will see a bunch of achievements & stats, some of the STATS are the achievement name followed by _STATS, so you can see the total # of stats needed to complete the achievement (if the achievement has been completed).

I don't see anything that links STAT to Achievement - but obviously somewhere there is since Steam can do it. Maybe Steam just doesn't want anyone else to have this information?

the _STAT appears only on two games from what I found - otherwise I would just look for that field to track it.

Thank you for trying to help either way!
Did you find it? Looking for the same a few years later xDD jajaja

Still no one :(
AyCe Jun 6, 2023 @ 11:19am 
Scharesoft Jul 16, 2023 @ 8:38am 
This value is still missing in the REST API as far as I see. Or there a possibility to get the possible max value?
AyCe Jul 17, 2023 @ 3:19am 
Originally posted by Scharesoft:
This value is still missing in the REST API as far as I see. Or there a possibility to get the possible max value?
The documentation is unclear, it mentions
"The achievement will also automatically unlock when the stat reaches the unlock value."
but never explains what "Unlock value" means.
It might be the Maximum Value of the Stat that it is tracking. Or can you specify a value directly in the achievement definition when you use Progress Stat?

As for getting the value and progress, this is done by querying the stat, not the achievement. And then it seems you have to just know what your maximum is.

But you can also use
https://partner.steamgames.com/doc/api/ISteamUserStats#IndicateAchievementProgress
but I don't understand how it interfaces with the stats.

It triggers a UserAchievementStored_t callback, which seems to contain some info about the progress, but only AFTER you stored it, so I'm not sure what the use case for that is.
Last edited by AyCe; Jul 17, 2023 @ 3:25am
EirikrArcade Jul 9, 2024 @ 10:43am 
Originally posted by Scharesoft:
This value is still missing in the REST API as far as I see. Or there a possibility to get the possible max value?

With the GetUserStatsForGame API endpoint

The value is implied by the number of items in the achievements array. If you take the length of that array, that's the total number of achievements, lets say 500.

Then you filter through the array of objects for objects that have the key achieved === 1

The length of the filtered array is the number of achievements you've unlocked. Example ES6 Javascript code:

const maxAchievements = data.playerstats.achievements.length

const unlockedAchievements =
data.playerstats.achievements.filter((achievement) => {
return achievement.achieved === 1}
)

// lets say this is 100

const achievementString =
`${unlockedAchievements } / ${maxAchievements} achievements unlocked`

console.log(achievementString)
// this prints in the console:
// 100 / 500 achievements unlocked
thanks guys
Scharesoft Jul 13, 2024 @ 3:04am 
Originally posted by EirikrArcade:
Originally posted by Scharesoft:
This value is still missing in the REST API as far as I see. Or there a possibility to get the possible max value?

With the GetUserStatsForGame API endpoint

The value is implied by the number of items in the achievements array. If you take the length of that array, that's the total number of achievements, lets say 500.

Then you filter through the array of objects for objects that have the key achieved === 1

The length of the filtered array is the number of achievements you've unlocked. Example ES6 Javascript code:

Thanks, but this only gives me the maximum number of achievements. But not the progress of a single Achievement.

GetUserStatsForGame sends a list of achievements, yes. And a list of achievement stats. But each stat has only a value with the current progress of the corresponding achievement.

For example there is a achievement where I have to kill 100 monsters. The value there is 20. That means I killed 20 monsters. However, it is not clear anywhere that the target value is 100. The value is not displayed anywhere as far as I know.
< >
Showing 1-13 of 13 comments
Per page: 1530 50

Date Posted: Mar 25, 2014 @ 9:31pm
Posts: 13