-
Notifications
You must be signed in to change notification settings - Fork 41
lol match history
XHXIAIEIN edited this page Oct 11, 2023
·
8 revisions
获取最近匹配的对局记录。
主要用于查询对方的 puuid
await connection.request('GET', '/lol-match-history/v1/recently-played-summoners')
await connection.request('GET', '/lol-match-history/v1/products/lol/{puuid}/matches')
这里先指定最近的3场
/lol-match-history/v1/products/lol/current-summoner/matches?begIndex=0&endIndex=2`
拿到返回的JSON数据,进到这个路径里
history['games']['games']
这里就是英雄对局内的数据
participants[0]
对局时间
['gameCreationDate']
英雄ID:根据ID再获取英雄名称 /lol-champ-select/v1/grid-champions/{championId}
然后获取 name
['participants'][0]['championId']
胜负 "Win" or "Fail"
['participants'][0]['stats']['win']
KDA
['participants'][0]['stats']['kills']
['participants'][0]['stats']['deaths']
['participants'][0]['stats']['assists']
summoner = await connection.request('GET', '/lol-summoner/v1/current-summoner')
summoner = await summoner.json()
history = await connection.request('GET', f"/lol-match-history/v1/products/lol/{summoner['puuid']}/matches")
history = await history.json()
goldEarned = []
for x in range(10):
goldEarned.append(history['games']['games'][x]['participants'][0]['stats']['goldEarned'])
print(goldEarned)