2016-09-17 111 views
3

我试图通过openweathermap.org检索天气信息。无论我输入哪个邮政编码,它总是返回未找到城市。如何通过zip获取openweathermap.org信息?

http://api.openweathermap.org/data/2.5/weather?zip=98104,us&APPID=xxx 

{"cod":"404","message":"Error: Not found city"}

任何人都知道我做错了吗?

回答

2

我只是试着用我的ID,它也没有工作。这可能是服务器超载。 您可能需要填充openWeatherMap自己支持请求,这是我从前阵子发现:

https://openweathermap.desk.com/customer/portal/questions/13084185-error-not-found-city: 伊万 - 2015年9月15日下午3点51分UTC - OpenWeatherMap代理

To make it clear: a problem of our API is that errors like this don’t necessarily mean what they say. A 404 or, say, 503 error can happen even when your request is perfectly valid and when the place actually is in the database, the reason behind is the free servers overload. We do our best to extend the capacity continuously but don’t always manage fitting in the resources we have