A dotnet 8 library for the Open-Meteo API. Forked from https://github.com/AlienDwarf/open-meteo-dotnet
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.
Use NuGet Package Manager GUI. Or use NuGet CLI:
dotnet add package OpenMeteo.dotnet.client.sdkusing 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.
This project is open-source under the MIT license.
This library uses the public and free available Open-Meteo API servers. See also: