Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 1.05 KB

File metadata and controls

24 lines (18 loc) · 1.05 KB

OpenWeatherMap

An aot compatible .NET client for OpenWeatherMap (https://openweathermap.org/)

NuGet version NuGet downloads GitHub

Prerequisites

Get API-Key from https://openweathermap.org/

Usage

string apiKey = "{your apiKey}";
var settings = new Gamoya.Weather.OpenWeatherMap.Settings { Units = Units.Metric, LanguageCode = "en" };

decimal latitude = 52.520008m;
decimal longitude = 13.404954m;

using (var openWeatherMapClient = new Gamoya.Weather.OpenWeatherMap.OpenWeatherMapClient(apiKey, settings)) {
    var currentWeather = await GetCurrentWeatherAsync(latitude, longitude);
    var forecastWeather = await GetForecastWeatherAsync(latitude, longitude);
}