Home

Awesome

Nim-OpenWeatherMap

OpenWeatherMap API Lib for Nim, Free world wide Creative Commons & Open Data Licensed Weather data.

OpenWeatherMap

Install

Use

import openweathermap

# Sync OpenWeatherMap Client.
let owm_client = OWM(timeout: 9, lang: "en", api_key: "YOUR FREE API KEY HERE")
echo owm_client.get_current_cityname(city_name="montevideo", country_code="UY", accurate=true, metric=false)
echo owm_client.get_current_coordinates(lat=9.9, lon=99.99, accurate=false, metric=false)
echo owm_client.get_current_zipcode(zip_code=2804, country_code="AR", accurate=true, metric=false)
echo owm_client.get_current_bbox(left=9.9, bottom=9.9, right= 50.0, top= 50.0, zoom=2, cluster=true, accurate=false, metric=true)
echo owm_client.get_current_circle(lat=55.5, lon=9.9, cnt=2, cluster=true, accurate=true, metric=true)
echo owm_client.get_uv_current_coordinates(lat=9.9, lon=9.9)         # UV Light.
echo owm_client.get_uv_forecast_coordinates(lat=9.9, lon=9.9, cnt=3) # UV Light.
echo owm_client.get_co2_current_coordinates(lat=0.0, lon=10.0)       # CO2 Air Pollution.
echo owm_client.get_o3_current_coordinates(lat=55.0, lon=55.0)       # O3  Air Pollution.
echo owm_client.get_so2_current_coordinates(lat=66.0, lon=66.0)      # SO3 Air Pollution.
echo owm_client.get_no2_current_coordinates(lat=77.0, lon=77.0)      # NO2 Air Pollution.

# Async OpenWeatherMap Client.
proc test {.async.} =
  let
    async_owm_client = AsyncOWM(timeout: 9, lang: "en", api_key: "YOUR FREE API KEY HERE")
    async_resp = await async_owm_client.get_current_cityname(city_name="montevideo", country_code="UY")
  echo $async_resp
waitFor test()

API

Support

All the Free tier is covered, including Air Pollution, except Alerts endpoint and PNG Image Maps.

FAQ

No.

Yes.

Yes.

Yes. A Free No-Cost API Key.

No.

Yes.

Requisites