steam


Getting CS:GO player stats


How could I use the Steam Web API to get a player's stats, such as "Total Kills" or "Total Wins". Some sites that use these features include http://csgo-stats.com and http://csgo-stats.net. I have tried using http://api.steampowered.com/ISteamUserStats/GetGlobalStatsForGame/v0001/?format=xml&appid=730&count=1&name[0]=total_wins with no success. Where is the documentation for such statistics?
I believe you are using the wrong API end point for this. Utilize the GetUserStatsForGame end point instead.
Your call will look like this:
http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=<<KEY>>&steamid=<<PROFILEID>>
You'll replace <<KEY>> with your API key and <<PROFILEID>> with the profile ID (not SteamID) of the user you are interested in. This value is the same one passed to you when you sign in via Valve's OpenID.
This will return a result similar to this:
{
"playerstats": {
"steamID": "7656-EDITED-OUT",
"gameName": "ValveTestApp260",
"stats": [
{
"name": "total_kills",
"value": 110527
},
{
"name": "total_deaths",
"value": 95930
},
{
"name": "total_time_played",
"value": 5784386
},
{
"name": "total_planted_bombs",
"value": 2726
},
{
"name": "total_defused_bombs",
"value": 594
},
{
"name": "total_wins",
"value": 26937
},
...
]
}
}
You can see that you need to iterate through the ['playerstats']['stats'] element and look at the name attribute of each to find the stats you are looking for.

Related Links

Javascript command for clicking a button on Steam
Steam API, All the comments and commented date for a game
Steam : I need to add other option in game menu for resolution
Certain steam games keep crashing my computer
How to get a list of active buy orders for the steam market?
Steam API endpoint to leave groups?
Steam set user status
Steam API: How to get players in current game?
Windows script that pushes button? info? anything?
json API data with all of its content
Verify Game Integrity through Steam API?
API Steam - Account not found
How to get the steam IDs of users on a Source server
Get Strange kills (TF2 + steam API
Get link from “Join Game” in Steam
Steam API Get steam level of user?

Categories

HOME
converter
dotnetrdf
batch-processing
redis
websphere
drupal-7
google-tag-manager
ubuntu-12.04
survival-analysis
phpstorm
azureservicebus
tizen-wearable-sdk
contact-form-7
unity2d
camera-calibration
uiscrollview
gwtp
phoenix
squarespace
typeahead
arm-template
saiku
movies
ejbca
plupload
google-ima
kitematic
philips-hue
owl-api
vcard
ggmap
partial-application
red-black-tree
hibernate-cache
rhomobile
qtablewidget
office365connectors
issue-tracking
jrules
datalog
taglib
gd
amazon-machine-learning
jgraph
text-classification
etherpad
scd
qos
createobject
packagemaker
firepath
dts
listadapter
fps
gmsmapview
gemini
console-redirect
amazon-kcl
git-rebase
except
asymptote
lemoon
datainputstream
geodjango
eyeql
selendroid
python-winshell
coypu
alphablending
x-ua-compatible
iostream
dalekjs
cling
bignum
vmware-server
cgimageref
fieldset
domain-calculus
transitive-closure-table
returnurl
autostart
blockingqueue
static-variables
getusermedia
subtract
supersized
hashalgorithm
qtembedded
search-path
hibernate3-maven-plugin
lazy-c++
dirty-data

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App