分享一個可以獲取7天24小時的天氣預報API,包含PM2.5等資料
阿新 • • 發佈:2019-01-22
api地址:
pm2.5 api
http://api.lib360.net/open/pm2.5.json?city=蘇州
7天24小時天氣api
http://api.lib360.net/open/weather.json?city=蘇州
GET請求
引數
prov 可選省份 如:江蘇 河北
city 城市名稱 如:蘇州 上海
返回資料格式json
data 欄位 返回7天的天氣狀況,包含今天
data24 返回 今天24小時內的預報
pm25 返回當前城市的 pm25 值
{ "data" : [{ "AreaID" : "101190401", //地區id "Year" : 2015, //年 "Month" : 3, //月 "Day" : 19, //日 "Weather" : "陰轉小雨", //天氣狀況 "WeatherICON" : "d02", //天氣圖示 "TempMax" : 16, //最高溫度 "TempMin" : 10, //最低溫度 "WindA" : "東北風", //風向 "WindB" : "東風",//風向 "Wind" : "微風", //風速 "Date" : "\/Date(1426694400000)\/" //時間 }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 20, "Weather" : "小雨轉多雲", "WeatherICON" : "d07", "TempMax" : 14, "TempMin" : 10, "WindA" : "東北風", "WindB" : "東風", "Wind" : "微風", "Date" : "\/Date(1426780800000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 21, "Weather" : "多雲", "WeatherICON" : "d01", "TempMax" : 19, "TempMin" : 11, "WindA" : "西風", "WindB" : "西風", "Wind" : "微風", "Date" : "\/Date(1426867200000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 22, "Weather" : "多雲", "WeatherICON" : "d01", "TempMax" : 17, "TempMin" : 9, "WindA" : "東風", "WindB" : "東風", "Wind" : "3-4級", "Date" : "\/Date(1426953600000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 23, "Weather" : "多雲轉陰", "WeatherICON" : "d01", "TempMax" : 14, "TempMin" : 8, "WindA" : "東風", "WindB" : "東風", "Wind" : "4-5級轉微風", "Date" : "\/Date(1427040000000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 24, "Weather" : "多雲", "WeatherICON" : "d01", "TempMax" : 15, "TempMin" : 6, "WindA" : "東風", "WindB" : "東風", "Wind" : "微風", "Date" : "\/Date(1427126400000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 25, "Weather" : "多雲", "WeatherICON" : "d01", "TempMax" : 15, "TempMin" : 6, "WindA" : "東風", "WindB" : "東風", "Wind" : "微風", "Date" : "\/Date(1427212800000)\/" } ], "data24" : [{ "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 19, "BeginHour" : 5, "EndHour" : 8, "Weather" : "小雨", "WeatherICON" : "d07", "TempMax" : 11, "TempMin" : 11, "Wind" : "微風", "WindD" : "東風", "Date" : "\/Date(1426694400000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 19, "BeginHour" : 8, "EndHour" : 11, "Weather" : "陰", "WeatherICON" : "d02", "TempMax" : 14, "TempMin" : 11, "Wind" : "微風", "WindD" : "東北風", "Date" : "\/Date(1426694400000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 19, "BeginHour" : 11, "EndHour" : 14, "Weather" : "多雲", "WeatherICON" : "d01", "TempMax" : 16, "TempMin" : 14, "Wind" : "微風", "WindD" : "東北風", "Date" : "\/Date(1426694400000)\/" }, { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 19, "BeginHour" : 14, "EndHour" : 17, "Weather" : "晴", "WeatherICON" : "d00", "TempMax" : 16, "TempMin" : 16, "Wind" : "微風", "WindD" : "東北風", "Date" : "\/Date(1426694400000)\/" } ], "datanow" : { "AreaID" : "101190401", "Year" : 2015, "Month" : 3, "Day" : 19, "BeginHour" : 14, "EndHour" : 17, "Weather" : "晴", "WeatherICON" : "d00", "TempMax" : 16, "TempMin" : 16, "Wind" : "微風", "WindD" : "東北風", "Date" : "\/Date(1426694400000)\/" }, "pm25" : 133 }
轉載自:http://segmentfault.com/a/1190000002607883