【发布时间】:2022-01-19 11:40:02
【问题描述】:
我正在使用来自该站点 https://dev.whatismymmr.com 的 API,并且我想专门请求 closestRank,但我只得到一个 KeyError: 'ranked.closestRank'。但我可以获得整个 ['ranked'] 对象(其中包含 closestRank),但我最终得到了很多我不需要的信息。
我怎样才能得到最接近的排名?
我的代码
import requests
LeagueName = input ("Summoner name")
base = ("https://eune.whatismymmr.com/api/v1/summoner?name=")
Thething = base + LeagueName
print (Thething)
response = requests.get(Thething)
print(response.status_code)
MMR = response.json()
print (MMR['ranked.closestRank'])
API 命令
<queue>.closestRank(队列是游戏模式,可以是普通或排名)
您可以使用召唤师名称babada27进行测试。
【问题讨论】: