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 can 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. After you create an account, you can manage your API keys from theAPI keys
tab.units
: Units of measurement. This is set asStandard
,Metric
, orImperial
.exclude
: Excluded data. This is used to simplify data that is returned. Since we will only be using the daily forecast, we will exclude current...