Skip to content

dmitryershov0/accuweather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accuweather Api Client

Windows Linux OS X
Build status Build Status Build Status

1️⃣ Location Api Client. 📜 https://developer.accuweather.com/accuweather-locations-api/apis

2️⃣ Current Conditions Api Client. 📜 https://developer.accuweather.com/accuweather-current-conditions-api/apis

3️⃣ Forecast Api Client. 📜 https://developer.accuweather.com/accuweather-forecast-api/apis

4️⃣ Indices Api Client. 📜 https://developer.accuweather.com/accuweather-indices-api/apis


Download

Accuweather Api Client is available on NuGet.


Usage

using Accuweather;


public class Startup
{

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSingleton<IAccuweatherApi>(l => new AccuweatherApi("YOUR_API_KEY", "en-us");
    }
}
using Accuweather;


public class SampleController : Controller
{
    private readonly IAccuweatherApi _accuweatherApi;
    
    public void SampleController(ILocationsApi accuweatherApi)
    {
        _accuweatherApi = accuweatherApi;
    }
    
    public async Tasnk<ActionResult> GetRegionList() 
    {
        var regionList = await _accuweatherApi.Locations.GetRegionList();
        return Json(regionList , JsonRequestBehavior.AllowGet);
    }
}