我正在尝试使用OpenWeatherMap API按城市名称获取历史数据,尽管Docs没有指定如何在此类调用中传递API密钥。
他们在文档上的示例是:
http://history.openweathermap.org/data/2.5/history/city?q=London,UK
虽然没有传递API密钥我得到一个401
错误。我在other Stack posts看到人们通过插入参数?&APPID=**api-key-here**
成功拨打电话,虽然我已经尝试了几十个排列而没有运气。
我想使用以下调用,以便我可以指定时间范围。
http://history.openweathermap.org/data/2.5/history/city?q={city ID},{country code}&type=hour&start={start}&end={end}
OpenWeatherMap收取使用历史天气收集费用。如果您是免费用户,则您的API密钥不适用于付费内容。
您可以在此处找到有关其费率的更多信息:https://openweathermap.org/price