Skip to content

piksel/SMHISharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages