public object GetWeather(double dLatitude = 47.4886, double dLongitude = -117.5786) { Debug.WriteLine(GetType().FullName + "." + MethodBase.GetCurrentMethod().Name); //NOTE: //The first thousand API calls you make every day are free, period. //Every API call after that costs $0.0001 each. //Credit us with a “Powered by Forecast” badge that links to http://forecast.io/ wherever you display data from the API. //https://api.forecast.io/forecast/ec8fab02bc1bf58c04e74c58bc2c3525/47.4886,-117.5786 //https://github.com/f0xy/forecast.io-csharp // API Key, Lat, Long, Unit var request = new ForecastIORequest("ec8fab02bc1bf58c04e74c58bc2c3525", (float)dLatitude, (float)dLongitude, Unit.us); var response = request.Get(); var strSummary = response.daily.summary; var currently = response.currently; List<DailyForecast> tempList = new ListStack<DailyForecast>(); tempList.AddRange(response.daily.data); if (!tempList.Any()) return new HttpResponseException(HttpStatusCode.BadRequest); //Ember Data expects a JSon array and an id in all returns const int id = 1; var currentWeather = new { currently.summary, currently.icon, currently.temperature }; var dailyWeather = tempList.AsQueryable() .Select( x => new { x.summary, x.icon, x.temperatureMin, x.temperatureMinTime, x.temperatureMax, x.temperatureMaxTime }) .ToList(); var data = new { id, strSummary, currentWeather, dailyWeather }; var weatherItems = new List<object>() { data }.AsEnumerable(); return new { weatherItems }; }