中央气象局台的天气数据API接口有三个:
1:http://www.weather.com.cn/data/sk/101010100.html
2:http://www.weather.com.cn/data/cityinfo/101010100.html
3:http://m.weather.com.cn/data/101110101.html
这个的数据比上面两个丰富得多,只可惜,不稳定的,而且从今年3月4号开始数据不更新了,解释是去智慧天气(http://smart.weather.com.cn/)申请试用免费的api,但是所谓免费,也只是暂定免费,后面会不会收费就不得而知了。
综合三个API,前两个数据太单薄,而且是是实时天气,没有未来的几天天气数据,满足不了需求,以前通用的第三个也不能用。对了,中国气象局的API有免费和收费模式,免费的有次数限制,用不起。如果有钱也不用,要花钱的话直接用心知天气的SDK岂不是更方便,不过真的是不便宜。去看看价格吧http://www.thinkpage.cn/weather/pricing.aspx
不要灰心,总有能用的,不然那么多APP怎么来的数据
http://www.weather.com.cn/data/zs/101010100.html
中华万年历:
http://wthrcdn.etouch.cn/weather_mini?city=北京
通过城市名字获得天气数据,json数据
http://wthrcdn.etouch.cn/weather_mini?citykey=101010100
通过城市id获得天气数据,json数据
金山导航:
http:\pm25.moji001.comaqiindex-1623.html
小米:
http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301
中央天气预报:
http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101040100&weatherType=0
http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101040100&weatherType=1
别的地址:
http://wthrcdn.etouch.cn/WeatherApi?citykey=101010100
通过城市id获得天气数据,xml文件数据,
当错误时会有<error>节点
http://wthrcdn.etouch.cn/WeatherApi?city=北京