相关疑难解决方法(0)

使用OpenWeatherMap API会出现401错误

我正在尝试用JSON获取伦敦的天气数据,但我得到了HTTPError: HTTP Error 401: Unauthorized.如何使API工作?

import urllib2
url = "http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=10&mode=json&units=metric"
response = urllib2.urlopen(url).read()
Run Code Online (Sandbox Code Playgroud)

python weather-api openweathermap

4
推荐指数
2
解决办法
6099
查看次数

标签 统计

openweathermap ×1

python ×1

weather-api ×1