OpenWeatherMap.API 2.0.27-pre

This is a prerelease version of OpenWeatherMap.API.
There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenWeatherMap.API --version 2.0.27-pre
                    
NuGet\Install-Package OpenWeatherMap.API -Version 2.0.27-pre
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenWeatherMap.API" Version="2.0.27-pre" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenWeatherMap.API" Version="2.0.27-pre" />
                    
Directory.Packages.props
<PackageReference Include="OpenWeatherMap.API" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenWeatherMap.API --version 2.0.27-pre
                    
#r "nuget: OpenWeatherMap.API, 2.0.27-pre"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenWeatherMap.API@2.0.27-pre
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenWeatherMap.API&version=2.0.27-pre&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=OpenWeatherMap.API&version=2.0.27-pre&prerelease
                    
Install as a Cake Tool

OpenWeatherMap.API

Version Downloads

OpenWeatherMap API client for .NET

Download and Install OpenWeatherMap.API

This library is available on NuGet: https://www.nuget.org/packages/OpenWeatherMap.API Use the following command to install OpenWeatherMap.API using NuGet package manager console:

PM> Install-Package OpenWeatherMap.API

You can use this library in any .NET project which is compatible to .NET Standard 2.0 and higher.

API Usage

The following sections document basic use cases of this library. The following code excerpts can also be found in the sample applications.

Create weather service

OpenWeatherMapService is the main entry point of this library. Create an instance of OpenWeatherMapService or inject IOpenWeatherMapService using dependency injection techniques.

IOpenWeatherMapService openWeatherMapService = new OpenWeatherMapService(logger, openWeatherMapConfiguration);
Request current weather for GPS position

Call GetCurrentWeatherAsync with latitude and longitude to retrieve the current weather information for the given location. WeatherInfo is the model that contains all relevant information provided by OpenWeatherMap API.

var weatherInfo = await openWeatherMapService.GetCurrentWeatherAsync(latitude: 47.1823761d, longitude: 8.4611036d);

Console.WriteLine(
    $"Current Weather Info:{Environment.NewLine}" +
    $"Location: {weatherInfo.CityName}{Environment.NewLine}" +
    $"Temperature: {weatherInfo.Main.Temperature}{Environment.NewLine}" +
    $"Humidity: {weatherInfo.Main.Humidity}{Environment.NewLine}" +
    $"Pressure: {weatherInfo.Main.Pressure}{Environment.NewLine}");

Contribution

Contributors welcome! If you find a bug or you want to propose a new feature, feel free to do so by opening a new issue on github.com.

License

This project is Copyright © 2022 Thomas Galliker. Free for non-commercial use. For commercial use please contact the author.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OpenWeatherMap.API:

Repository Stars
immichFrame/ImmichFrame
Version Downloads Last Updated
2.1.4-pre 219 10/18/2024
2.1.3-pre 131 6/22/2024
2.1.2 3,139 5/14/2024
2.1.0-pre 138 4/29/2024
2.0.59 436 4/23/2024
2.0.57-pre 136 3/27/2024
2.0.53-pre 131 3/11/2024
2.0.52-pre 119 3/11/2024
2.0.51-pre 603 1/26/2024
2.0.50 888 1/7/2024
2.0.48-pre 157 1/7/2024
2.0.47-pre 235 10/31/2023
2.0.46-pre 133 10/19/2023
2.0.44-pre 132 9/26/2023
2.0.42-pre 138 9/24/2023
2.0.41-pre 149 9/23/2023
2.0.38-pre 132 9/19/2023
2.0.34-pre 173 9/10/2023
2.0.31-pre 159 9/3/2023
2.0.30-pre 178 9/3/2023
2.0.29-pre 171 8/29/2023
2.0.28-pre 178 8/27/2023
2.0.27-pre 166 8/27/2023
2.0.26-pre 163 8/27/2023
2.0.22-pre 173 8/19/2023
2.0.19-pre 171 8/18/2023
2.0.15-pre 141 8/18/2023
2.0.11-pre 163 8/18/2023
2.0.8-pre 152 8/17/2023
2.0.5-pre 167 8/16/2023
1.2.4-pre 192 8/1/2023
1.2.3-pre 205 7/23/2023
1.2.2-pre 247 7/23/2023
1.2.0-pre 196 6/29/2023
1.1.25-pre 188 6/28/2023
1.1.24 688 4/30/2023
1.1.23-pre 219 4/22/2023
1.1.22 353 3/27/2023
1.1.20-pre 212 3/27/2023
1.1.18-pre 218 3/27/2023
1.1.10-pre 240 2/6/2023
1.1.9-pre 293 1/10/2023
1.1.8-pre 224 1/10/2023
1.1.7-pre 212 1/9/2023
1.1.6-pre 242 1/5/2023
1.1.5-pre 222 1/5/2023
1.1.4-pre 219 12/30/2022
1.1.3 428 12/28/2022
1.1.1-pre 223 12/27/2022
1.0.20-pre 228 12/27/2022
1.0.17 558 9/27/2022
1.0.15-pre 235 9/27/2022
1.0.14-pre 295 8/26/2022
1.0.13-pre 235 8/26/2022
1.0.12-pre 234 8/26/2022
1.0.11-pre 238 8/21/2022
1.0.10 538 8/21/2022

2.0.x
- Use unit types from dependency UnitsNet

1.2.0
- Major refactoring in wind direction data model
- Add multilingual support

1.0.0
- Initial release