Results 1 to 8 of 8

Thread: Unofficial API test

  1. #1
    Basic Member
    Join Date
    Jun 2012
    Posts
    7

    Unofficial API test

    Hi everyone, for the last week or so i've been working on making an unofficial API with the same functionality as Valve's (not currently working) one. I plan to eventually release the source code when I tidy things up a bit but for now i'm just releasing the API so people can play around with the data a little bit. Please be gentle with it and don't try to pull much data or i'll be forced to take it offline. Keep in mind there is a daemon pulling stats from the real server so requests may be fairly slow (up to 10 seconds).

    GetMatchDetail
    URL - http://5.135.192.61/dota/GetMatchDetails
    Parameters -
    key=email aarong11@gmail.com for an API key, or for testing use f8abe25ecf67de4673a0833445d7b95a
    format=xml/json
    debug=false/true
    match_id=101395847
    Example - http://5.135.192.61/dota/GetMatchDet...son&debug=true
    Example output (JSON) -
    {"debug":{"cached":"false","querytime":1},"match": {"new_match":"1","average_skill":"0","dire_team_co mplete":"0","cluster":"111","dire_name":"","radian t_name":"","duration":"642","first_blood_time":"12 6","game_balance":"0","game_mode":"DOTA_GAMEMODE_A P","good_guys_win":"True","human_players":"10","le agueid":"0","lobby_type":"0","match_id":"101395847 ","radiant_team_complete":"0","replay_salt":"29463 3945","startTime":"1358406159","players":{"0":{"ac count_id":"117473411","assists":"0","deaths":"1"," denies":"0","gold":"2","gold_per_min":"195","gold_ spent":"1990","hero_damage":"466","hero_healing":" 0","hero_id":"73","item_0":"11","item_1":"182","it em_2":"56","item_3":"29","item_4":"0","item_5":"0" ,"kills":"0","last_hits":"25","level":"4","misses" :"0","player_name":"DONE FARMING LOL","tower_damage":"0","match_id":"101395847","XP _per_min":"127"},"1":{"account_id":"113301609","as sists":"0","deaths":"2","denies":"2","gold":"389", "gold_per_min":"100","gold_spent":"1110","hero_dam age":"303","hero_healing":"0","hero_id":"30","item _0":"44","item_1":"38","item_2":"13","item_3":"39" ,"item_4":"42","item_5":"0","kills":"0","last_hits ":"3","level":"4","misses":"0","player_name":".Guz zler","tower_damage":"0","match_id":"101395847","X P_per_min":"123"},"2":{"account_id":"115511934","a ssists":"0","deaths":"1","denies":"1","gold":"348" ,"gold_per_min":"225","gold_spent":"2493","hero_da mage":"1939","hero_healing":"0","hero_id":"23","it em_0":"50","item_1":"41","item_2":"16","item_3":"1 3","item_4":"13","item_5":"0","kills":"0","last_hi ts":"33","level":"7","misses":"0","player_name": "R e s p e c t","tower_damage":"0","match_id":"101395847","XP_p er_min":"266"},"3":{"account_id":"102226541","assi sts":"0","deaths":"0","denies":"3","gold":"1051"," gold_per_min":"244","gold_spent":"2196","hero_dama ge":"1813","hero_healing":"0","hero_id":"35","item _0":"0","item_1":"16","item_2":"0","item_3":"0","i tem_4":"71","item_5":"50","kills":"1","last_hits": "32","level":"6","misses":"0","player_name":"TossC uac","tower_damage":"0","match_id":"101395847","XP _per_min":"236"},"4":{"account_id":"113909264","as sists":"1","deaths":"2","denies":"3","gold":"436", "gold_per_min":"164","gold_spent":"1534","hero_dam age":"1165","hero_healing":"0","hero_id":"49","ite m_0":"73","item_1":"36","item_2":"0","item_3":"0", "item_4":"0","item_5":"0","kills":"1","last_hits": "12","level":"7","misses":"0","player_name":"flawl essfortress","tower_damage":"0","match_id":"101395 847","XP_per_min":"275"},"5":{"account_id":"767199 6","assists":"0","deaths":"1","denies":"1","gold": "285","gold_per_min":"181","gold_spent":"2181","he ro_damage":"715","hero_healing":"0","hero_id":"98" ,"item_0":"182","item_1":"38","item_2":"180","item _3":"0","item_4":"16","item_5":"0","kills":"0","la st_hits":"19","level":"6","misses":"0","player_nam e":"PenguicoRn","tower_damage":"0","match_id":"101 395847","XP_per_min":"205"},"6":{"account_id":"115 957470","assists":"0","deaths":"0","denies":"6","g old":"348","gold_per_min":"142","gold_spent":"1775 ","hero_damage":"1989","hero_healing":"0","hero_id ":"26","item_0":"13","item_1":"27","item_2":"44"," item_3":"29","item_4":"0","item_5":"0","kills":"0" ,"last_hits":"10","level":"6","misses":"0","player _name":"cackle_","tower_damage":"0","match_id":"10 1395847","XP_per_min":"219"},"7":{"account_id":"35 301614","assists":"0","deaths":"0","denies":"9","g old":"2147","gold_per_min":"366","gold_spent":"237 4","hero_damage":"2869","hero_healing":"0","hero_i d":"46","item_0":"63","item_1":"0","item_2":"36"," item_3":"0","item_4":"0","item_5":"0","kills":"1", "last_hits":"56","level":"10","misses":"0","player _name":"Sheepdefiler","tower_damage":"612","match_ id":"101395847","XP_per_min":"522"},"8":{"account_ id":"116846993","assists":"5","deaths":"1","denies ":"2","gold":"144","gold_per_min":"185","gold_spen t":"2372","hero_damage":"2038","hero_healing":"0", "hero_id":"16","item_0":"46","item_1":"178","item_ 2":"29","item_3":"16","item_4":"16","item_5":"16", "kills":"0","last_hits":"5","level":"6","misses":" 0","player_name":"clontvvorry","tower_damage":"21" ,"match_id":"101395847","XP_per_min":"241"},"9":{" account_id":"90253558","assists":"0","deaths":"0", "denies":"12","gold":"2481","gold_per_min":"432"," gold_spent":"2749","hero_damage":"4830","hero_heal ing":"0","hero_id":"6","item_0":"0","item_1":"88", "item_2":"16","item_3":"16","item_4":"65","item_5" :"16","kills":"5","last_hits":"41","level":"10","m isses":"0","player_name":"CLS|KEN.Z","tower_damage ":"138","match_id":"101395847","XP_per_min":"549"} }}}

    GetMatchHistory
    URL - http://5.135.192.61/dota/GetMatchHistory
    Parameters -
    key=email aarong11@gmail.com for an API key, or for testing use f8abe25ecf67de4673a0833445d7b95a
    account_id=109096431 (steam community ID)
    start_at_match_id= only matches before this one will be shown
    matches_requested= number of matches to display (1-10)
    recently_played_only=0 or 1 (1 only returns recently played matches)
    format=xml/json
    Example - http://5.135.192.61/dota/GetMatchHis..._played_only=0
    Example output (JSON) -
    {"matches":{"0":{"new_match":"1","average_skill":" 0","dire_team_complete":"0","cluster":"131","dire_ name":"","radiant_name":"","duration":"2089","firs t_blood_time":"138","game_balance":"0","game_mode" :"DOTA_GAMEMODE_RD","good_guys_win":"False","human _players":"10","leagueid":"0","lobby_type":"0","ma tch_id":"99277659","radiant_team_complete":"0","re play_salt":"1229068297","startTime":"1358112474"}, "1":{"new_match":"1","average_skill":"0","dire_tea m_complete":"0","cluster":"122","dire_name":"","ra diant_name":"","duration":"3867","first_blood_time ":"294","game_balance":"0","game_mode":"DOTA_GAMEM ODE_RD","good_guys_win":"False","human_players":"1 0","leagueid":"0","lobby_type":"0","match_id":"992 98084","radiant_team_complete":"0","replay_salt":" 399042932","startTime":"1358115110"},"2":{"new_mat ch":"1","average_skill":"0","dire_team_complete":" 0","cluster":"131","dire_name":"","radiant_name":" ","duration":"2727","first_blood_time":"191","game _balance":"0","game_mode":"DOTA_GAMEMODE_RD","good _guys_win":"True","human_players":"10","leagueid": "0","lobby_type":"0","match_id":"99328319","radian t_team_complete":"0","replay_salt":"1548011601","s tartTime":"1358119811"},"3":{"new_match":"1","aver age_skill":"0","dire_team_complete":"0","cluster": "133","dire_name":"","radiant_name":"","duration": "3368","first_blood_time":"202","game_balance":"0" ,"game_mode":"DOTA_GAMEMODE_AP","good_guys_win":"T rue","human_players":"10","leagueid":"0","lobby_ty pe":"0","match_id":"99778546","radiant_team_comple te":"0","replay_salt":"1964818184","startTime":"13 58183455"},"4":{"new_match":"1","average_skill":"0 ","dire_team_complete":"0","cluster":"133","dire_n ame":"","radiant_name":"","duration":"3100","first _blood_time":"194","game_balance":"0","game_mode": "DOTA_GAMEMODE_AP","good_guys_win":"True","human_p layers":"10","leagueid":"0","lobby_type":"0","matc h_id":"99826838","radiant_team_complete":"0","repl ay_salt":"747208004","startTime":"1358187766"},"5" :{"new_match":"1","average_skill":"0","dire_team_c omplete":"0","cluster":"133","dire_name":"","radia nt_name":"","duration":"2841","first_blood_time":" 161","game_balance":"0","game_mode":"DOTA_GAMEMODE _AP","good_guys_win":"True","human_players":"10"," leagueid":"0","lobby_type":"0","match_id":"1003330 58","radiant_team_complete":"0","replay_salt":"271 277136","startTime":"1358262042"},"6":{"new_match" :"1","average_skill":"0","dire_team_complete":"0", "cluster":"133","dire_name":"","radiant_name":""," duration":"2750","first_blood_time":"227","game_ba lance":"0","game_mode":"DOTA_GAMEMODE_AP","good_gu ys_win":"True","human_players":"10","leagueid":"0" ,"lobby_type":"0","match_id":"100443797","radiant_ team_complete":"0","replay_salt":"1608298497","sta rtTime":"1358271673"},"7":{"new_match":"1","averag e_skill":"0","dire_team_complete":"0","cluster":"1 31","dire_name":"","radiant_name":"","duration":"1 751","first_blood_time":"267","game_balance":"0"," game_mode":"DOTA_GAMEMODE_AP","good_guys_win":"Tru e","human_players":"10","leagueid":"0","lobby_type ":"0","match_id":"100482488","radiant_team_complet e":"0","replay_salt":"681467823","startTime":"1358 275119"},"8":{"new_match":"1","average_skill":"0", "dire_team_complete":"0","cluster":"133","dire_nam e":"","radiant_name":"","duration":"2628","first_b lood_time":"141","game_balance":"0","game_mode":"D OTA_GAMEMODE_AP","good_guys_win":"False","human_pl ayers":"10","leagueid":"0","lobby_type":"0","match _id":"100986373","radiant_team_complete":"0","repl ay_salt":"1432030186","startTime":"1358348732"},"9 ":{"new_match":"1","average_skill":"0","dire_team_ complete":"0","cluster":"133","dire_name":"","radi ant_name":"","duration":"3552","first_blood_time": "240","game_balance":"0","game_mode":"DOTA_GAMEMOD E_AP","good_guys_win":"False","human_players":"10" ,"leagueid":"0","lobby_type":"0","match_id":"10118 7087","radiant_team_complete":"0","replay_salt":"1 86684070","startTime":"1358367649"}}}
    GetReplay

    URL - http://5.135.192.61/dota/GetReplay
    Paramaters -
    match_id=101187087
    Example output -
    {"debug":{"isvalid":1},"replay":{"download_url":"h ttp:\/\/replay133.valve.net\/570\/101187087_186684070.dem.bz2","view_url":"dota2:\/\/matchid=101187087&matchtime=0"}}
    Last edited by aarong11; 01-21-2013 at 10:39 PM.

  2. #2
    Basic Member
    Join Date
    Jan 2013
    Posts
    6
    Awesome job!

    Some calls are quite slow, I don't know if it's because of your server or because of the architecture (or because of Valve), but it's awesome.

    I'm especially interested in the GetMatchHistory API: how do you replicate it? Can you do it WITHOUT any Account ID? e.g. just request the last 10 matches played?

    Keep up the good work!

    PS: seems like you had a hard time on this last match with KotL az50000 I'll add you ^^
    Last edited by Echo; 01-22-2013 at 01:14 PM.

  3. #3
    Basic Member
    Join Date
    Dec 2011
    Posts
    83
    May I ask what languages of coding you use? Is it using the SteamRE/SteamKit2?

  4. #4
    Basic Member
    Join Date
    Jun 2012
    Posts
    7
    Arie - Yes, the daemon is written in C#/Mono using SteamKit2 running on an Ubuntu box. The frontend is done in PHP with the results being saved in a MySQL database.
    Echo - Yeah, unfortunately the GetMatchHistory is currently pretty slow as it isn't caching any of the results and the call itself is quite slow. Reducing the number of requested matches speeds it up significantly. Currently a player id is required to use it but i'm working on making it so providing no player ID will just return the 10 last matches.

  5. #5
    Basic Member
    Join Date
    Dec 2011
    Posts
    83
    Sounds really good. If you are going to publish it all I'd be very happy to play with it.

  6. #6
    Basic Member
    Join Date
    Jan 2013
    Posts
    6
    I've never played with SteamKit2 (not even sure of what it is). Is it pretending to be a game client, like the other project, or is it a regular Valve API?
    If you need help to make it ready for roll out, just tell me

  7. #7
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    Quote Originally Posted by Echo View Post
    I've never played with SteamKit2 (not even sure of what it is). Is it pretending to be a game client, like the other project, or is it a regular Valve API?
    If you need help to make it ready for roll out, just tell me
    I think it's a community project?
    The steam servers use a protobuf-like message interface to send and recieve all data. SteamKit2 just has a bunch of methods/includes a large number of protobuf classes that let you spoof a steam client.
    For example I have used the visual C steamkit2 to make a fetcher and the console output looks like this:
    28016_10151283749453770_1244840608_n.jpg

    you can log an account in, tell the server's "game coordinator" that you are launching a certain game (in this case, dota), and then talk to the server as if you are the game requesting data.

    the basic source code and an example is all in here (not my code btw..) https://bitbucket.org/VoiDeD/ so download it, get a copy of visual studio 2012 and import the project. then have a play to learn how it works. doesn't take long to get it working really.
    I just fetch all of the data then convert it to json (like OP) however I haven't released the code because I don't think valve wants everyone to have api-less access to the data unless they put in the hard yards and build a solution themselves.....

  8. #8
    Basic Member
    Join Date
    Jul 2012
    Posts
    194
    Is this broken?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •