Skip to content

This is a client library for accessing the Forecast.IO web API using .Net Core and C#.

Notifications You must be signed in to change notification settings

donniefitz2/DarkSkyDotNetCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DarkSkyDotNetCore

This is a client library for accessing the Dark Sky web API using .Net Core and C#.

This library is based on the one created by @f0xy with some changes to support async calls and .Net Core.

Usage: Simply download the code (it's not on Nuget yet), reference it and you can call the Dark Sky API as outlined below. You must provide your Dark Sky API key with each call and provide latitude and longitude coordinates for forcast location.

  var apiKey = "your-dark-sky-api-key";

  var request = new ForecastRequest(apiKey, 33.518133f, -111.963043f, Unit.us);
  var response = await request.GetAsync();

This call will return a ForecastResponse for the current date and time that contains all of the data that the Dark Sky API offers.

You can optionally filter the data in the request by using the Exclude[] filters as well as include more options in the request by using the Extend[] options. The constructor also provides an overload to get the forecast for a specific date. There are also some handy extension methods for dealing with the returned data.

A console application is included that gives an example of using the client and it will run on Windows, macOS and Linux.

About

This is a client library for accessing the Forecast.IO web API using .Net Core and C#.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages