Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Best way to download all recent match outcomes between professional teams?

  1. #1
    Basic Member
    Join Date
    Nov 2014
    Posts
    10

    Question Best way to download all recent match outcomes between professional teams?

    Hello,

    I'm totally new to this forum and the Dota 2 web api, so excuse me if this is a dumb question.

    For a class project, I want to build a statistical model that predicts the outcome of a match between two teams, based on their past history. I am trying to download this history for all professional dota teams that have played more than N games in the past 2-3 months.

    For example, I am trying to get the data in this form:

    Team A beat Team B
    Team B beat Team A
    Team B beat Team A
    ...

    I have looked at the web api spec and it is not immediately obvious to me how to query the api to get only the outcomes of professional matches, yet I see many doto stats sites that do this.

    For example, I don't know how to get a list of all the currently active professional teams. Given this list, it looks like I still can't request the match ids of these games without enumerating and iterating over all the leagues that exist.

    If some one could give a rough sketch of which api calls to make in which order to accomplish my goal, I would be grateful. Or if there is a place that I can periodically download a database dump with this information already in it, that would be awesome too.

    Cheers,
    John

  2. #2
    Basic Member GelioS's Avatar
    Join Date
    Aug 2012
    Posts
    130
    Well, you can parse all leagues matches (about 55K) from dota2-api and then filter out what you need.
    Or use sites which have already done it.
    Last edited by GelioS; 11-06-2014 at 03:10 AM.

    DotA 2 Web API Processing with PHP
    DotA2 Statistic - Professional leagues statistic
    follow @dota2statistic

  3. #3
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    exactly what GelioS said.

    fetch all the professional match data.
    store it in a DB.
    then use sql to filter the teams you want.

    in this case i think you'd use GetLeagueListing to get the league ids,
    then use GetMatchHistory, filterering by league_id.

    Do that for each league you care about.

  4. #4
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    So here's what I have so far:

    1. Download all the leagues and extract their leagueid
    2. Foreach leagueid, find all the matches played in that league
    3. Foreach match, request the match details

    Here is where I get stuck. It seems like the team_id is not recorded in the match details. Only the team name is included.

    Are team names in DOTA 2 unique? The only way I can think of to relate each match to the teams playing is by downloading the list of all the teams ever created and then joining this on the team name in each match.

    This seems incredibly wasteful in terms of API calls, especially since I only really want the most recent 30-60 days worth of data and I am only interested in the top 100-200 professional teams.

    I'm looking for a clever solution - maybe I can get a list of the steamids of all the team captains (how?) and then just query for league matches that include those steamids? This is a little gross as my list would need to be kept updated by hand.

    The other idea I had was to query live league games every 5-10 minutes and over the course of several weeks I could build up an inventory of what the current active leagues are. But this still doesn't help me relate matches played to the teams playing them.

    Why isn't team_id in match details!!!

  5. #5
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    I came up with another gross solution.

    1. Download all teams ever
    2. Extract steamids of all members of each team
    3. Download all matches ever
    4. Foreach match, iterate through all teams and if 4 members of any team are on the same side, label it with the appropriate team id

    I'm terribly afraid this is what every dota stats site is doing?

  6. #6
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    Hey.

    What about using https://wiki.teamfortress.com/wiki/W...ledLeagueGames. Does that work backwards in time? Can I use it to find all the league games that were scheduled withing the last month or so??? Looks like it was custom made for my use case.

    If it does work backwards in time, maybe add it to the sticky at the top of the forum with all the other api calls?

  7. #7
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    It does seem to work backwards in time. At least until Nov 1st 2014. Haven't experimented beyond that.

  8. #8
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    ARGGHGHHHHH BUT IT DOESN'T HAVE THE MATCH_ID

  9. #9
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    Is everyone using the team captain account id as a proxy for the team id?

    I saw this article here: http://dota2statistic.com/index.php/blog/7, which got me thinking maybe yes.

  10. #10
    Basic Member
    Join Date
    Nov 2014
    Posts
    10
    I've read through 10 pages of this forum and I eventually realized that the docs in the sticky and on the tf2 wiki are both incomplete.

    MatchDetails includes a dire_team_id and radiant_team_id field.

Posting Permissions

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