Skip to content

colinnuk/open-meteo-dotnet-client-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🌡️🌤️ Open-Meteo Dotnet Client SDK Library

build and test GitHub license Nuget

A dotnet 8 library for the Open-Meteo API. Forked from https://github.com/AlienDwarf/open-meteo-dotnet

❕ Information

Support for:

  • Most of the OpenMeteo weather models (as of October 2025)
  • Using OpenMeteo with an API key
  • Using custom URLs for self-hosted OpenMeteo instances
  • dotnet 8 (and above)
  • OpenMeteo Flatbuffers support - makes for much faster parsing of large datasets
  • Specific client library Exceptions optionally thrown for detailed error handling

Pretty much all the library's classes are public, so you can extend the library as needed in your own code.

🔨 Installation/Build

NuGet

NuGet Package

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.
    var client = new OpenMeteo.OpenMeteoClient();

    // Make a new api call to get the current weather in tokyo
    var weatherData = await client.QueryWeatherApiAsync("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:

About

A .Net library for the Open-Meteo.com API.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%