7*24小时天气预报api

24小时天气预报api提供数据气象方面,包括天气预报和空气质量预报的精细化的服务

根据输入区号查询实况天气数据

接口地址:http://v.juhe.cn/xiangji_weather/real_time_weather.php

支持格式:json

请求方式:get

请求示例:http://v.juhe.cn/xiangji_weather/real_time_weather.php?areaid=101010100&key=YOURKEY

接口备注:根据输入区号查询实况天气数据

JSON返回示例:

{
    "reason": "success",
    "result": {
        "pubTime": "20160115172532",//发布时间(yyyyMMddHHmmss) 
  
        "reqTime": "20160115173718",//收到请求时间(yyyyMMddHHmmss) 
   
        "data": {
            "cw": "01",//天气现象编码
            "w": "多云",//天气现象
            "rh": 55,//相对湿度
            "cwd": "东风",//风向描述
            "wd": "2 级",//风力描述
            "wdg": 2,//风力级别
            "tmp": 3,//温度
            "airp": 1015,//气压
            "st": 3//体感温度
        }
    },
    "error_code": 0
}

逐小时预报天气数据

接口地址:http://v.juhe.cn/xiangji_weather/weather_byHour_areaid.php

支持格式:json

请求方式:get

请求示例:http://v.juhe.cn/xiangji_weather/weather_byHour_areaid.php?areaid=101010100&startTime=2016011501&endTime=2016011714&key=YOURKEY

接口备注:根据输入区号和起始时间查询逐小时预报天气数据

JSON返回示例:

{
    "reason": "success",
    "result": {
        "startTime": "2016011513",//开始时间(yyyyMMddHH),对应series中第一条数据
        "pubTime": "20160115175358",//发布时间(yyyyMMddHHmmss) 
        
         reqTime:"20150831171212",//收到请求时间(yyyyMMddHHmmss) 
  
        "series": [//逐小时数据序列,每个小时一个值,第一条对应starttime 
  
            {
                "cw": "01",//天气现象编码
                "w": "多云",//天气现象
                "rh": 30,//相对湿度
                "cwd": "07",//风向编码
                "wd": "东风",//风向描述
                "wdg": 0,//风力级别
                "tmp": 3,//预测温度
                "airp": 1019,//气压
                "st": -4//体感温度
            },
            {
                "cw": "01",
                "w": "多云",
                "rh": 30,
                "cwd": "07",
                "wd": "东风",
                "wdg": 0,
                "tmp": 4,
                "airp": 1019,
                "st": -4
            }
        ],
        "count": 2,//数据条数,endTime-­‐startTime+1的小时数
        "endTime": "2016011514"//结束时间,对应series中最后一条数据 
  
    },
    "error_code": 0
}

15天概览天气预报数据

接口地址:http://v.juhe.cn/xiangji_weather/15_area.php

支持格式:json

请求方式:get

请求示例:http://v.juhe.cn/xiangji_weather/15_area.php?areaid=101010100&startTime=20160116&endTime=20160201&key=YOURKEY

接口备注:根据输入地区编码查询15天概览天气预报数据,发布频率每日一次,北京时间点,空间范围:全国 空间分辨率 公里级别 时间范围 当天点-点:未来14 天(含今天) 当天点-23 点:未来15 天(含今天) 时间分辨率 逐日级别

JSON返回示例:

{
    "reason": "success",
    "result": {
        "pubTime": "20160116223359",
        "startTime": "20160116",
        "series": [
            {
                "cw_am": "02",//天气现象编码上午
                "w_am": "阴",//天气现象上午
                "cw_pm": "15",//天气现象编码下午
                "w_pm": "中雪",//天气现象下午
                "wd": "东北风",//风向描述
                "wind": "3 级",//风力
                "cwd": "06",//风向编码
                "tmp_max": -1,//预测最高温度
                "tmp_min": -5,//预测最低温度
                "sunrise": "07:34",//日出时间
                "sunset": "17:14"//日落时间
            },
            {
                "cw_am": "14",
                "w_am": "小雪",
                "cw_pm": "01",
                "w_pm": "多云",
                "wd": "东北风",
                "wind": "3 级",
                "cwd": "06",
                "tmp_max": -2,
                "tmp_min": -7,
                "sunrise": "07:34",
                "sunset": "17:15"
            },
            {
                "cw_am": "00",
                "w_am": "晴",
                "cw_pm": "00",
                "w_pm": "晴",
                "wd": "东北风",
                "wind": "微风",
                "cwd": "06",
                "tmp_max": -3,
                "tmp_min": -9,
                "sunrise": "07:33",
                "sunset": "17:17"
            },
            {
                "cw_am": "00",
                "w_am": "晴",
                "cw_pm": "00",
                "w_pm": "晴",
                "wd": "北风",
                "wind": "4 级",
                "cwd": "05",
                "tmp_max": 0,
                "tmp_min": -10,
                "sunrise": "07:33",
                "sunset": "17:18"
            },
            {
                "cw_am": "01",
                "w_am": "多云",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "西北风",
                "wind": "5 级",
                "cwd": "04",
                "tmp_max": -1,
                "tmp_min": -7,
                "sunrise": "07:32",
                "sunset": "17:19"
            },
            {
                "cw_am": "02",
                "w_am": "阴",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "东北风",
                "wind": "4 级",
                "cwd": "06",
                "tmp_max": -3,
                "tmp_min": -6,
                "sunrise": "07:32",
                "sunset": "17:20"
            },
            {
                "cw_am": "02",
                "w_am": "阴",
                "cw_pm": "00",
                "w_pm": "晴",
                "wd": "北风",
                "wind": "3 级",
                "cwd": "05",
                "tmp_max": -5,
                "tmp_min": -9,
                "sunrise": "07:31",
                "sunset": "17:21"
            },
            {
                "cw_am": "01",
                "w_am": "多云",
                "cw_pm": "01",
                "w_pm": "多云",
                "wd": "东北风",
                "wind": "微风",
                "cwd": "06",
                "tmp_max": -10,
                "tmp_min": -15,
                "sunrise": "07:31",
                "sunset": "17:22"
            },
            {
                "cw_am": "01",
                "w_am": "多云",
                "cw_pm": "01",
                "w_pm": "多云",
                "wd": "东北风",
                "wind": "3 级",
                "cwd": "06",
                "tmp_max": -4,
                "tmp_min": -14,
                "sunrise": "07:30",
                "sunset": "17:23"
            },
            {
                "cw_am": "00",
                "w_am": "晴",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "西北风",
                "wind": "5 级",
                "cwd": "04",
                "tmp_max": -1,
                "tmp_min": -10,
                "sunrise": "07:29",
                "sunset": "17:25"
            },
            {
                "cw_am": "01",
                "w_am": "多云",
                "cw_pm": "00",
                "w_pm": "晴",
                "wd": "西风",
                "wind": "微风",
                "cwd": "03",
                "tmp_max": 2,
                "tmp_min": -8,
                "sunrise": "07:28",
                "sunset": "17:26"
            },
            {
                "cw_am": "01",
                "w_am": "多云",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "西风",
                "wind": "微风",
                "cwd": "03",
                "tmp_max": 2,
                "tmp_min": -7,
                "sunrise": "07:28",
                "sunset": "17:27"
            },
            {
                "cw_am": "02",
                "w_am": "阴",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "北风",
                "wind": "微风",
                "cwd": "05",
                "tmp_max": 4,
                "tmp_min": -6,
                "sunrise": "07:27",
                "sunset": "17:28"
            },
            {
                "cw_am": "02",
                "w_am": "阴",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "东北风",
                "wind": "微风",
                "cwd": "06",
                "tmp_max": 4,
                "tmp_min": -6,
                "sunrise": "07:26",
                "sunset": "17:29"
            },
            {
                "cw_am": "02",
                "w_am": "阴",
                "cw_pm": "02",
                "w_pm": "阴",
                "wd": "北风",
                "wind": "3 级",
                "cwd": "05",
                "tmp_max": 5,
                "tmp_min": -4,
                "sunrise": "07:25",
                "sunset": "17:31"
            }
        ],
        "count": 15,
        "endTime": "20160130"
    },
    "error_code": 0
}

城市实况指数数据

接口地址:http://v.juhe.cn/xiangji_weather/exponential_byAreaId.php

支持格式:json

请求方式:get

请求示例:http://v.juhe.cn/xiangji_weather/exponential_byAreaId.php?areaid=101010100&key=YOURKEY

接口备注:根据输入地区编码查询城市实况指数数据

JSON返回示例:

{
    "reason": "success",
    "result": {
        "pubTime": "20160116000000",
        "reqTime": "20160116225821",
        "data": [
            {
                "i5": "风力稍大,较不宜晨练,室外锻炼请注意选择避风的地点,避免迎风锻炼。",//提醒内容
                "i4": "较不宜",//级别
                "i3": "",//别称
                "i2": "晨练指数",//穿衣指数
                "i1": "cl"//英文简称
            },
            {
                "i5": "天气寒冷,建议着厚羽绒服、毛皮大衣加厚毛衣等隆冬服装。年老体弱者尤其要注意保暖防冻。",
                "i4": "寒冷",
                "i3": "",
                "i2": "穿衣指数",
                "i1": "ct"
            },
            {
                "i5": "天气寒冷,请用滋润保湿型化妆品,少扑粉,使用润唇膏后再抹口红。",
                "i4": "保湿",
                "i3": "",
                "i2": "化妆指数",
                "i1": "pp"
            },
            {
                "i5": "天空状况还是比较好的,但温度比较低,且风稍大,会让人感觉有点冷。外出请备上防风保暖衣物。",
                "i4": "一般",
                "i3": "",
                "i2": "旅游指数",
                "i1": "tr"
            },
            {
                "i5": "不宜洗车,未来24小时内有雪,如果在此期间洗车,雪水和路上的泥水可能会再次弄脏您的爱车。",
                "i4": "不宜",
                "i3": "",
                "i2": "洗车指数",
                "i1": "xc"
            },
            {
                "i5": "温度不高,其他各项气象条件适宜,中暑机率极低。",
                "i4": "无",
                "i3": "",
                "i2": "中暑指数",
                "i1": "zs"
            }
        ]
    },
    "error_code": 0
}

实况空气质量数据

接口地址:http://v.juhe.cn/xiangji_weather/live_air.php

支持格式:json

请求方式:get

请求示例:http://v.juhe.cn/xiangji_weather/live_air.php?key=YOURKEY

接口备注:返回所有地区空气质量最近一次观测值

JSON返回示例:

{
    "reason": "success",
    "result": {
        "count": 2504,
        "kdatalistey": [
            {
                "areaid": "101010100",
                "uptime": "20160116230000",
                "so2": 36,//二氧化硫
                "co": 2.24,//一氧化碳
                "no2": 70,//二氧化碳
                "o3": 11,//臭氧
                "p10": 166,//pm10
                "p25": 139//pm2.5
            },
            {
                "areaid": "101290312",
                "uptime": "20160116230000",
                "so2": 12,
                "co": 1.16,
                "no2": 25,
                "o3": 83,
                "p10": 50,
                "p25": 41
            }
        ]
    },
    "error_code": 0
}


你可能感兴趣的:(天气预报,天气API,空气质量)