The question is published on by Tutorial Guruji team.
Using the openweathermap api how can I get the average temperature on a certain day using javascript. I know I am limited with only getting with in the next 5 days. I have been looking and could not find a way to do it and have seen nobody else do.
Answer
You can make use of the api api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
. Please refer here for more details.
You can search weather forecast for 5 days with data every 3 hours by city name. All weather data can be obtained in JSON and XML formats.
https://openweathermap.org/forecast5
API call:
api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
Parameters:
q city name and country code divided by comma, use ISO 3166 country
codesExamples of API calls:
api.openweathermap.org/data/2.5/forecast?q=London,us&mode=xml