Skip to content
XHXIAIEIN edited this page Oct 11, 2023 · 8 revisions

lol-match-history

获取最近匹配的对局记录。

获取近期游戏的玩家

主要用于查询对方的 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']

最近10场对局的金币经济

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)