7*24小時天氣預報api

24小時天氣預報api提供數據氣象方面,包括天氣預報和空氣質量預報的精細化的服務php

根據輸入區號查詢實況天氣數據

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

支持格式:jsonapi

請求方式:get編碼

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

接口備註:根據輸入區號查詢實況天氣數據code

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.phpget

支持格式:jsonpm2

請求方式:getclass

請求示例: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
}
相關文章
相關標籤/搜索