国家气象局提供的天气预报接口

 接口地址:

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

 

对于第三个接口,返回信息比较全面,也是以json格式提供,格式如下

{"weatherinfo": {
//基本信息;
"city":"北京","city_en":"beijing",
"date_y":"2012年2月16日", "date":"", "week":"星期四", "fchh":"11", "cityid":"101010100",
//摄氏温度
"temp1":"2℃~-7℃",
"temp2":"1℃~-7℃",
"temp3":"4℃~-7℃",
"temp4":"7℃~-5℃",
"temp5":"5℃~-3℃",
"temp6":"5℃~-2℃",
//华氏温度;
"tempF1":"35.6�H~19.4�H",
"tempF2":"33.8�H~19.4�H",
"tempF3":"39.2�H~19.4�H",
"tempF4":"44.6�H~23�H",
"tempF5":"41�H~26.6�H",
"tempF6":"41�H~28.4�H",
//天气描述;
"weather1":"晴",
"weather2":"晴",
"weather3":"晴",
"weather4":"晴转多云",
"weather5":"多云",
"weather6":"多云转阴",
//天气描述图片序号
"img1":"0",
"img2":"99",
"img3":"0",
"img4":"99",
"img5":"0",
"img6":"99",
"img7":"0",
"img8":"1",
"img9":"1",
"img10":"99",
"img11":"1",
"img12":"2",
"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":"北风3-4级转微风",
"wind2":"微风",
"wind3":"微风",
"wind4":"微风",
"wind5":"微风",
"wind6":"微风",
//风速级别描述
"fx1":"北风",
"fx2":"微风",
"fl1":"3-4级转小于3级",
"fl2":"小于3级",
"fl3":"小于3级",
"fl4":"小于3级",
"fl5":"小于3级",
"fl6":"小于3级",
//今天穿衣指数;
"index":"冷",
"index_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",
//48小时穿衣指数
"index48":"冷",
"index48_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",
//紫外线及48小时紫外线
"index_uv":"弱",
"index48_uv":"弱",
//洗车
"index_xc":"适宜",
//旅游
"index_tr":"一般",
//舒适指数
"index_co":"较不舒适",


"st1":"1",
"st2":"-8",
"st3":"2",
"st4":"-4",
"st5":"5",
"st6":"-5",
//晨练
"index_cl":"较不宜",
//晾晒
"index_ls":"基本适宜",
//过敏
"index_ag":"极不易发"}}


全车各城市代码如下:

101010100=北京
101010200=海淀
101010300=朝阳
101010400=顺义
101010500=怀柔
101010600=通州
101010700=昌平
101010800=延庆
101010900=丰台
101011000=石景山
101011100=大兴
101011200=房山
101011300=密云
101011400=门头沟
101011500=平谷
101011600=八达岭
101011700=佛爷顶
101011800=汤河口
101011900=密云上甸子
101012000=斋堂
101012100=霞云岭
 
 
101020100=上海
101020200=闵行
101020300=宝山
101020400=川沙
101020500=嘉定
101020600=南汇
101020700=金山
101020800=青浦
101020900=松江
101021000=奉贤
101021100=崇明
101021101=陈家镇
101021102=引水船
101021200=徐家汇
101021300=浦东
 
 
101030100=天津
101030200=武清
101030300=宝坻
101030400=东丽
101030500=西青
101030600=北辰
101030700=宁河
101030800=汉沽
101030900=静海
101031000=津南
101031100=塘沽
101031200=大港
101031300=平台
101031400=蓟县

你可能感兴趣的:(天气预报,接口,气象局)