Hello all,
I've put together an early beta version for an API to access players statistics programatically. You can access it with HTTP and it returns simple xml blobs that contain the data. Currently it supports 3 functions but I'll hopefully be adding more in the future.
NOTE: Please be reasonable when sending requests to the API. The API is running on the same machine as the stats website so excessive traffic to the API will hinder the user experience of everybody playing the game. We don't want to throttle traffic to the API but if we must we will.
Right now you can view the general network statistics:
which return this:Code:http://stats.shatteredhorizon.com/stats/api/networkStatistics.action
Search for players by name:Code:<response status="ok"> <networkstatistics> <players>34</players> <servers>2</servers> <matches>16464</matches> </networkstatistics> </response>
And get something like this:Code:http://stats.shatteredhorizon.com/stats/api/searchPlayers.action?name=jarnis
And you can get a summary of a players statistics using their player or steam id:Code:<response status="ok"> <players> <player> <id>14784</id> <name>FM_Jarnis</name> </player> </players> </response>
orCode:http://stats.shatteredhorizon.com/stats/api/playerStatistics.action?playerId=14784
Which in turn returns something like this:Code:http://stats.shatteredhorizon.com/stats/api/playerStatistics.action?steamId=76561197968173935
If you are interested in building a forum sig generator or a fansite please give it a try and let me know in this thread if you have any comments or questions.Code:<response status="ok"> <player> <id>14784</id> <name>FM_Jarnis</name> <points>1888</points> <rank>EVA Specialist</rank> <kdratio>0.54</kdratio> <matches>53</matches> <killspermatch>6.4</killspermatch> <totalplaytime>40735</totalplaytime> <deaths>630</deaths> <suicides>2</suicides> <kills> <total>36547</total> <assist>5964</assist> <team>171</team> <headshots>5462</headshots> <tankshots>2481</tankshots> <assaultmode>0</assaultmode> <snipermode>0</snipermode> <melee>5877</melee> <defence>6678</defence> <yinyang>2859</yinyang> <whileemped>1460</whileemped> <ghost>2093</ghost> <ghostbuster>1292</ghostbuster> <deathfromabove>5826</deathfromabove> <pistol>10</pistol> <shotgun>13</shotgun> <smg>675</smg> <assault-rifle>28011</assault-rifle> <machinegun>39</machinegun> <railgun>1803</railgun> </kills> <time> <boostmode>2166</boostmode> <airmode>29136</airmode> <groundmode>9174</groundmode> </time> <game> <flagcaptures>42</flagcaptures> <wins>18</wins> <losses>34</losses> <draws>0</draws> <skirmishwins>8</skirmishwins> <assaultwins>3</assaultwins> <battlewins>7</battlewins> <isarounds>20</isarounds> <mmcrounds>38</mmcrounds> </game> <achievements> <achievement> <name>the_cleaner</name> <time>2009-11-04 20:25:46.0</time> </achievement> <achievement> <name>the_assistant</name> <time>2009-11-04 20:25:46.0</time> </achievement> <achievement> <name>gung_ho</name> <time>2009-11-04 21:28:15.0</time> </achievement> <achievement> <name>rifleman</name> <time>2009-11-04 21:28:15.0</time> </achievement> <achievement> <name>sniper</name> <time>2009-11-04 21:28:15.0</time> </achievement> <achievement> <name>ventilate</name> <time>2009-11-04 23:09:52.0</time> </achievement> <achievement> <name>ten_in_the_tank</name> <time>2009-11-04 23:29:34.0</time> </achievement> <achievement> <name>up_close_and_personal</name> <time>2009-11-05 14:49:24.0</time> </achievement> <achievement> <name>snipe_this</name> <time>2009-11-06 18:28:48.0</time> </achievement> </achievements> </player> </response>
HeikkiV
UPDATE 1: Added instructions to use steam id instead of your id
UPDATE 2: New elements in player xml
UPDATE 3: Added network statistics and fixed achievement typo
UPDATE 4: Added note about excessive requests
UPDATE 5: Added new weapons

Reply With Quote



