中國天氣網免費天氣預報介面API

無謂生活發表於2013-12-12

國家氣象局提供的天氣預報介面

介面地址:

實時天氣

http://www.weather.com.cn/data/sk/101010100.html

http://www.weather.com.cn/data/cityinfo/101010100.html

六天的天氣情況(含今天)

http://m.weather.com.cn/data/101010100.html


六天天氣情況的介面返回的資料如下:


{
weatherinfo: {
city: "北京",
city_en: "beijing",
date_y: "2013年12月12日",
date: "",
week: "星期四",
fchh: "11",

<!--城市ID,用於查詢-->

cityid: "101010100",

<!--今天的溫度,攝氏度-->
temp1: "3℃~-6℃",

<!--明天的溫度,以下依次類推-->
temp2: "4℃~-6℃",temp3: "7℃~-4℃",temp4: "5℃~-4℃",temp5: "4℃~-3℃",temp6: "4℃~-4℃",
<!--今天的溫度,華氏度-->
tempF1: "37.4℉~21.2℉",tempF2: "39.2℉~21.2℉",tempF3: "44.6℉~24.8℉",tempF4: "41℉~24.8℉",tempF5: "39.2℉~26.6℉",tempF6: "39.2℉~24.8℉",
<!--今天的天氣-->
weather1: "晴",weather2: "晴",weather3: "晴",weather4: "晴轉多雲",weather5: "多雲轉陰",weather6: "陰轉晴",
<!--每一天有兩個圖片,img1是天氣開始的情況,img2是天氣結束的情況 ,如果img2是99,則說明天氣無變化,不存在什麼轉什麼。比如第四天的天氣是晴轉多雲,img7是0(晴),img8是1(多雲)。-->
img1: "0",img2: "99",img3: "0",img4: "99",img5: "0",img6: "99",img7: "0",img8: "1",img9: "1",img10: "2",img11: "2",img12: "0",img_single: "0",img_title1: "晴",img_title2: "晴",img_title3: "晴",img_title4: "晴",img_title5: "晴",img_title6: "晴",img_title7: "晴",img_title8: "多雲",img_title9: "多雲",img_title10: "陰",img_title11: "陰",img_title12: "晴",img_title_single: "晴",
<!--風速描述-->
wind1: "北風4-5級轉3-4級",wind2: "微風",wind3: "微風",wind4: "微風",wind5: "微風",wind6: "微風",
<!--風速級別描述-->
fx1: "北風",
fx2: "北風",
fl1: "4-5級轉3-4級",
fl2: "小於3級",
fl3: "小於3級",
fl4: "小於3級",
fl5: "小於3級",
fl6: "小於3級",
<!--穿衣指數等-->
index: "冷",
index_d: "天氣冷,建議著棉服、羽絨服、皮夾克加羊毛衫等冬季服裝。年老體弱者宜著厚棉衣、冬大衣或厚羽絨服。",
index48: "寒冷",
index48_d: "天氣寒冷,建議著厚羽絨服、毛皮大衣加厚毛衣等隆冬服裝。年老體弱者尤其要注意保暖防凍。",
index_uv: "弱",
index48_uv: "弱",
index_xc: "較適宜",
index_tr: "一般",
index_co: "較不舒適",
st1: "1",
st2: "-7",
st3: "4",
st4: "-4",
st5: "6",
st6: "-2",
index_cl: "較不宜",
index_ls: "基本適宜",
index_ag: "極不易發"
}
}











            

相關文章