OpenWeatherMap获取当天的平均气温
问题描述:
使用openweathermap api我怎样才能使用javascript获取某一天的平均气温。我知道在接下来的5天内我只能得到帮助。我一直在寻找,并找不到一种方法来做到这一点,并看到没有人做。OpenWeatherMap获取当天的平均气温
答
您可以使用api api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
。请参阅here了解更多详情。
您可以搜索5天的天气预报,每3小时按城市名称提供数据。所有天气数据都可以通过JSON和XML格式获得。
https://openweathermap.org/forecast5
API调用:
api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
参数:
q城市名称和国家代码以逗号分隔,使用ISO 3166国家 代码
个API调用的例子:
api.openweathermap.org/data/2.5/forecast?q=London,us &模式= XML
我理解的API,但问题是它在3小时内给我接下来的5天,我有问题找到一种方法来获得某一天的温度 – HamptonM
你能更具体一些吗?解析数据是否存在问题? – Agalo