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

How to get the float value of CS:GO market items?
Using steam web api to access how many times players are reported for hacking
Steam game positive/negative recommendations
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?

Categories

HOME
paypal
cakephp-3.x
plsql
filterrific
scipy
wsdl
wildcard
agile
amazon-product-api
hana
flyway
branch.io
iis-7.5
onenote-api
netflix-feign
aruco
hosts
data-synchronization
cs-cart
pyephem
derived
eclipselink
uiautomator
embedly
epicor
csh
guile
mef2
excel-2013
frp
superagent
blackboard
invoke-command
crt
data-extraction
ocs
mapguide
phpspreadsheet
oscommerce
forecasting
office365connectors
es-shell
sql-like
exiftool
stdclass
nashorn
datalog
crop
upsert
prototypejs
email-parsing
w3-total-cache
broadcast
webdatagrid
spell-checking
rollback
scd
static-code-analysis
unity3d-editor
inject
excon
picking
concur
anti-cheat
file-diffs
futuretask
team-build
xaml-designer
epl
jazz
fragment-tab-host
iostream
facebook-wall
csplit
funkload
lumx
mbox
bsod
visual-studio-addins
installshield-2011
iconv
qtgui
trailing-slash
git-filter-branch
css-tables
pstree
rose-db-object
gjs
applicationcontext
separation-of-concerns
surf
newsstand-kit
nagle
scala-2.8
oggvorbis
usability-testing
msf
associativity

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