Using the OpenWeather One Call API
The data source for the project in this chapter is a free API provided by OpenWeather. It is called the OpenWeather One Call API (https://openweathermap.org/api/one-call-api). This API is able to return current, forecast, and historical weather data. We will be using it to access the local forecast for the next 5 days. This is the format of an API call using the OpenWeather One Call API:
https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&appid={API key}
These are the parameters for the OpenWeather One Call API:
lat
: Latitude. This parameter is required.lon
: Longitude. This parameter is required.appid
: API key. This parameter is required. It is on the Accounts page under the API key tab.units
: Units of measurement. This is set as Standard, Metric, or Imperial.exclude
: Excluded data. This is used to simplify data that is returned. Since we will only be using the daily forecast, we will exclude...