请在下面提供帮助,我正在尝试从天气API中提取Json数据;但是当我打电话给json.load()
时,它什么也没返回:
def get_weather_from_api(location_id):
api_key = ''
url = f'http://dataservice.accuweather.com/currentconditions/v1/{location_id}?apikey={api_key}&language=en-us&details=false'
response = requests.get(url)
data = json.load(response.text)
print(data)