This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from riotwatcher import LolWatcher, ApiError | |
import pandas as pd | |
# golbal variables | |
api_key = 'RGAPI-xxxxx' | |
watcher = LolWatcher(api_key) | |
my_region = 'na1' | |
me = watcher.summoner.by_name(my_region, 'Doublelift') | |
print(me) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"leagueId":"c60807e8-6afb-38fd-ab9b-ae8588dc8b27", | |
"queueType":"RANKED_SOLO_5x5", | |
"tier":"CHALLENGER", | |
"rank":"I", | |
"summonerId":"6CfZ3nw63SwMi1e786wyzoMJNMXW0RJst0Dsgyy5mw7dmjw", | |
"summonerName":"Doublelift", | |
"leaguePoints":931, | |
"wins":160, | |
"losses":133, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "6CfZ3nw63SwMi1e786wyzoMJNMXW0RJst0Dsgyy5mw7dmjw", | |
"accountId": "bNDTw_Yf9nAiNKHKsZvbNByeq2Pi2uZy1UaJU5uuFjnmeA", | |
"puuid": "ROvZTmgICKryAwCYSqestOz-zohYGS2PCthSNGzuVKsn5OMGz6QgHzKOuDyXAnSwgJMvwvg3ilREVA", | |
"name": "Doublelift", | |
"profileIconId": 3270, | |
"revisionDate": 1584594439000, | |
"summonerLevel": 171 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check league's latest version | |
latest = watcher.data_dragon.versions_for_region(my_region)['n']['champion'] | |
# Lets get some champions static information | |
static_champ_list = watcher.data_dragon.champions(latest, False, 'en_US') | |
# champ static list data to dict for looking up | |
champ_dict = {} | |
for key in static_champ_list['data']: | |
row = static_champ_list['data'][key] | |
champ_dict[row['key']] = row['id'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_matches = watcher.match.matchlist_by_account(my_region, me['accountId']) | |
# fetch last match detail | |
last_match = my_matches['matches'][0] | |
match_detail = watcher.match.by_id(my_region, last_match['gameId']) | |
participants = [] | |
for row in match_detail['participants']: | |
participants_row = {} | |
participants_row['champion'] = row['championId'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Return the rank status for Doublelift | |
my_ranked_stats = watcher.league.by_summoner(my_region, me['id']) | |
print(my_ranked_stats) |