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

Alternatives to the CS:GO API?
Get list of players from server
Node-steam-trade, how to get items names?
Is it possible to create/join a lobby with 4 people, not on friends list, programmatically? [Steam + CSGO]
Steam Web API GetPlayerItems
How to find the path to Steam's sourcemods folder?
Using the SteamWebAPI to send a tradeoffer?
Getting CS:GO player stats
Steam User data
Steam API - Game Controller Support
Steam Web Api: CS:GO Getting Skin name of items
SteamWebAPI IDOTA2Match_570 getScheduledLeagueGames
What identifies a “Dota2” item in Steam?
Steam api get multiplie game achievments&Schema list with 1 call
Steam Achievements API - How to get achievement unlocking date?
Retrieve DotA 2 inventory with ingame order

Categories

HOME
payment-gateway
elixir
shopify
openssl
vhdl
nlp
wsdl
ncurses
google-sheets-api
jscript
specflow
webdav
internet-explorer-11
lotus-notes
android-source
google-shopping
tee
styles
mousewheel
non-deterministic
rhmap
vcard
positioning
vegan
piecewise
web-audio-api
openpgp
bigcartel
es-shell
xamarin.uitest
elfinder
dql
code-behind
android-maps-v2
cppunit
ajp
double-buffering
windows-95
openh264
modelattribute
execl
laravel-query-builder
libtiff.net
nsfetchedresultscontrolle
gameanalytics
linkageerror
multifile-uploader
freefem++
android-recyclerview
drf-nested-routers
application-loader
zuora
sevenzipsharp
ipojo
base32
integral
graphical-logo
digits
ubercart
sparse-file
pylearn
xaml-designer
mdm-zinc
hiera
low-level
pisa
ibmsbt
bignum
layered
vertical-rhythm
astyanax
pascals-triangle
fluidsynth
pitch
redirectstandardoutput
flexicious
galaxy-tab
phpcrawl
nvelocity
hardware-acceleration
graniteds
kpi
weborb

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