0

Anyone know how I can retrieve the total number of matches, by match type (queue) for a specific summoner? Some sites like wol.gg claim they can calculate your lifetime match history, but I don't see how the Riot API supports that with API request limits, 7 day range limits on match history, etc.

Any insight would be helpful, thanks!

unifiedac
  • 129
  • 5

2 Answers2

1

To get all of the available matches for a user, you need to call the Matches API in a while loop, incrementing the starting index each time until there are no new matches. I have some sample code you can look at in one of my past projects where I do exactly this, as well as caching the results in a database. It's too much to type out here, but you can see the logic for some of Riot's historical API:

https://github.com/ErikOverflow/Graphs-GG-Server/blob/master/services/matches.js

Erik Overflow
  • 2,220
  • 1
  • 5
  • 16
  • I am familiar with this method, however, each time you make a call to the Matches API, it counts towards the API limit, if you are retrieving 1 year of history, 1 week at a time, that would be 50+ API calls just for that one lookup. While this method would the results, it doesn't scale very well. Thanks for the feedback! – unifiedac Jul 16 '21 at 23:37
  • 1
    You should be caching the match data instead of making the web service call every time someone does a lookup. This is how other sites like op.gg function, actually. – Erik Overflow Jul 20 '21 at 19:03
0

you can get all match history in this link https://matchhistory.euw.leagueoflegends.com/en/#match-history/EUW1/211103650

I checked the request send when you want more match history and it seem that riot ask https://acs.leagueoflegends.com/v1/stats/player_history/EUW1/211103650?begIndex=135&endIndex=150& with begindex and endindex param

  • Thanks, I was aware of how leagueoflegends.com can display match history. My question was related to retrieving this data via the Riot API. – unifiedac Jul 13 '21 at 17:41
  • i did not find any clue about retriving this using Riot api but u can use the link below as api and get all data you need – Ouss Ma L'aire Bien Jul 13 '21 at 18:45
  • To my knowledge, the results from those URLs cannot be parsed server side. They can only be viewed in the browser. – unifiedac Jul 13 '21 at 20:02