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..
< >
Beiträge 113 von 13
not sure what u mean by that but the api is here:
https://developer.valvesoftware.com/wiki/Steam_Web_API
Femins 25. März 2014 um 23:10 
weriweri
clanster 25. März 2014 um 23:27 
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?
Ursprünglich geschrieben von 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.
Zuletzt bearbeitet von MalikQayum; 26. März 2014 um 0:39
clanster 26. März 2014 um 12:06 
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!
Zuletzt bearbeitet von clanster; 26. März 2014 um 12:10
Ursprünglich geschrieben von 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
Ursprünglich geschrieben von twitch.tv/Apryed:
Ursprünglich geschrieben von 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 :(
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 17. Juli 2023 um 3:19 
Ursprünglich geschrieben von 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.
Zuletzt bearbeitet von AyCe; 17. Juli 2023 um 3:25
Ursprünglich geschrieben von 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
Ursprünglich geschrieben von EirikrArcade:
Ursprünglich geschrieben von 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.
< >
Beiträge 113 von 13
Pro Seite: 1530 50

Geschrieben am: 25. März 2014 um 21:31
Beiträge: 13