【发布时间】:2020-10-07 17:27:43
【问题描述】:
感谢您的光临。当我对 The Rundown API 执行获取请求时,我收到“404 page not found”消息。我已经浏览了docs,并且我相信我使用的是适当的 URL。 我专门寻找体育赛事,我使用了这两个网址:
https://therundown-therundown-v1.p.rapidapi.com/sports/1/events?include=scores //应该返回预计分数
https://therundown-therundown-v1.p.rapidapi.com/sports/1/events //应该返回这项运动即将举行的所有活动
我的 API 密钥正在工作,我确实从其他 URL 获取数据,即
https://therundown-therundown-v1.p.rapidapi.com/sports/1/events/6-1-2019//返回当天体育赛事的数据
这是我的代码:
url = "https://therundown-therundown-v1.p.rapidapi.com/sports/1/events"
headers = {
'x-rapidapi-host': "therundown-therundown-v1.p.rapidapi.com",
'x-rapidapi-key': "{my_api_key}"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
我想知道我是否没有获得任何数据,因为可能许多运动的时间表由于大流行而搞砸了......但我想我只会得到一个空的对象,而不是一个404。 任何帮助将不胜感激。再次感谢!
【问题讨论】:
标签: json python-3.x api