如何通过 zip 获取 openweathermap.org 信息?

How to get openweathermap.org info by zip?

我正在尝试通过 openweathermap.org 检索天气信息。无论我输入哪个邮政编码,它总是 return 找不到城市。

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

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

有人知道我做错了什么吗?

我刚用我的 id 试了一下,也没用。可能是服务器过载。 您可能想用 openWeatherMap 自己填写支持请求,这是我不久前发现的:

来自 https://openweathermap.desk.com/customer/portal/questions/13084185-error-not-found-city: Ivan - 2015 年 9 月 15 日 03:51PM UTC - OpenWeatherMap Agent

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