UkraineAlarm.Sdk 1.0.0

dotnet add package UkraineAlarm.Sdk --version 1.0.0
                    
NuGet\Install-Package UkraineAlarm.Sdk -Version 1.0.0
                    
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="UkraineAlarm.Sdk" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UkraineAlarm.Sdk" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="UkraineAlarm.Sdk" />
                    
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 UkraineAlarm.Sdk --version 1.0.0
                    
#r "nuget: UkraineAlarm.Sdk, 1.0.0"
                    
#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 UkraineAlarm.Sdk@1.0.0
                    
#: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=UkraineAlarm.Sdk&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=UkraineAlarm.Sdk&version=1.0.0
                    
Install as a Cake Tool

UkraineAlarm.Sdk

Unofficial .NET 10 SDK for the Ukraine Alert API (api.ukrainealarm.com, API v3).

The API requires an API key. Request one via the form at api.ukrainealarm.com.

Install

Add a project/package reference to UkraineAlarm.Sdk.

Usage with dependency injection

using UkraineAlarm;

builder.Services.AddUkraineAlarmClient("YOUR_API_KEY");
// or bind from configuration ("UkraineAlarm" section with ApiKey / BaseAddress):
// builder.Services.AddUkraineAlarmClient(builder.Configuration.GetSection(UkraineAlarmClientOptions.SectionName));
public sealed class AlertsService(IUkraineAlarmClient client)
{
    public async Task PrintActiveAlertsAsync(CancellationToken ct)
    {
        IReadOnlyList<AlertRegionModel> regions = await client.GetAlertsAsync(ct);
        foreach (AlertRegionModel region in regions)
        {
            Console.WriteLine($"{region.RegionName}: {region.ActiveAlerts.Count} active alert(s)");
        }
    }
}

Usage without a container

using UkraineAlarm;

using HttpClient http = new() { BaseAddress = new Uri("https://api.ukrainealarm.com") };
http.DefaultRequestHeaders.Add("Authorization", "YOUR_API_KEY");

IUkraineAlarmClient client = new UkraineAlarmClient(http);
AlertModification status = await client.GetStatusAsync();
Console.WriteLine(status.LastActionIndex);

Endpoints

Method Description
GetAlertsAsync() GET /api/v3/alerts — all regions with active alerts
GetRegionAlertsAsync(regionId) GET /api/v3/alerts/{regionId} — status of a region/district/community
GetRegionHistoryAsync(regionId?) GET /api/v3/alerts/regionHistory — last 25 alarms
GetStatusAsync() GET /api/v3/alerts/status — last action index
GetRegionsAsync() GET /api/v3/regions — full region tree
CreateWebhookAsync(model) POST /api/v3/webhook
UpdateWebhookAsync(model) PATCH /api/v3/webhook
DeleteWebhookAsync(model) DELETE /api/v3/webhook

Non-success responses throw UkraineAlarmApiException (exposes StatusCode and ResponseBody).

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 47 6/2/2026