piksel / SMHISharp

Library for querying SMHI Open Data API for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMHISharp

Library for querying SMHI Open Data API for .NET

Example application

Installation

Install from nuget:
Install-Package SMHISharp

Usage

var client = new Piksel.SMHISharp.ApiClient();

// Print all resources
client.GetResources(resources => {
  Console.WriteLinte("Resources:");
  foreach(var resource in resources){
    Console.WriteLine("  {resource.Key}: {resource.Title}");
  }
});

// Print all stations for resource 1
var resourceKey = "1"; // momentanvärde, 1 gång/tim
client.GetStations(resourceKey, stations => {
  Console.WriteLinte("Stations:");
  foreach(var station in stations){
    Console.WriteLine("  {station.Key}: {station.Title}");
  }
});

client.GetPeriods(resourceKey, stationKey, periods => {
  ...
});

// Note: GetData can fail
client.GetData(resourceKey, stationKey, periodKey, (dataPoints, exception) => {
  ...
});

About

Library for querying SMHI Open Data API for .NET

License:MIT License


Languages

Language:C# 100.0%