Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import requests
Regio = ""
Summoner = ""
Api_Key = "RGAPI-ae592d5c-5e47-4b4c-89e6-005c26a51f7a"
def searchSummonerInfo(region, Summoner, Api_Key):
url = "https://" + region + ".api.riotgames.com/lol/summoner/v3/summoners/by-name/" + Summoner + "?api_key=" + Api_Key
response = requests.get(url)
return response.json()
def searchRankedInfo(region, SummonerID, Api_Key):
url = "https://" + region + ".api.riotgames.com/lol/league/v3/positions/by-summoner/" + SummonerID + "?api_key=" + Api_Key
response = requests.get(url)
return response.json()
def RankedInfo(region, Summoner):
SummonerInfo = searchSummonerInfo(region, Summoner, Api_Key)
SummonerID = str(SummonerInfo['id'])
RankedData = searchRankedInfo(region, SummonerID, Api_Key)
SoloQLeague = RankedData[1]['leagueName']
SoloQRank = RankedData[1]['tier'] + " " + RankedData[1]['rank']
SoloQPoints = RankedData[1]['leaguePoints']
SoloQWins = RankedData[1]['wins']
SoloQLosses = RankedData[1]['losses']
return ("You are currently in the league: " + str(SoloQLeague) + "\n" +
"Your current rank is: " + str(SoloQRank) + " and your current points are: " + str(SoloQPoints) + "\n" +
"You have a total of " + str(SoloQWins) + " wins, and a total of " + str(SoloQLosses) + " losses.")
#print(RankedInfo(region='euw1', Summoner='KennenBalls'))