I have a Json that I download from a wunderground Api and it is huge. How can I pass it to an object from which I can retrieve the data in a readable and verbose way?
I tried like this, but it didn't work for me.
public void ProcesaJson{
var cli = new WebClient();
string weather = cli.DownloadString(http://api.wunderground.com/api/875ffcffceb88b9c/hourly/es/q/-31.4,-64.1833.json);
dynamic stuff = JObject.Parse(weather);
string hora = stuff.hour; //devuelve null
}
JSON:
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
}
,
"error": {
"type": "unknownfeature"
}
}
,
"hourly_forecast": [
{
"FCTTIME": {
"hour": "16","hour_padded": "16","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "15","mday_padded": "15","yday": "14","isdst": "0","epoch": "1516042800","pretty": "4:00 PM -03 on January 15, 2018","civil": "4:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Monday","weekday_name_night": "Monday Night","weekday_name_abbrev": "Mon","weekday_name_unlang": "Monday","weekday_name_night_unlang": "Monday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "85", "metric": "29"},
"dewpoint": {"english": "59", "metric": "15"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "30",
"wspd": {"english": "11", "metric": "18"},
"wdir": {"dir": "NE", "degrees": "55"},
"wx": "Partly Cloudy",
"uvi": "8",
"humidity": "42",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "84", "metric": "29"},
"feelslike": {"english": "84", "metric": "29"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "6",
"mslp": {"english": "29.82", "metric": "1010"}
}
,
{
"FCTTIME": {
"hour": "0","hour_padded": "00","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516071600","pretty": "12:00 AM -03 on January 16, 2018","civil": "12:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "68", "metric": "20"},
"dewpoint": {"english": "61", "metric": "16"},
"condition": "Clear",
"icon": "clear",
"icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
"fctcode": "1",
"sky": "21",
"wspd": {"english": "7", "metric": "11"},
"wdir": {"dir": "N", "degrees": "349"},
"wx": "Mostly Clear",
"uvi": "0",
"humidity": "77",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "68", "metric": "20"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "1",
"mslp": {"english": "29.92", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "1","hour_padded": "01","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516075200","pretty": "1:00 AM -03 on January 16, 2018","civil": "1:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "67", "metric": "19"},
"dewpoint": {"english": "59", "metric": "15"},
"condition": "Clear",
"icon": "clear",
"icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
"fctcode": "1",
"sky": "16",
"wspd": {"english": "5", "metric": "8"},
"wdir": {"dir": "NNW", "degrees": "347"},
"wx": "Clear",
"uvi": "0",
"humidity": "76",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "67", "metric": "19"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "1",
"mslp": {"english": "29.92", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "4","hour_padded": "04","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516086000","pretty": "4:00 AM -03 on January 16, 2018","civil": "4:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "65", "metric": "18"},
"dewpoint": {"english": "57", "metric": "14"},
"condition": "Clear",
"icon": "clear",
"icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
"fctcode": "1",
"sky": "3",
"wspd": {"english": "5", "metric": "8"},
"wdir": {"dir": "N", "degrees": "350"},
"wx": "Clear",
"uvi": "0",
"humidity": "76",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "65", "metric": "18"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "2",
"mslp": {"english": "29.91", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "5","hour_padded": "05","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516089600","pretty": "5:00 AM -03 on January 16, 2018","civil": "5:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "64", "metric": "18"},
"dewpoint": {"english": "56", "metric": "13"},
"condition": "Clear",
"icon": "clear",
"icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
"fctcode": "1",
"sky": "4",
"wspd": {"english": "5", "metric": "8"},
"wdir": {"dir": "NNW", "degrees": "342"},
"wx": "Clear",
"uvi": "0",
"humidity": "75",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "64", "metric": "18"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "2",
"mslp": {"english": "29.91", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "16","hour_padded": "16","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516129200","pretty": "4:00 PM -03 on January 16, 2018","civil": "4:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "86", "metric": "30"},
"dewpoint": {"english": "57", "metric": "14"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "32",
"wspd": {"english": "11", "metric": "18"},
"wdir": {"dir": "NE", "degrees": "47"},
"wx": "Partly Cloudy",
"uvi": "8",
"humidity": "37",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "85", "metric": "29"},
"feelslike": {"english": "85", "metric": "29"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "0",
"mslp": {"english": "29.83", "metric": "1010"}
}
,
{
"FCTTIME": {
"hour": "17","hour_padded": "17","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516132800","pretty": "5:00 PM -03 on January 16, 2018","civil": "5:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "86", "metric": "30"},
"dewpoint": {"english": "56", "metric": "13"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "42",
"wspd": {"english": "12", "metric": "19"},
"wdir": {"dir": "NE", "degrees": "45"},
"wx": "Partly Cloudy",
"uvi": "5",
"humidity": "36",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "85", "metric": "29"},
"feelslike": {"english": "85", "metric": "29"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "0",
"mslp": {"english": "29.8", "metric": "1009"}
}
,
{
"FCTTIME": {
"hour": "18","hour_padded": "18","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516136400","pretty": "6:00 PM -03 on January 16, 2018","civil": "6:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "86", "metric": "30"},
"dewpoint": {"english": "57", "metric": "14"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "49",
"wspd": {"english": "11", "metric": "18"},
"wdir": {"dir": "NE", "degrees": "47"},
"wx": "Partly Cloudy",
"uvi": "2",
"humidity": "38",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "85", "metric": "29"},
"feelslike": {"english": "85", "metric": "29"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "0",
"mslp": {"english": "29.8", "metric": "1009"}
}
,
{
"FCTTIME": {
"hour": "19","hour_padded": "19","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516140000","pretty": "7:00 PM -03 on January 16, 2018","civil": "7:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "84", "metric": "29"},
"dewpoint": {"english": "57", "metric": "14"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "52",
"wspd": {"english": "11", "metric": "18"},
"wdir": {"dir": "NE", "degrees": "53"},
"wx": "Partly Cloudy",
"uvi": "1",
"humidity": "40",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "83", "metric": "29"},
"feelslike": {"english": "83", "metric": "29"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "0",
"mslp": {"english": "29.8", "metric": "1009"}
}
,
{
"FCTTIME": {
"hour": "20","hour_padded": "20","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516143600","pretty": "8:00 PM -03 on January 16, 2018","civil": "8:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "80", "metric": "27"},
"dewpoint": {"english": "59", "metric": "15"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "54",
"wspd": {"english": "9", "metric": "14"},
"wdir": {"dir": "NE", "degrees": "54"},
"wx": "Partly Cloudy",
"uvi": "0",
"humidity": "48",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "81", "metric": "27"},
"feelslike": {"english": "80", "metric": "27"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "0",
"mslp": {"english": "29.82", "metric": "1010"}
}
,
{
"FCTTIME": {
"hour": "21","hour_padded": "21","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516147200","pretty": "9:00 PM -03 on January 16, 2018","civil": "9:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "76", "metric": "24"},
"dewpoint": {"english": "59", "metric": "15"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"fctcode": "2",
"sky": "54",
"wspd": {"english": "6", "metric": "10"},
"wdir": {"dir": "NE", "degrees": "46"},
"wx": "Partly Cloudy",
"uvi": "0",
"humidity": "56",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "76", "metric": "24"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "2",
"mslp": {"english": "29.85", "metric": "1011"}
}
,
{
"FCTTIME": {
"hour": "22","hour_padded": "22","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516150800","pretty": "10:00 PM -03 on January 16, 2018","civil": "10:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "73", "metric": "23"},
"dewpoint": {"english": "59", "metric": "15"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"fctcode": "2",
"sky": "50",
"wspd": {"english": "4", "metric": "6"},
"wdir": {"dir": "N", "degrees": "8"},
"wx": "Partly Cloudy",
"uvi": "0",
"humidity": "63",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "73", "metric": "23"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "3",
"mslp": {"english": "29.87", "metric": "1012"}
}
,
{
"FCTTIME": {
"hour": "23","hour_padded": "23","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "16","mday_padded": "16","yday": "15","isdst": "0","epoch": "1516154400","pretty": "11:00 PM -03 on January 16, 2018","civil": "11:00 PM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "71", "metric": "22"},
"dewpoint": {"english": "60", "metric": "16"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"fctcode": "2",
"sky": "45",
"wspd": {"english": "5", "metric": "8"},
"wdir": {"dir": "NW", "degrees": "310"},
"wx": "Partly Cloudy",
"uvi": "0",
"humidity": "68",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "71", "metric": "22"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "4",
"mslp": {"english": "29.9", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "0","hour_padded": "00","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "17","mday_padded": "17","yday": "16","isdst": "0","epoch": "1516158000","pretty": "12:00 AM -03 on January 17, 2018","civil": "12:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "70", "metric": "21"},
"dewpoint": {"english": "61", "metric": "16"},
"condition": "Partly Cloudy",
"icon": "partlycloudy",
"icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
"fctcode": "2",
"sky": "48",
"wspd": {"english": "6", "metric": "10"},
"wdir": {"dir": "W", "degrees": "267"},
"wx": "Partly Cloudy",
"uvi": "0",
"humidity": "74",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "70", "metric": "21"},
"qpf": {"english": "0.0", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "12",
"mslp": {"english": "29.92", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "1","hour_padded": "01","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "17","mday_padded": "17","yday": "16","isdst": "0","epoch": "1516161600","pretty": "1:00 AM -03 on January 17, 2018","civil": "1:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "69", "metric": "21"},
"dewpoint": {"english": "61", "metric": "16"},
"condition": "Chance of Rain",
"icon": "chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",
"fctcode": "12",
"sky": "47",
"wspd": {"english": "6", "metric": "10"},
"wdir": {"dir": "W", "degrees": "275"},
"wx": "Few Showers",
"uvi": "0",
"humidity": "77",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "69", "metric": "21"},
"qpf": {"english": "0.01", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "32",
"mslp": {"english": "29.91", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "2","hour_padded": "02","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "17","mday_padded": "17","yday": "16","isdst": "0","epoch": "1516165200","pretty": "2:00 AM -03 on January 17, 2018","civil": "2:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "68", "metric": "20"},
"dewpoint": {"english": "61", "metric": "16"},
"condition": "Chance of Rain",
"icon": "chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",
"fctcode": "12",
"sky": "54",
"wspd": {"english": "6", "metric": "10"},
"wdir": {"dir": "WSW", "degrees": "254"},
"wx": "Showers",
"uvi": "0",
"humidity": "79",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "68", "metric": "20"},
"qpf": {"english": "0.02", "metric": "1"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "40",
"mslp": {"english": "29.9", "metric": "1013"}
}
,
{
"FCTTIME": {
"hour": "3","hour_padded": "03","min": "00","min_unpadded": "0","sec": "0","year": "2018","mon": "1","mon_padded": "01","mon_abbrev": "Jan","mday": "17","mday_padded": "17","yday": "16","isdst": "0","epoch": "1516168800","pretty": "3:00 AM -03 on January 17, 2018","civil": "3:00 AM","month_name": "January","month_name_abbrev": "Jan","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "68", "metric": "20"},
"dewpoint": {"english": "61", "metric": "16"},
"condition": "Chance of Rain",
"icon": "chancerain",
"icon_url":"http://icons.wxug.com/i/c/k/nt_chancerain.gif",
"fctcode": "12",
"sky": "60",
"wspd": {"english": "6", "metric": "10"},
"wdir": {"dir": "WSW", "degrees": "253"},
"wx": "Showers",
"uvi": "0",
"humidity": "79",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "-9999", "metric": "-9999"},
"feelslike": {"english": "68", "metric": "20"},
"qpf": {"english": "0.01", "metric": "0"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "39",
"mslp": {"english": "29.88", "metric": "1012"}
}
]
}
The first thing I recommend is to generate a C# class using your JSON. You can generate it in quicktype.io . With this application the generated class is as follows:
As you can see, it generates some methods to convert a string with a JSON to an object, so with your code it would look like this
Make the necessary adaptations such as
namespace
, do theusing
etc.Simply use Json.NET:
PS: Check the case of attribute names.