Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

Dota 2 Match History WebAPI

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Originally posted by Alesix View Post
    Just a quick tip for everyone: The difference in value between account_id and SteamID is 76561197960265728 (which is 2^56 + 2^52 + 2^32). For example, my SteamID is 76561198055198692, and my account_id would be 76561198055198692 - 76561197960265728 = 94932964. This only works for normal user accounts though (as opposed to, say, dev accounts), but I haven't encountered any exceptions so far. And of course, if the language you're using supports 64-bit integers, you can simply perform a modulo 2^32 to extract the account_id.

    If you're using PHP, take note that unless you're running on 64-bit (both hardware and interpreter), you would need a library which supports arbitary precision (e.g. BC Math) to perform mathematical calculations on 64-bit integers (which SteamIDs are).
    I made the following function to get the Account ID from the SteamID. It should work with every SteamID you throw at it:

    PHP Code:
    function getAccountID($steam_id){
        
    $account_id substr(decbin($steam_id), 32);
        
    $account_id bindec($account_id);
        
        return 
    $account_id;

    That should make things easier. To answer your previous question: As far as I know, if someone leaves before the 15 minute mark, the match does not count. Otherwise, it does. Don't quote me on it though.

    Comment


    • Originally posted by Lazze View Post
      I made the following function to get the Account ID from the SteamID. It should work with every SteamID you throw at it:

      PHP Code:
      function getAccountID($steam_id){
          
      $account_id substr(decbin($steam_id), 32);
          
      $account_id bindec($account_id);
          
          return 
      $account_id;

      That should make things easier. To answer your previous question: As far as I know, if someone leaves before the 15 minute mark, the match does not count. Otherwise, it does. Don't quote me on it though.
      Note my point regarding 64-bit integers in PHP - you need both hardware (presumably OS as well) to have 64-bit support and the 64-bit version of a PHP interpreter. Otherwise decbin() would generate an invalid result (refer to http://sg.php.net/decbin) when working with 64-bit integers. You can see that it actually returns 0 on all SteamIDs if ran on a 32-bit platform:
      http://codepad.org/wsC7dxKj

      As for the 15-minute mark, it's definitely not the case (I've been in games where someone abandoned around the 4th minute and the match is still counted for the rest of us.)

      Comment


      • Tsunami Nori, matches with Latest version cant get from this API...
        Last edited by Addsky; 07-26-2012, 07:28 AM.

        Comment


        • Originally posted by Ragnesis View Post
          Is the web api key avaible for people who do not own webpage but wants to use the functionality for whatever purpose(info gatehring, edu, etc)?
          Same question here, if so, what should I write under "Domain Name" in the "Register Steam Web API Key" page?

          Comment


          • Originally posted by Addsky View Post
            Tsunami Nori, matches with Latest version cant get from this API...
            yeah, some still can't access ...
            sorry for my bad English ...

            From Vietnam with Love - Lagest DOTA 2 Community in Vietnam: DotA-2.Vn

            Comment


            • I've made a visual representation of tower_status. It shows the towers that were up when the game ended on the Dota 2 minimap. I still need to pretty it up a bit with the icons you see in-game, but it works fine for now. I am still missing the barracks_status, but I will be adding that very soon.

              Here it is: http://dota-2.dk/matches/match.php?matchid=27081284

              It might be a bit slow because I am pulling directly from the API, and I am not caching anything yet. If anyone is interested, I will put the source code up here once I am finished.
              Last edited by Lazze; 07-26-2012, 11:23 AM.

              Comment


              • Originally posted by Lazze View Post
                I've made a visual representation of tower_status. It shows the towers that were up when the game ended on the Dota 2 minimap. I still need to pretty it up a bit with the icons you see in-game, but it works fine for now. I am still missing the barracks_status, but I will be adding that very soon.

                Here it is: http://dota-2.dk/matches/match.php?matchid=27081284

                It might be a bit slow because I am pulling directly from the API, and I am not caching anything yet. If anyone is interested, I will put the source code up here once I am finished.
                Same here!
                http://megapotion.com.br/dota2/match...ch_id=27768218

                Comment


                • Originally posted by vtFurlin View Post
                  Same question here, if so, what should I write under "Domain Name" in the "Register Steam Web API Key" page?
                  Answered already in this topic :P http://dev.dota2.com/showthread.php?...l=1#post290935

                  Comment


                  • IceHaku, top and mid tier 3 are missing from your example.

                    And pls anyone know a free php server to do some testing? =)

                    PS: Metroids, ty kind sir, I failed at my attempt at using the search.

                    Comment


                    • Two things:

                      1) Anyone have a source for the in game item icons and the hero minimap / rectangular icons? I could not find them in the dota2beta folder, I assume they are in some sort of compressed file.

                      2) How can you tell whether the match was All Pick, All Random, etc?

                      Comment


                      • Originally posted by vtFurlin View Post
                        IceHaku, top and mid tier 3 are missing from your example.

                        And pls anyone know a free php server to do some testing? =)

                        PS: Metroids, ty kind sir, I failed at my attempt at using the search.
                        fixed!

                        Comment


                        • It's really cool to see people making use of the API and I plan to update it with more features. However, just a heads up it make take a while to get back to adding features such as support for practice matches and allowing the calls to use start_at_match_id to be beyond the 500 latest matches. We're starting to focus on issues for the International, so those are taking higher priority for now.

                          Comment


                          • Zoid, someone else brought up a good point... stats.dota2.be claims 28,000,000 matches.

                            Storing all of the match data has the benefit of reducing unnecessary / repeated requests to the API.

                            If requests are limited to 1 per second, we are looking at 28,000,000 seconds to get the details for each match. 28,000,000 / 60 seconds per minute / 60 minutes per hour / 24 hours per day = 324 days.

                            So it would take 324 days at 1 request per second, and that's just for the GetMatchDetails. Assuming we also respect the default "matches_requested=25" for the list, that is another 16 days.

                            Are there any plans for an alternate method for expediting this process?

                            Also, could an option could be added to /GetMatchHistory/ which would just return match IDs? It would be nice to get batches of 1000+ match IDs in an array without any of the player data or match data.

                            Comment


                            • Originally posted by walkingcarpet View Post
                              Also, could an option could be added to /GetMatchHistory/ which would just return match IDs? It would be nice to get batches of 1000+ match IDs in an array without any of the player data or match data.
                              That would be very good.

                              Comment


                              • Also, could an option could be added to /GetMatchHistory/ which would just return match IDs? It would be nice to get batches of 1000+ match IDs in an array without any of the player data or match data.
                                Player specific full match ID list would be lovely without anything else than match ID returned (optionally with page x of y returned)
                                Last edited by Shinkai; 07-26-2012, 11:36 PM.

                                Comment

                                Working...
                                X