Openweathermap API出错400

我试图使用openweathermap为我的
python应用程序,但有一个问题.我对此链接提出了一个简单的请求:’http://api.openweathermap.org/data/2.5/weather?q = London,fr& appid = [My Key]我收到错误400,消息无法进行地理编码.

你知道这意味着什么吗?

最佳答案 它给你一个错误的原因是因为你要求API提供伦敦,法国(q =伦敦,fr)的数据. fr部分是国家代码.

你所要做的就是将fr改为英国,你应该被设置!链接将是http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=[yourID]

点赞