根据城市名称查询未来每3小时预报,天气预报接口实现分享。
接口名称:天气预报接口
接口平台:聚合数据
接口地址:http://v.juhe.cn/weather/forecast3h
支持格式:JSON/XML
请求方式:HTTP POST/GET
请求示例:http://v.juhe.cn/weather/forecast3h.php?cityname=%E4%B8%8A%E6%B5%B7&key=申请的KEY
天气预报接口JSON返回示例:
{
"resultcode": "200",
"reason": "successed",
"result": [
{
"weatherid": "00",/*天气标识ID*/
"weather": "晴", /*天气*/
"temp1": "27", /*低温*/
"temp2": "31", /*高温*/
"sh": "08", /*开始小时*/
"eh": "11", /*结束小时*/
"date": "20140530", /*日期*/
"sfdate": "20140530080000", /*完整开始时间*/
"efdate": "20140530110000" /*完整结束时间*/
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "31",
"temp2": "33",
"sh": "11",
"eh": "02",
"date": "20140530",
"sfdate": "20140530110000",
"efdate": "20140530140000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "33",
"temp2": "30",
"sh": "02",
"eh": "05",
"date": "20140530",
"sfdate": "20140530140000",
"efdate": "20140530170000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "30",
"temp2": "25",
"sh": "05",
"eh": "08",
"date": "20140530",
"sfdate": "20140530170000",
"efdate": "20140530200000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "25",
"temp2": "24",
"sh": "08",
"eh": "11",
"date": "20140530",
"sfdate": "20140530200000",
"efdate": "20140530230000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "24",
"temp2": "23",
"sh": "11",
"eh": "02",
"date": "20140530",
"sfdate": "20140530230000",
"efdate": "20140531020000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "23",
"temp2": "22",
"sh": "02",
"eh": "05",
"date": "20140531",
"sfdate": "20140531020000",
"efdate": "20140531050000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "22",
"temp2": "24",
"sh": "05",
"eh": "08",
"date": "20140531",
"sfdate": "20140531050000",
"efdate": "20140531080000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "24",
"temp2": "28",
"sh": "08",
"eh": "11",
"date": "20140531",
"sfdate": "20140531080000",
"efdate": "20140531110000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "28",
"temp2": "29",
"sh": "11",
"eh": "02",
"date": "20140531",
"sfdate": "20140531110000",
"efdate": "20140531140000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "29",
"temp2": "27",
"sh": "02",
"eh": "05",
"date": "20140531",
"sfdate": "20140531140000",
"efdate": "20140531170000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "27",
"temp2": "25",
"sh": "05",
"eh": "08",
"date": "20140531",
"sfdate": "20140531170000",
"efdate": "20140531200000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "25",
"temp2": "24",
"sh": "08",
"eh": "11",
"date": "20140531",
"sfdate": "20140531200000",
"efdate": "20140531230000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "24",
"temp2": "24",
"sh": "11",
"eh": "02",
"date": "20140531",
"sfdate": "20140531230000",
"efdate": "20140601020000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "24",
"temp2": "23",
"sh": "02",
"eh": "05",
"date": "20140601",
"sfdate": "20140601020000",
"efdate": "20140601050000"
},
{
"weatherid": "08",
"weather": "中雨",
"temp1": "23",
"temp2": "24",
"sh": "05",
"eh": "08",
"date": "20140601",
"sfdate": "20140601050000",
"efdate": "20140601080000"
},
{
"weatherid": "08",
"weather": "中雨",
"temp1": "24",
"temp2": "26",
"sh": "08",
"eh": "11",
"date": "20140601",
"sfdate": "20140601080000",
"efdate": "20140601110000"
},
{
"weatherid": "09",
"weather": "大雨",
"temp1": "26",
"temp2": "26",
"sh": "11",
"eh": "02",
"date": "20140601",
"sfdate": "20140601110000",
"efdate": "20140601140000"
},
{
"weatherid": "09",
"weather": "大雨",
"temp1": "26",
"temp2": "26",
"sh": "02",
"eh": "05",
"date": "20140601",
"sfdate": "20140601140000",
"efdate": "20140601170000"
},
{
"weatherid": "10",
"weather": "暴雨",
"temp1": "26",
"temp2": "25",
"sh": "05",
"eh": "08",
"date": "20140601",
"sfdate": "20140601170000",
"efdate": "20140601200000"
},
{
"weatherid": "10",
"weather": "暴雨",
"temp1": "25",
"temp2": "26",
"sh": "08",
"eh": "11",
"date": "20140601",
"sfdate": "20140601200000",
"efdate": "20140601230000"
},
{
"weatherid": "10",
"weather": "暴雨",
"temp1": "26",
"temp2": "26",
"sh": "11",
"eh": "02",
"date": "20140601",
"sfdate": "20140601230000",
"efdate": "20140602020000"
},
{
"weatherid": "10",
"weather": "暴雨",
"temp1": "26",
"temp2": "26",
"sh": "02",
"eh": "05",
"date": "20140602",
"sfdate": "20140602020000",
"efdate": "20140602050000"
},
{
"weatherid": "08",
"weather": "中雨",
"temp1": "26",
"temp2": "26",
"sh": "05",
"eh": "08",
"date": "20140602",
"sfdate": "20140602050000",
"efdate": "20140602080000"
},
{
"weatherid": "08",
"weather": "中雨",
"temp1": "26",
"temp2": "28",
"sh": "08",
"eh": "02",
"date": "20140602",
"sfdate": "20140602080000",
"efdate": "20140602140000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "28",
"temp2": "26",
"sh": "02",
"eh": "08",
"date": "20140602",
"sfdate": "20140602140000",
"efdate": "20140602200000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "26",
"temp2": "23",
"sh": "08",
"eh": "02",
"date": "20140602",
"sfdate": "20140602200000",
"efdate": "20140603020000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "23",
"temp2": "23",
"sh": "02",
"eh": "08",
"date": "20140603",
"sfdate": "20140603020000",
"efdate": "20140603080000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "23",
"temp2": "26",
"sh": "08",
"eh": "02",
"date": "20140603",
"sfdate": "20140603080000",
"efdate": "20140603140000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "26",
"temp2": "24",
"sh": "02",
"eh": "08",
"date": "20140603",
"sfdate": "20140603140000",
"efdate": "20140603200000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "24",
"temp2": "22",
"sh": "08",
"eh": "02",
"date": "20140603",
"sfdate": "20140603200000",
"efdate": "20140604020000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "22",
"temp2": "23",
"sh": "02",
"eh": "08",
"date": "20140604",
"sfdate": "20140604020000",
"efdate": "20140604080000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "23",
"temp2": "26",
"sh": "08",
"eh": "02",
"date": "20140604",
"sfdate": "20140604080000",
"efdate": "20140604140000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "26",
"temp2": "23",
"sh": "02",
"eh": "08",
"date": "20140604",
"sfdate": "20140604140000",
"efdate": "20140604200000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "23",
"temp2": "22",
"sh": "08",
"eh": "02",
"date": "20140604",
"sfdate": "20140604200000",
"efdate": "20140605020000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "22",
"temp2": "24",
"sh": "02",
"eh": "08",
"date": "20140605",
"sfdate": "20140605020000",
"efdate": "20140605080000"
},
{
"weatherid": "07",
"weather": "小雨",
"temp1": "24",
"temp2": "27",
"sh": "08",
"eh": "02",
"date": "20140605",
"sfdate": "20140605080000",
"efdate": "20140605140000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "27",
"temp2": "24",
"sh": "02",
"eh": "08",
"date": "20140605",
"sfdate": "20140605140000",
"efdate": "20140605200000"
},
{
"weatherid": "02",
"weather": "阴",
"temp1": "24",
"temp2": "22",
"sh": "08",
"eh": "02",
"date": "20140605",
"sfdate": "20140605200000",
"efdate": "20140606020000"
},
{
"weatherid": "01",
"weather": "多云",
"temp1": "22",
"temp2": "25",
"sh": "02",
"eh": "08",
"date": "20140606",
"sfdate": "20140606020000",
"efdate": "20140606080000"
}
],
"error_code": 0 /*返回码*/
}