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 BlueCloud View Post
    Now it working, I think it was just a temporary error. But it not contains URLs to the Hero Icons... is there Way to obtain them automatically?
    For example, you can get pics from decompressed game source.
    Last edited by XAOPT; 08-01-2012, 12:25 AM.
    dotavideo.ru developer

    Comment


    • Originally posted by BlueCloud View Post
      Now it working, I think it was just a temporary error. But it not contains URLs to the Hero Icons... is there Way to obtain them automatically?
      Write a script to scrape them off of www.dota2.com/heroes/

      Comment


      • Anyone have the exact hex color codes for the players? Blue, teal, purple, yellow, orange, etc?

        Comment


        • Cyborgmatt was kind enough to provide a zip of the hero minimap icons, I thought I would share it here: http://dota2.cyborgmatt.com/minimap_icons/

          I've also attached a zip of the small rectangular hero images heroes.zip that I scraped from dota2.com/heroes

          Comment


          • How possible would it be to get commend information from the api? Potentially restrict access through steams openid, but I think being able to annotate games with which players you really liked has some very useful potential, especially as commends currently aren't much more than minor epeen.

            Comment


            • Have there been some changes to how this api works in the past day or so? Before I was seeing about one new game per second show up when getting the match_history. Now it seems that there are only about 3 new matches per minute.

              e: Looks like I was just being dumb, problem solved.
              Last edited by DolefulStoat; 08-04-2012, 02:26 AM.

              Comment


              • Quick iOS app

                Hi everyone,

                I used the api to make a quick iOS app to just essentially show you your stats like you were looking at someone's profile. I still have some things to do with it, but feel free to take a look.

                Dota Stats

                Right now, it just searches by player name, so if you have a common player name, it won't disguish the results.

                Sinbu

                Comment


                • To the devs,

                  please check if barrack_status_dire and barrack_status_dire is getting correct values

                  please create a GetItems service similar to the GetHeroes one

                  Comment


                  • I seem to be getting low returns on matches lately. Seems like a new match is only showing up every 5 minutes or so. It also seems as if all of the new matches reported are matches that are abandons.

                    Has the most recent update caused a bug somewhere in the system?

                    Comment


                    • I PMed DolefulStoat and he wrote:
                      Since this thursday it seems that new matches are being spread between all 500 matches returned in the list, rather than just being added to the first page.
                      I tested this and saw that he's right.

                      Comment


                      • Originally posted by Gaba View Post
                        To the devs,

                        please check if barrack_status_dire and barrack_status_dire is getting correct values

                        please create a GetItems service similar to the GetHeroes one
                        I noticed this too. barrack_status_dire seems to always have the same value as barrack_status_radiant. The radiant status is correct, but the dire status seems to be linked to the radiant status somewhere internally. Devs, please follow this up.

                        Comment


                        • I found a lot of help in this thread, so here is a very lame way to draw towers on a map in return. It's not optimized at all, but it works. Maybe someone finds it useful:

                          PHP Code:
                          <?php
                          $time_start 
                          microtime(true);

                          // pad the dec to 11bit binary
                          $radiant_towers sprintf('%011b'$_GET["radiant"] ); 
                          $dire_towers  sprintf('%011b'$_GET["dire"] );

                          $canvas = @imagecreatefromgif("map.gif"); // load map into our canvas

                          // Colors
                          $red imagecolorallocate($canvas25500); // red for dire
                          $green imagecolorallocate($canvas02550); // green for radiant

                          // Radiant
                          // Bot
                          if ($radiant_towers[8]) { draw_tower($canvas115387$green); } // radiant bot t3 bot (rax)
                          if ($radiant_towers[9]) { draw_tower($canvas214386$green); } // radiant bot t2 bot
                          if ($radiant_towers[10]) { draw_tower($canvas360388$green); } // radiant bot t1 bot
                          // Ancient
                          if ($radiant_towers[0]) { draw_tower($canvas64353$green); } // radiant ancient 1
                          if ($radiant_towers[1]) { draw_tower($canvas76363$green); } // radiant ancient 2
                          // Top
                          if ($radiant_towers[2]) { draw_tower($canvas38309$green); } // radiant t3 top (rax)
                          if ($radiant_towers[3]) { draw_tower($canvas50245$green); } // radiant t2 top
                          if ($radiant_towers[4]) { draw_tower($canvas50172$green); } // radiant t1 top
                          // Mid
                          if ($radiant_towers[5]) { draw_tower($canvas92333$green); } // radiant t3 mid (rax)
                          if ($radiant_towers[6]) { draw_tower($canvas127299$green); } // radiant t2 mid
                          if ($radiant_towers[7]) { draw_tower($canvas181261$green); } // radiant t1 mid


                          // Dire
                          // Bot 
                          if ($dire_towers[8]) { draw_tower($canvas398141$red); } // dire t3 (rax) bot
                          if ($dire_towers[9]) { draw_tower($canvas396215$red); } // dire t2 bot
                          if ($dire_towers[10]) { draw_tower($canvas394272$red); } // dire t1 bot
                          // Ancient
                          if ($dire_towers[0]) { draw_tower($canvas35984$red); } // dire ancient 1
                          if ($dire_towers[1]) { draw_tower($canvas37296$red); } // dire ancient 2
                          // Top
                          if ($dire_towers[2]) { draw_tower($canvas32362$red); } // dire t3 (rax) top
                          if ($dire_towers[3]) { draw_tower($canvas21850$red); } // dire t2 top
                          if ($dire_towers[4]) { draw_tower($canvas8555$red); } // dire t1 top
                          // Mid
                          if ($dire_towers[5]) { draw_tower($canvas338118$red); } // dire t3 (rax) mid
                          if ($dire_towers[6]) { draw_tower($canvas287161$red); } // dire t2 mid
                          if ($dire_towers[7]) { draw_tower($canvas249212$red); } // dire t1 mid

                          // Debug
                          $time_end microtime(true);
                          $time $time_end $time_start;
                          imagestring($canvas510410"debug: " $time "| $dire_towers | $radiant_towers"$red);

                          // Output stuff
                          header('Content-Type: image/png');
                          imagepng($canvas);
                          imagedestroy($canvas);

                          // Helper function to draw a 10x10 pixel "tower"
                          function draw_tower($canvas$x$y$color){
                              
                          imagefilledrectangle($canvas$x$y$x+10$y+10$color);
                          }

                          ?>
                          You can see what the estimated output looks like by clicking the "Tower Statistics" tab on my test project: http://oldmanclub.org/dev/dota/index.php?id=30249270

                          Comment


                          • @Zoid
                            Where can we fetch team logo?

                            Having this from data:
                            "radiant_logo": 938122284711231033,

                            I saw calls to:
                            http://cloud.steampowered.com/ugc/93...xxxxxxxxxxxxx/
                            but I have no clue how to figure out those 'x's to make valid call.
                            You gotta FIGHT!
                            For Your RIGHT!
                            To BUUUGFIX!

                            Comment


                            • Originally posted by tomato View Post
                              I found a lot of help in this thread, so here is a very lame way to draw towers on a map in return. It's not optimized at all, but it works. Maybe someone finds it useful:

                              PHP Code:
                              <?php
                              $time_start 
                              microtime(true);

                              // pad the dec to 11bit binary
                              $radiant_towers sprintf('%011b'$_GET["radiant"] ); 
                              $dire_towers  sprintf('%011b'$_GET["dire"] );

                              $canvas = @imagecreatefromgif("map.gif"); // load map into our canvas

                              // Colors
                              $red imagecolorallocate($canvas25500); // red for dire
                              $green imagecolorallocate($canvas02550); // green for radiant

                              // Radiant
                              // Bot
                              if ($radiant_towers[8]) { draw_tower($canvas115387$green); } // radiant bot t3 bot (rax)
                              if ($radiant_towers[9]) { draw_tower($canvas214386$green); } // radiant bot t2 bot
                              if ($radiant_towers[10]) { draw_tower($canvas360388$green); } // radiant bot t1 bot
                              // Ancient
                              if ($radiant_towers[0]) { draw_tower($canvas64353$green); } // radiant ancient 1
                              if ($radiant_towers[1]) { draw_tower($canvas76363$green); } // radiant ancient 2
                              // Top
                              if ($radiant_towers[2]) { draw_tower($canvas38309$green); } // radiant t3 top (rax)
                              if ($radiant_towers[3]) { draw_tower($canvas50245$green); } // radiant t2 top
                              if ($radiant_towers[4]) { draw_tower($canvas50172$green); } // radiant t1 top
                              // Mid
                              if ($radiant_towers[5]) { draw_tower($canvas92333$green); } // radiant t3 mid (rax)
                              if ($radiant_towers[6]) { draw_tower($canvas127299$green); } // radiant t2 mid
                              if ($radiant_towers[7]) { draw_tower($canvas181261$green); } // radiant t1 mid


                              // Dire
                              // Bot 
                              if ($dire_towers[8]) { draw_tower($canvas398141$red); } // dire t3 (rax) bot
                              if ($dire_towers[9]) { draw_tower($canvas396215$red); } // dire t2 bot
                              if ($dire_towers[10]) { draw_tower($canvas394272$red); } // dire t1 bot
                              // Ancient
                              if ($dire_towers[0]) { draw_tower($canvas35984$red); } // dire ancient 1
                              if ($dire_towers[1]) { draw_tower($canvas37296$red); } // dire ancient 2
                              // Top
                              if ($dire_towers[2]) { draw_tower($canvas32362$red); } // dire t3 (rax) top
                              if ($dire_towers[3]) { draw_tower($canvas21850$red); } // dire t2 top
                              if ($dire_towers[4]) { draw_tower($canvas8555$red); } // dire t1 top
                              // Mid
                              if ($dire_towers[5]) { draw_tower($canvas338118$red); } // dire t3 (rax) mid
                              if ($dire_towers[6]) { draw_tower($canvas287161$red); } // dire t2 mid
                              if ($dire_towers[7]) { draw_tower($canvas249212$red); } // dire t1 mid

                              // Debug
                              $time_end microtime(true);
                              $time $time_end $time_start;
                              imagestring($canvas510410"debug: " $time "| $dire_towers | $radiant_towers"$red);

                              // Output stuff
                              header('Content-Type: image/png');
                              imagepng($canvas);
                              imagedestroy($canvas);

                              // Helper function to draw a 10x10 pixel "tower"
                              function draw_tower($canvas$x$y$color){
                                  
                              imagefilledrectangle($canvas$x$y$x+10$y+10$color);
                              }

                              ?>
                              You can see what the estimated output looks like by clicking the "Tower Statistics" tab on my test project: http://oldmanclub.org/dev/dota/index.php?id=30249270
                              I did the exact same thing xD
                              http://megapotion.com.br/dota2/match...ch_id=30616543

                              Comment


                              • Originally posted by IceHaku View Post
                                I like your version more. It would also consume much less resources than my GD version. Where did you find the little tower images? I prefer them over my lame color ones!

                                Comment

                                Working...
                                X