-1

I would like to be able to get for every ranked games between Date1 and Date2 in Regioneuw -the team1 : 5 champs names and position and team2 5 champs names and position -team1_win : TRUE or FALSE team2_win : TRUE or FALSE

I have never worked with APIS, (I do datascience with R), would like to switch to Python to play with the data but the communicate with API (via Python) is too hard for me as a beginning, and I would like to begin Python with this data "project".

Already watched some tutos about this API, instructions unclear. Someone can give me an hand ?
An another issue I have is, I'm used in R studio to have all the docs by help(package) or ?package. In python I have found yet something as complete.

Best regards

fatneet
  • 11
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 11 '22 at 16:31
  • Hey, if you have any problems / questions regarding the riot games api, I would recommend you to join the dev discord server (linked on the api dashboard) and use libraries to not spent time on coding unnecessary request code – DarkIntaqt Aug 11 '22 at 23:12
  • Thanks @DarkIntaqt , the main reason as why i try to avoid this not general kind of librairies for now is that i'm really used to R/Rstudio documentation (which is so complete and easy to access within the workspace), and as i learned that language by practicing, i would like to do the same with python. But if i'm stuck i might go there. I will try to work on one comment solution for now. Will update my own full code answer if get it right. – fatneet Aug 13 '22 at 14:11

1 Answers1

0

From my experience using Riot API (might be wrong), i found that it is not optimized to support such specific needs, so you always have to find a work around.

  • what i did is that i targeted a specific tiers and divisions using LEAGUE-V4.
  • extracted puuids using last step's output (summuner id to be specific) using SUMMONER-V4.
  • extracted matches ids utilizing the puuids using the first endpoint of MATCH-v5.
  • then i got to the matches details using the matches ids using the second endpoint of MATCH-V5.

And for the requests you can use the following lines as an example:

    import requests
    import json

    url_pull = "https://{}.api.riotgames.com/tft/league/v1/entries/{}/{}?page={}&api_key={}".format(region,tier,division,page,api_key)
    profile_list = requests.get(url_pull).json()
OneShot
  • 116
  • 5
  • 1
    Technically correct, your code only covers the first point, but your way to solve this problem is correct. I would like to add that you need to add startTimestamp and endTimestamp to the match v5 (point 3) request AND that this can take a huge amount of time due to a small rate limit – DarkIntaqt Aug 11 '22 at 23:10