1
使用openweathermap api我怎樣才能使用javascript獲取某一天的平均氣溫。我知道在接下來的5天內我只能得到幫助。我一直在尋找,並找不到一種方法來做到這一點,並看到沒有人做。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