Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API has history limit? #26

Closed
j3ck opened this issue Jul 11, 2015 · 6 comments
Closed

API has history limit? #26

j3ck opened this issue Jul 11, 2015 · 6 comments

Comments

@j3ck
Copy link

j3ck commented Jul 11, 2015

Hi! I use this code to get the matches, but after 509 API returns the result one match all the time. As a result I could not get matches older than 9 months.Perhaps API has limitations for their old matches? Anybody know it?

    api = Dota.api
    @matches = []
    last_id = nil
    10.times do
      unless last_id.nil?
        matches = api.matches(player_id: player_id, after: last_id)
        last_id = matches.last.id
      else
        matches = api.matches(player_id: player_id)
      end
      last_id = matches.last.id
      @matches += matches
    end

When I get the results older then ID 983477424, I get it
https://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/V001/?start_at_match_id=983477424&key=&account_id=

{
    "result": {
        "status": 1,
        "num_results": 1,
        "total_results": 500,
        "results_remaining": 0,
        "matches": [
            {
                "match_id": 983477424,
                "match_seq_num": 880040655,
                "start_time": 1414274046,
                "lobby_type": 0,
                "radiant_team_id": 0,
                "dire_team_id": 0,
                "players": [
                    {
                        "account_id": 10210815,
                        "player_slot": 0,
                        "hero_id": 10
                    },
                    {
                        "account_id": 135009706,
                        "player_slot": 1,
                        "hero_id": 90
                    },
                    {
                        "account_id": 4294967295,
                        "player_slot": 2,
                        "hero_id": 34
                    },
                    {
                        "account_id": 52312630,
                        "player_slot": 3,
                        "hero_id": 105
                    },
                    {
                        "account_id": 41823129,
                        "player_slot": 4,
                        "hero_id": 65
                    },
                    {
                        "account_id": 115639012,
                        "player_slot": 128,
                        "hero_id": 74
                    },
                    {
                        "account_id": 4294967295,
                        "player_slot": 129,
                        "hero_id": 71
                    },
                    {
                        "account_id": 23521528,
                        "player_slot": 130,
                        "hero_id": 41
                    },
                    {
                        "account_id": 78839963,
                        "player_slot": 131,
                        "hero_id": 44
                    },
                    {
                        "account_id": 37245194,
                        "player_slot": 132,
                        "hero_id": 86
                    }
                ]

            }
        ]

    }
}
@bodrovis
Copy link
Contributor

I've never heard anything like that. It should not have any limits... Have you tried asking here http://dev.dota2.com/forumdisplay.php?f=411 ?

@vinnicc
Copy link
Owner

vinnicc commented Sep 5, 2015

Were you able to solve this issue @j3ck?

@j3ck
Copy link
Author

j3ck commented Sep 15, 2015

No @vinnicc , i can't solve this.

@uberamd
Copy link

uberamd commented Jan 28, 2016

@j3ck As far as I understand you're only able to return the last 500ish matches from the API, after that you need to start getting creative in order to keep going backwards in match history.

@WuPei
Copy link

WuPei commented Aug 2, 2016

Loop all hero_ids in the parameter and you will get all the match history.

@vinnicc
Copy link
Owner

vinnicc commented Sep 5, 2016

Hi @j3ck, I would also suggest you consult the dev forums as mentioned above if you need additional help. I'm closing this for now due to inactivity.

@vinnicc vinnicc closed this as completed Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants