OpenMeteo.dotnet.client.sdk
3.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package OpenMeteo.dotnet.client.sdk --version 3.0.2
NuGet\Install-Package OpenMeteo.dotnet.client.sdk -Version 3.0.2
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="OpenMeteo.dotnet.client.sdk" Version="3.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenMeteo.dotnet.client.sdk" Version="3.0.2" />
<PackageReference Include="OpenMeteo.dotnet.client.sdk" />
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 OpenMeteo.dotnet.client.sdk --version 3.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenMeteo.dotnet.client.sdk, 3.0.2"
#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 OpenMeteo.dotnet.client.sdk@3.0.2
#: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=OpenMeteo.dotnet.client.sdk&version=3.0.2
#tool nuget:?package=OpenMeteo.dotnet.client.sdk&version=3.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
🌡️🌤️ Open-Meteo Dotnet Cleint SDK Library
A dotnet 8 library for the Open-Meteo API. Forked from https://github.com/AlienDwarf/open-meteo-dotnet
❕ Information
Support for:
- Almost all the OpenMeteo weather models (as of May 2025)
- Using OpenMeteo with an API key
- dotnet 8 (and above)
- Specific client lobrary Exceptions can be thrown
- Possible to register any custom logger in the Client SDK via the
IOpenMeteoLogger
interface
🔨 Installation/Build
NuGet
Use NuGet Package Manager GUI. Or use NuGet CLI:
dotnet add package OpenMeteo.dotnet.client.sdk
💻 Usage
Minimal:
using OpenMeteo;
static void Main()
{
RunAsync().GetAwaiter().GetResult();
}
static async Task RunAsync()
{
// Before using the library you have to create a new client.
// Once created you can reuse it for every other api call you are going to make.
// There is no need to create multiple clients.
OpenMeteo.OpenMeteoClient client = new OpenMeteo.OpenMeteoClient();
// Make a new api call to get the current weather in tokyo
WeatherForecast weatherData = await client.QueryAsync("Tokyo");
// Output the current weather to console
Console.WriteLine("Weather in Tokyo: " + weatherData.Current.Temperature + weatherData.CurrentUnits.Temperature);
// Output: "Weather in Tokyo: 28.1°C
}
To use an OpenMeteo API key, you can use the constructor with the API key as a parameter:
var client = OpenMeteoClient("YourSecretApiKeyHere");
The best place to look for more usage examples is the tests.
License
This project is open-source under the MIT license.
Appendix
This library uses the public and free available Open-Meteo API servers. See also:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- System.Text.Json (>= 6.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.