Hi, trying to create a weather app with APIXU json data and whilst the site gives very good examples of how to enter the http to retrieve the information I cannot get my head around how to action the http and then use the resulting JSON data it returns
So the call would be
http://api.apixu.com/v1/forecast.json?key=< My Key >&q=rhyl&days=10
and it returns, the data below but how would I use this data to create the ten days of data in returns, any idea's would be greatly appreciated but please remember I am very new to this and would need a lot of hand holding
Response Code
200
Response Headers
{
"access-control-allow-origin": "*",
"access-control-allow-headers": "content-type",
"Vary": "Accept-Encoding",
"Age": "0",
"Connection": "keep-alive",
"Accept-Ranges": "bytes",
"Content-Length": "4145",
"Cache-Control": "private",
"Content-Type": "application/json; charset=utf-8",
"Date": "Tue, 22 May 2018 16:49:11 GMT",
"Via": "WebCelerate"
}
Response Body
{
"location": {
"name": "Rhyl",
"region": "Denbighshire",
"country": "United Kingdom",
"lat": 53.32,
"lon": -3.48,
"tz_id": "Europe/London",
"localtime_epoch": 1527007751,
"localtime": "2018-05-22 17:49"
},
"current": {
"last_updated_epoch": 1527007519,
"last_updated": "2018-05-22 17:45",
"temp_c": 19.0,
"temp_f": 66.2,
"is_day": 1,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"wind_mph": 13.6,
"wind_kph": 22.0,
"wind_degree": 310,
"wind_dir": "NW",
"pressure_mb": 1021.0,
"pressure_in": 30.6,
"precip_mm": 0.0,
"precip_in": 0.0,
"humidity": 60,
"cloud": 25,
"feelslike_c": 19.0,
"feelslike_f": 66.2,
"vis_km": 10.0,
"vis_miles": 6.0
},
"forecast": {
"forecastday": [
{
"date": "2018-05-22",
"date_epoch": 1526947200,
"day": {
"maxtemp_c": 15.2,
"maxtemp_f": 59.4,
"mintemp_c": 10.4,
"mintemp_f": 50.7,
"avgtemp_c": 12.3,
"avgtemp_f": 54.1,
"maxwind_mph": 10.1,
"maxwind_kph": 16.2,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 18.2,
"avgvis_miles": 11.0,
"avghumidity": 86.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.1
},
"astro": {
"sunrise": "05:04 AM",
"sunset": "09:18 PM",
"moonrise": "12:43 PM",
"moonset": "02:38 AM"
}
},
{
"date": "2018-05-23",
"date_epoch": 1527033600,
"day": {
"maxtemp_c": 18.1,
"maxtemp_f": 64.6,
"mintemp_c": 11.0,
"mintemp_f": 51.8,
"avgtemp_c": 14.3,
"avgtemp_f": 57.7,
"maxwind_mph": 8.1,
"maxwind_kph": 13.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 19.8,
"avgvis_miles": 12.0,
"avghumidity": 77.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.5
},
"astro": {
"sunrise": "05:03 AM",
"sunset": "09:20 PM",
"moonrise": "02:01 PM",
"moonset": "03:05 AM"
}
},
{
"date": "2018-05-24",
"date_epoch": 1527120000,
"day": {
"maxtemp_c": 17.1,
"maxtemp_f": 62.8,
"mintemp_c": 10.1,
"mintemp_f": 50.2,
"avgtemp_c": 14.3,
"avgtemp_f": 57.8,
"maxwind_mph": 11.2,
"maxwind_kph": 18.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 17.3,
"avgvis_miles": 10.0,
"avghumidity": 76.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.0
},
"astro": {
"sunrise": "05:01 AM",
"sunset": "09:21 PM",
"moonrise": "03:16 PM",
"moonset": "03:28 AM"
}
},
{
"date": "2018-05-25",
"date_epoch": 1527206400,
"day": {
"maxtemp_c": 17.5,
"maxtemp_f": 63.5,
"mintemp_c": 10.2,
"mintemp_f": 50.4,
"avgtemp_c": 14.0,
"avgtemp_f": 57.1,
"maxwind_mph": 14.3,
"maxwind_kph": 23.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 15.6,
"avgvis_miles": 9.0,
"avghumidity": 75.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 5.9
},
"astro": {
"sunrise": "05:00 AM",
"sunset": "09:23 PM",
"moonrise": "04:30 PM",
"moonset": "03:49 AM"
}
},
{
"date": "2018-05-26",
"date_epoch": 1527292800,
"day": {
"maxtemp_c": 17.7,
"maxtemp_f": 63.9,
"mintemp_c": 10.1,
"mintemp_f": 50.2,
"avgtemp_c": 13.9,
"avgtemp_f": 57.0,
"maxwind_mph": 16.1,
"maxwind_kph": 25.9,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 16.7,
"avgvis_miles": 10.0,
"avghumidity": 74.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 4.5
},
"astro": {
"sunrise": "04:59 AM",
"sunset": "09:24 PM",
"moonrise": "05:43 PM",
"moonset": "04:09 AM"
}
},
{
"date": "2018-05-27",
"date_epoch": 1527379200,
"day": {
"maxtemp_c": 17.3,
"maxtemp_f": 63.1,
"mintemp_c": 12.8,
"mintemp_f": 55.0,
"avgtemp_c": 14.1,
"avgtemp_f": 57.3,
"maxwind_mph": 13.9,
"maxwind_kph": 22.3,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 14.5,
"avgvis_miles": 9.0,
"avghumidity": 81.0,
"condition": {
"text": "Overcast",
"icon": "//cdn.apixu.com/weather/64x64/day/122.png",
"code": 1009
},
"uv": 39960.0
},
"astro": {
"sunrise": "04:58 AM",
"sunset": "09:25 PM",
"moonrise": "06:54 PM",
"moonset": "04:31 AM"
}
},
{
"date": "2018-05-28",
"date_epoch": 1527465600,
"day": {
"maxtemp_c": 16.7,
"maxtemp_f": 62.1,
"mintemp_c": 13.2,
"mintemp_f": 55.8,
"avgtemp_c": 14.8,
"avgtemp_f": 58.7,
"maxwind_mph": 10.3,
"maxwind_kph": 16.6,
"totalprecip_mm": 3.4,
"totalprecip_in": 0.13,
"avgvis_km": 12.1,
"avgvis_miles": 7.0,
"avghumidity": 88.0,
"condition": {
"text": "Moderate or heavy rain shower",
"icon": "//cdn.apixu.com/weather/64x64/day/356.png",
"code": 1243
},
"uv": 39960.0
},
"astro": {
"sunrise": "04:57 AM",
"sunset": "09:27 PM",
"moonrise": "08:03 PM",
"moonset": "04:55 AM"
}
}
]
}
}
So the call would be
http://api.apixu.com/v1/forecast.json?key=< My Key >&q=rhyl&days=10
and it returns, the data below but how would I use this data to create the ten days of data in returns, any idea's would be greatly appreciated but please remember I am very new to this and would need a lot of hand holding
Response Code
200
Response Headers
{
"access-control-allow-origin": "*",
"access-control-allow-headers": "content-type",
"Vary": "Accept-Encoding",
"Age": "0",
"Connection": "keep-alive",
"Accept-Ranges": "bytes",
"Content-Length": "4145",
"Cache-Control": "private",
"Content-Type": "application/json; charset=utf-8",
"Date": "Tue, 22 May 2018 16:49:11 GMT",
"Via": "WebCelerate"
}
Response Body
{
"location": {
"name": "Rhyl",
"region": "Denbighshire",
"country": "United Kingdom",
"lat": 53.32,
"lon": -3.48,
"tz_id": "Europe/London",
"localtime_epoch": 1527007751,
"localtime": "2018-05-22 17:49"
},
"current": {
"last_updated_epoch": 1527007519,
"last_updated": "2018-05-22 17:45",
"temp_c": 19.0,
"temp_f": 66.2,
"is_day": 1,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"wind_mph": 13.6,
"wind_kph": 22.0,
"wind_degree": 310,
"wind_dir": "NW",
"pressure_mb": 1021.0,
"pressure_in": 30.6,
"precip_mm": 0.0,
"precip_in": 0.0,
"humidity": 60,
"cloud": 25,
"feelslike_c": 19.0,
"feelslike_f": 66.2,
"vis_km": 10.0,
"vis_miles": 6.0
},
"forecast": {
"forecastday": [
{
"date": "2018-05-22",
"date_epoch": 1526947200,
"day": {
"maxtemp_c": 15.2,
"maxtemp_f": 59.4,
"mintemp_c": 10.4,
"mintemp_f": 50.7,
"avgtemp_c": 12.3,
"avgtemp_f": 54.1,
"maxwind_mph": 10.1,
"maxwind_kph": 16.2,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 18.2,
"avgvis_miles": 11.0,
"avghumidity": 86.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.1
},
"astro": {
"sunrise": "05:04 AM",
"sunset": "09:18 PM",
"moonrise": "12:43 PM",
"moonset": "02:38 AM"
}
},
{
"date": "2018-05-23",
"date_epoch": 1527033600,
"day": {
"maxtemp_c": 18.1,
"maxtemp_f": 64.6,
"mintemp_c": 11.0,
"mintemp_f": 51.8,
"avgtemp_c": 14.3,
"avgtemp_f": 57.7,
"maxwind_mph": 8.1,
"maxwind_kph": 13.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 19.8,
"avgvis_miles": 12.0,
"avghumidity": 77.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.5
},
"astro": {
"sunrise": "05:03 AM",
"sunset": "09:20 PM",
"moonrise": "02:01 PM",
"moonset": "03:05 AM"
}
},
{
"date": "2018-05-24",
"date_epoch": 1527120000,
"day": {
"maxtemp_c": 17.1,
"maxtemp_f": 62.8,
"mintemp_c": 10.1,
"mintemp_f": 50.2,
"avgtemp_c": 14.3,
"avgtemp_f": 57.8,
"maxwind_mph": 11.2,
"maxwind_kph": 18.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 17.3,
"avgvis_miles": 10.0,
"avghumidity": 76.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 6.0
},
"astro": {
"sunrise": "05:01 AM",
"sunset": "09:21 PM",
"moonrise": "03:16 PM",
"moonset": "03:28 AM"
}
},
{
"date": "2018-05-25",
"date_epoch": 1527206400,
"day": {
"maxtemp_c": 17.5,
"maxtemp_f": 63.5,
"mintemp_c": 10.2,
"mintemp_f": 50.4,
"avgtemp_c": 14.0,
"avgtemp_f": 57.1,
"maxwind_mph": 14.3,
"maxwind_kph": 23.0,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 15.6,
"avgvis_miles": 9.0,
"avghumidity": 75.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 5.9
},
"astro": {
"sunrise": "05:00 AM",
"sunset": "09:23 PM",
"moonrise": "04:30 PM",
"moonset": "03:49 AM"
}
},
{
"date": "2018-05-26",
"date_epoch": 1527292800,
"day": {
"maxtemp_c": 17.7,
"maxtemp_f": 63.9,
"mintemp_c": 10.1,
"mintemp_f": 50.2,
"avgtemp_c": 13.9,
"avgtemp_f": 57.0,
"maxwind_mph": 16.1,
"maxwind_kph": 25.9,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 16.7,
"avgvis_miles": 10.0,
"avghumidity": 74.0,
"condition": {
"text": "Partly cloudy",
"icon": "//cdn.apixu.com/weather/64x64/day/116.png",
"code": 1003
},
"uv": 4.5
},
"astro": {
"sunrise": "04:59 AM",
"sunset": "09:24 PM",
"moonrise": "05:43 PM",
"moonset": "04:09 AM"
}
},
{
"date": "2018-05-27",
"date_epoch": 1527379200,
"day": {
"maxtemp_c": 17.3,
"maxtemp_f": 63.1,
"mintemp_c": 12.8,
"mintemp_f": 55.0,
"avgtemp_c": 14.1,
"avgtemp_f": 57.3,
"maxwind_mph": 13.9,
"maxwind_kph": 22.3,
"totalprecip_mm": 0.0,
"totalprecip_in": 0.0,
"avgvis_km": 14.5,
"avgvis_miles": 9.0,
"avghumidity": 81.0,
"condition": {
"text": "Overcast",
"icon": "//cdn.apixu.com/weather/64x64/day/122.png",
"code": 1009
},
"uv": 39960.0
},
"astro": {
"sunrise": "04:58 AM",
"sunset": "09:25 PM",
"moonrise": "06:54 PM",
"moonset": "04:31 AM"
}
},
{
"date": "2018-05-28",
"date_epoch": 1527465600,
"day": {
"maxtemp_c": 16.7,
"maxtemp_f": 62.1,
"mintemp_c": 13.2,
"mintemp_f": 55.8,
"avgtemp_c": 14.8,
"avgtemp_f": 58.7,
"maxwind_mph": 10.3,
"maxwind_kph": 16.6,
"totalprecip_mm": 3.4,
"totalprecip_in": 0.13,
"avgvis_km": 12.1,
"avgvis_miles": 7.0,
"avghumidity": 88.0,
"condition": {
"text": "Moderate or heavy rain shower",
"icon": "//cdn.apixu.com/weather/64x64/day/356.png",
"code": 1243
},
"uv": 39960.0
},
"astro": {
"sunrise": "04:57 AM",
"sunset": "09:27 PM",
"moonrise": "08:03 PM",
"moonset": "04:55 AM"
}
}
]
}
}