最近一直在做天气方面的android软件,分别从三个网站(新浪天气api,百度开放平台天气,国家气象中心)获取天气资源。发现网上前辈们提供的“国家气象局提供的天气预报接口”地址已过时。本人找了好久才找到,希望对大家有用!
国家气象局提供的天气预报接口:http://m.weather.com.cn/atad/101020100.html
{
"weatherinfo": {
"city": "上海",
"city_en": "shanghai",
"date_y": "2015年1月6日",
"date": "",
"week": "星期二",
"fchh": "08",
"cityid": "101020100",
"temp1": "8℃~3℃",
"temp2": "7℃~2℃",
"temp3": "8℃~2℃",
"temp4": "10℃~3℃",
"temp5": "11℃~4℃",
"temp6": "13℃~6℃",
"tempF1": "46.4℉~37.4℉",
"tempF2": "44.6℉~35.6℉",
"tempF3": "46.4℉~35.6℉",
"tempF4": "50℉~37.4℉",
"tempF5": "51.8℉~39.2℉",
"tempF6": "55.4℉~42.8℉",
"weather1": "小雨转雨夹雪",
"weather2": "多云转晴",
"weather3": "晴转多云",
"weather4": "多云",
"weather5": "阴转多云",
"weather6": "阴",
"img1": "7",
"img2": "6",
"img3": "1",
"img4": "0",
"img5": "0",
"img6": "1",
"img7": "1",
"img8": "99",
"img9": "2",
"img10": "1",
"img11": "2",
"img12": "99",
"img_single": "7",
"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级转小于3级",
"wind2": "西北风小于3级",
"wind3": "西北风小于3级",
"wind4": "西北风转西风小于3级",
"wind5": "西风转东风小于3级",
"wind6": "东风小于3级",
"fx1": "北风",
"fx2": "北风",
"fl1": "3-4级转小于3级",
"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": "7",
"st2": "3",
"st3": "7",
"st4": "3",
"st5": "7",
"st6": "2",
"index_cl": "不宜",
"index_ls": "不宜",
"index_ag": "极不易发"
}
}
大家也可以进这个地址:http://blog.csdn.net/l_ch_g/article/details/8558522查找全国的城市编码