1.0.1 • Published 3 years ago
@lstilahun/openweather-api-library v1.0.1
Open Weather Map API wrapper library
OpenWeather Class:
const weather = OpenWeather(apiKey, units)
weather.getWeatherByZip(zip)
weather.getWeatherByCity(city)
weather.getWeatherByCityID(cityId)
weather.getWeatherByGeo(lat, lon)
Here is a list of the URLs this library uses:
- By city name
- api.openweathermap.org/data/2.5/weather?q={city name}&appid={API key}
- By city ID
- api.openweathermap.org/data/2.5/weather?id={city id}&appid={API key}
- By geocoordinates
- api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}
- By zip code
- api.openweathermap.org/data/2.5/weather?zip={zip code},{country code}&appid={API key}