-
Notifications
You must be signed in to change notification settings - Fork 7
Stats CSGO
The custom stat object structure for this game. Instead of using the original names from the Web API, you have to use these names to access data about the player.
Why? Because the data from the Steam Web API is very shallow, and stupidly returns an array of objects instead of a single object with many properties. All stats are converted to a single object in this library, making it a lot easier to access the data. This improves your experience when working with stats. In the Steam Web API, some names aren't very obvious, some data tracks totally different values than the schema suggests, and some stats are literally never tracked despite being in the schema. To fix that problem, a custom object definition is required.
With a custom object definition, names are more accurate, data is easier to access, and it
offers some extra documentation for the original stat names in the Web API. If you want to create a
custom object definition for your game, go ahead and check out the json
folder in the
repository, and review the stats.json
file and the specs/csgo.js
file to see how it works.
Once you built a similar structure, go ahead and create a pull-request to add it to the project.
Due to the nature of the Web API, and to save space, unset stats are not returned in these objects. It's possible for a stat to be tracked, but not yet set for the player. This is true for achievements; any non-unlocked achievements will simply not be returned by the Web API at all. The same goes for stats. Before attempting to access any values, check that the exact path of objects already exists. Also remember that certain stats can have default values, so if they are unset, you should assume the default value specified in the schema as its true value.
Integer
kills
KillsInteger
deaths
DeathsInteger
time
Time playedObject
bombs
Integer
planted
Bombs plantedInteger
defused
Bombs defusedObject
rounds
Integer
won
Rounds wonInteger
pistol
Pistol rounds wonInteger
played
Rounds playedObject
matches
Integer
won
Matches wonInteger
played
Matches playedObject
demolition
Integer
won
Demolition matches wonObject
bombs
Integer
planted
Bombs planted in DemolitionInteger
defused
Bombs defused in DemolitionObject
gungame
Object
rounds
Integer
won
Arms Race rounds wonInteger
played
Arms Race rounds playedObject
matches
Integer
won
Arms Race matches wonInteger
played
Arms Race matches playedInteger
won
Arms Race matches wonInteger
score
Total score in Arms RaceInteger
lastScore
Score in last Arms Race matchInteger
shots
Total shotsInteger
hits
Total hitsInteger
headshots
Headshot killsInteger
score
Total scoreInteger
damage
Damage dealtInteger
money
Money earnedInteger
mvps
Total MVPsInteger
rescues
Hostages rescuedInteger
sprays
Graffiti sprays (not tracked)Integer
knife
Knife killsInteger
knifeFight
Knife fight killsInteger
grenade
Grenade killsInteger
burns
Incendiary killsInteger
backfire
Kills with enemy's own weaponInteger
flashKill
Kills on blind enemyInteger
snipers
Kills on scoped snipersInteger
dominations
DominationsInteger
brutality
Kills on dominated enemyInteger
revenges
Kills on dominating enemyInteger
donated
Donated weaponsInteger
windows
Windows brokenObject
gun
Object
glock
Integer
shots
Glock-18 shotsInteger
hits
Glock-18 hitsInteger
kills
Glock-18 killsObject
deagle
Integer
shots
Desert Eagle shotsInteger
hits
Desert Eagle hitsInteger
kills
Desert Eagle killsObject
dualies
Integer
shots
Dual Beretta shotsInteger
hits
Dual Beretta hitsInteger
kills
Dual Beretta killsObject
fiveseven
Integer
shots
Five-SeveN shotsInteger
hits
Five-SeveN hitsInteger
kills
Five-SeveN killsObject
xm1014
Integer
shots
XM1014 shotsInteger
hits
XM1014 hitsInteger
kills
XM1014 killsObject
mac10
Integer
shots
MAC-10 shotsInteger
hits
MAC-10 hitsInteger
kills
MAC-10 killsObject
ump45
Integer
shots
UMP-45 shotsInteger
hits
UMP-45 hitsInteger
kills
UMP-45 killsObject
p90
Integer
shots
P90 shotsInteger
hits
P90 hitsInteger
kills
P90 killsObject
awp
Integer
shots
AWP shotsInteger
hits
AWP hitsInteger
kills
AWP killsObject
ak47
Integer
shots
AK-47 shotsInteger
hits
AK-47 hitsInteger
kills
AK-47 killsObject
aug
Integer
shots
AUG shotsInteger
hits
AUG hitsInteger
kills
AUG killsObject
famas
Integer
shots
FAMAS shotsInteger
hits
FAMAS hitsInteger
kills
FAMAS killsObject
g3sg1
Integer
shots
G3SG1 shotsInteger
hits
G3SG1 hitsInteger
kills
G3SG1 killsObject
m249
Integer
shots
M249 shotsInteger
hits
M249 hitsInteger
kills
M249 killsObject
p2000
Integer
shots
P2000 & USP-S shotsInteger
hits
P2000 & USP-S hitsInteger
kills
P2000 & USP-S killsObject
p250
Integer
shots
P250 shotsInteger
hits
P250 hitsInteger
kills
P250 killsObject
sg553
Integer
shots
SG 553 shotsInteger
hits
SG 553 hitsInteger
kills
SG 553 killsObject
scar20
Integer
shots
SCAR-20 shotsInteger
hits
SCAR-20 hitsInteger
kills
SCAR-20 killsObject
ssg08
Integer
shots
SSG 08 shotsInteger
hits
SSG 08 hitsInteger
kills
SSG 08 killsObject
mp7
Integer
shots
MP7 shotsInteger
hits
MP7 hitsInteger
kills
MP7 killsObject
mp9
Integer
shots
MP9 shotsInteger
hits
MP9 hitsInteger
kills
MP9 killsObject
nova
Integer
shots
Nova shotsInteger
hits
Nova hitsInteger
kills
Nova killsObject
negev
Integer
shots
Negev shotsInteger
hits
Negev hitsInteger
kills
Negev killsObject
sawedoff
Integer
shots
Sawed-Off shotsInteger
hits
Sawed-Off hitsInteger
kills
Sawed-Off killsObject
bizon
Integer
shots
PP-Bizon shotsInteger
hits
PP-Bizon hitsInteger
kills
PP-Bizon killsObject
tec9
Integer
shots
Tec-9 shotsInteger
hits
Tec-9 hitsInteger
kills
Tec-9 killsObject
mag7
Integer
shots
MAG-7 shotsInteger
hits
MAG-7 hitsInteger
kills
MAG-7 killsObject
m4a1
Integer
shots
M4A4 & M4A1-S shotsInteger
hits
M4A4 & M4A1-S hitsInteger
kills
M4A4 & M4A1-S killsObject
galil
Integer
shots
Galil AR shotsInteger
hits
Galil AR hitsInteger
kills
Galil AR killsObject
taser
Integer
shots
Zeus x27 shotsInteger
hits
Zeus x27 hits (not tracked)Integer
kills
Zeus x27 killsObject
map
Object
italy
Object
rounds
Integer
won
Rounds won on ItalyInteger
played
Rounds played on ItalyObject
office
Object
rounds
Integer
won
Rounds won on OfficeInteger
played
Rounds played on OfficeObject
aztec
Object
rounds
Integer
won
Rounds won on AztecInteger
played
Rounds played on AztecObject
cobble
Object
rounds
Integer
won
Rounds won on CobblestoneInteger
played
Rounds played on CobblestoneObject
dust2
Object
rounds
Integer
won
Rounds won on Dust 2Integer
played
Rounds played on Dust 2Object
dust
Object
rounds
Integer
won
Rounds won on DustInteger
played
Rounds played on DustObject
inferno
Object
rounds
Integer
won
Rounds won on InfernoInteger
played
Rounds played on InfernoObject
nuke
Object
rounds
Integer
won
Rounds won on NukeInteger
played
Rounds played on NukeObject
piranesi
Object
rounds
Integer
won
Rounds won on PiranesiInteger
played
Rounds played on PiranesiObject
prodigy
Object
rounds
Integer
won
Rounds won on ProdigyInteger
played
Rounds played on ProdigyObject
tides
Object
rounds
Integer
won
Rounds won on TidesObject
train
Object
matches
Integer
won
Matches won on TrainObject
rounds
Integer
won
Rounds won on TrainInteger
played
Rounds played on TrainObject
assault
Object
rounds
Integer
won
Rounds won on AssaultInteger
played
Rounds played on AssaultObject
lake
Object
matches
Integer
won
Matches won on LakeObject
rounds
Integer
won
Rounds won on LakeInteger
played
Rounds played on LakeObject
safehouse
Object
matches
Integer
won
Matches won on SafehouseObject
rounds
Integer
won
Rounds won on SafehouseInteger
played
Rounds played on SafehouseObject
sugarcane
Object
matches
Integer
won
Matches won on SugarcaneObject
rounds
Integer
won
Rounds won on SugarcaneInteger
played
Rounds played on SugarcaneObject
stmarc
Object
matches
Integer
won
Matches won on St. MarcObject
rounds
Integer
won
Rounds won on St. MarcInteger
played
Rounds played on St. MarcObject
mill
Object
rounds
Integer
won
Rounds won on MillObject
shacks
Object
rounds
Integer
won
Rounds won on ShacksObject
bank
Object
matches
Integer
won
Matches won on BankObject
rounds
Integer
won
Rounds won on BankInteger
played
Rounds played on BankObject
alleyway
Object
rounds
Integer
won
Rounds won on AlleywayObject
depot
Object
matches
Integer
won
Matches won on DepotObject
rounds
Integer
won
Rounds won on DepotInteger
played
Rounds played on DepotObject
embassy
Object
matches
Integer
won
Matches won on EmbassyObject
rounds
Integer
won
Rounds won on EmbassyInteger
played
Rounds played on EmbassyObject
shortTrain
Object
matches
Integer
won
Matches won on Short TrainObject
rounds
Integer
won
Rounds won on Short TrainInteger
played
Rounds played on Short TrainObject
house
Object
rounds
Integer
won
Rounds won on HouseObject
vertigo
Object
rounds
Integer
won
Rounds won on VertigoInteger
played
Rounds played on VertigoObject
balkan
Object
rounds
Integer
won
Rounds won on BalkanInteger
played
Rounds played on BalkanObject
monastery
Object
rounds
Integer
won
Rounds won on MonasteryInteger
played
Rounds played on MonasteryObject
shoots
Object
matches
Integer
won
Matches won on ShootsObject
rounds
Integer
won
Rounds won on ShootsInteger
played
Rounds played on ShootsObject
baggage
Object
matches
Integer
won
Rounds won on BaggageObject
rounds
Integer
won
Rounds won on BaggageInteger
played
Rounds played on BaggageObject
militia
Object
rounds
Integer
won
Rounds won on MilitiaInteger
played
Rounds played on MilitiaObject
last
Integer
wins
Last match rounds wonInteger
rounds
Last match rounds playedInteger
winsT
Last match Terrorist winsInteger
winsCT
Last match Counter-Terrorist winsInteger
players
Last match number of unique playersInteger
kills
Last match killsInteger
deaths
Last match deathsInteger
score
Last match scoreInteger
mvps
Last match MVPsObject
weapon
Integer
id
Last match favorite weaponInteger
shots
Last match favorite weapon shotsInteger
hits
Last match favorite weapon hitsInteger
kills
Last match favorite weapon killsInteger
damage
Last match damage dealtInteger
spending
Last match money spentInteger
dominations
Last match dominationsInteger
revenges
Last match revenges
{
"name": "ValveTestApp260",
"count": 214,
"stats": {
"kills": 42959,
"deaths": 33612,
"time": 1780338,
"bombs": {
"planted": 1056,
"defused": 295
},
"rounds": {
"won": 17840,
"pistol": 580,
"played": 28765
},
"damage": 6068789,
"money": 63585608,
"rescues": 502,
"knife": 612,
"grenade": 141,
"gun": {
"glock": {
"kills": 1110,
"shots": 28008,
"hits": 5590
},
"deagle": {
"kills": 2714,
"shots": 21090,
"hits": 5930
},
"dualies": {
"kills": 309,
"shots": 5068,
"hits": 1309
},
"fiveseven": {
"kills": 884,
"shots": 10505,
"hits": 2929
},
"xm1014": {
"kills": 456,
"shots": 16518,
"hits": 3427
},
"mac10": {
"kills": 439,
"shots": 12850,
"hits": 2663
},
"ump45": {
"kills": 1008,
"shots": 20663,
"hits": 4639
},
"p90": {
"kills": 1251,
"shots": 39499,
"hits": 7401
},
"awp": {
"kills": 4651,
"shots": 13214,
"hits": 5119
},
"ak47": {
"kills": 8934,
"shots": 145820,
"hits": 29079
},
"aug": {
"kills": 749,
"shots": 10921,
"hits": 2746
},
"famas": {
"kills": 600,
"shots": 12934,
"hits": 2815
},
"g3sg1": {
"kills": 387,
"shots": 3338,
"hits": 719
},
"m249": {
"kills": 360,
"shots": 10843,
"hits": 1447
},
"p2000": {
"kills": 2170,
"shots": 35007,
"hits": 8679
},
"p250": {
"hits": 4538,
"kills": 1150,
"shots": 17763
},
"sg553": {
"kills": 1585,
"shots": 25719,
"hits": 5248
},
"scar20": {
"hits": 970,
"kills": 539,
"shots": 3626
},
"ssg08": {
"shots": 4444,
"hits": 1535,
"kills": 852
},
"mp7": {
"shots": 15532,
"hits": 3700,
"kills": 642
},
"mp9": {
"kills": 298,
"shots": 8060,
"hits": 1915
},
"nova": {
"hits": 4063,
"kills": 577,
"shots": 20228
},
"negev": {
"hits": 5118,
"kills": 1333,
"shots": 63896
},
"sawedoff": {
"shots": 8072,
"hits": 1571,
"kills": 259
},
"bizon": {
"shots": 13350,
"hits": 3108,
"kills": 467
},
"tec9": {
"kills": 737,
"shots": 12279,
"hits": 2683
},
"mag7": {
"shots": 12682,
"hits": 3013,
"kills": 448
},
"m4a1": {
"kills": 6491,
"shots": 110824,
"hits": 25856
},
"galil": {
"kills": 504,
"shots": 10343,
"hits": 2090
},
"taser": {
"kills": 86,
"shots": 227
}
},
"headshots": 17482,
"backfire": 1662,
"map": {
"italy": {
"rounds": {
"won": 256,
"played": 287
}
},
"office": {
"rounds": {
"won": 216,
"played": 399
}
},
"aztec": {
"rounds": {
"won": 158,
"played": 165
}
},
"cobble": {
"rounds": {
"won": 182,
"played": 355
}
},
"dust2": {
"rounds": {
"won": 3039,
"played": 7291
}
},
"dust": {
"rounds": {
"won": 133,
"played": 151
}
},
"inferno": {
"rounds": {
"won": 482,
"played": 985
}
},
"nuke": {
"rounds": {
"won": 197,
"played": 271
}
},
"train": {
"rounds": {
"won": 191,
"played": 319
},
"matches": {
"won": 7
}
},
"assault": {
"rounds": {
"played": 4
}
},
"lake": {
"rounds": {
"played": 104,
"won": 44
},
"matches": {
"won": 12
}
},
"safehouse": {
"rounds": {
"played": 65,
"won": 37
},
"matches": {
"won": 11
}
},
"sugarcane": {
"rounds": {
"played": 35,
"won": 33
},
"matches": {
"won": 3
}
},
"stmarc": {
"rounds": {
"played": 98,
"won": 44
},
"matches": {
"won": 8
}
},
"bank": {
"rounds": {
"played": 8,
"won": 8
},
"matches": {
"won": 5
}
},
"shortTrain": {
"rounds": {
"played": 293,
"won": 235
},
"matches": {
"won": 89
}
},
"house": {
"rounds": {
"won": 5
}
},
"vertigo": {
"rounds": {
"won": 6,
"played": 9
}
},
"monastery": {
"rounds": {
"won": 2,
"played": 5
}
},
"shoots": {
"rounds": {
"played": 48,
"won": 35
},
"matches": {
"won": 14
}
},
"baggage": {
"rounds": {
"played": 10,
"won": 7
},
"matches": {
"won": 7
}
}
},
"donated": 1370,
"windows": 121,
"flashKill": 524,
"knifeFight": 177,
"snipers": 2953,
"dominations": 1284,
"brutality": 1591,
"revenges": 435,
"hits": 148302,
"shots": 713446,
"last": {
"winsT": 9,
"winsCT": 12,
"wins": 16,
"players": 10,
"kills": 29,
"deaths": 13,
"mvps": 5,
"weapon": {
"id": 7,
"shots": 118,
"hits": 34,
"kills": 12
},
"damage": 3735,
"spending": 43050,
"dominations": 0,
"revenges": 0,
"score": 55,
"rounds": 21
},
"mvps": 4136,
"demolition": {
"bombs": {
"planted": 40,
"defused": 15
},
"won": 4147
},
"gungame": {
"rounds": {
"won": 6058,
"played": 6682
},
"matches": {
"won": 4179,
"played": 5127
},
"won": 42,
"score": 3379,
"lastScore": 0
},
"matches": {
"won": 4715,
"played": 6068
},
"score": 292742,
"burns": 215,
"unknown": {
"GI.lesson.csgo_instr_explain_buymenu": 16,
"GI.lesson.csgo_instr_explain_buyarmor": 0,
"GI.lesson.csgo_instr_explain_plant_bomb": 0,
"GI.lesson.csgo_instr_explain_bomb_carrier": 1,
"GI.lesson.bomb_sites_A": 0,
"GI.lesson.defuse_planted_bomb": 0,
"GI.lesson.csgo_instr_explain_follow_bomber": 0,
"GI.lesson.csgo_instr_explain_pickup_bomb": 0,
"GI.lesson.csgo_instr_explain_prevent_bomb_pickup": 0,
"GI.lesson.Csgo_cycle_weapons_kb": 16,
"GI.lesson.csgo_instr_explain_zoom": 16,
"GI.lesson.csgo_instr_explain_reload": 16,
"GI.lesson.tr_explain_plant_bomb": 0,
"GI.lesson.bomb_sites_B": 0,
"GI.lesson.version_number": 16,
"GI.lesson.find_planted_bomb": 1,
"GI.lesson.csgo_hostage_lead_to_hrz": 0,
"GI.lesson.csgo_instr_rescue_zone": 0,
"GI.lesson.csgo_instr_explain_inspect": 32
}
}
}
> GetTradeHistory
> GetTradeStatus
> GetBadges
> GetCommunityBadgeProgress
> GetOwnedGames
> GetRecentlyPlayedGames
> GetSteamLevel
> GetAssetClassInfo
> GetAssetPrices
> GetFriendList
> GetPlayerBans
> GetPlayerSummaries
> GetUserGroupList
> ResolveVanityURL
> GetGlobalAchievement...
> GetNumberOfCurrentPlayers
> GetPlayerAchievements
> GetSchemaForGame
> GetUserStatsForGame