真正的中国天气api接口xml,json(求加精) ...

前端之家收集整理的这篇文章主要介绍了真正的中国天气api接口xml,json(求加精) ...前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我只想说现在网上那几个api完全坑爹有木有???

官方的申请不来有木有,还有收费有木有??
咱这种菜鸟只能用免费的了!!!!
http://m.weather.com.cn/data/101110101.html
大坑有木有??反应慢不说了,还老不更新!!
想贴段代码的,现在又打不 开了(貌似3月4号以后没更新过)
==========================我是分割线==========================
下面,正式开始本次主题!!!
http://www.weather.com.cn/data/sk/101010100.html

{"weatherinfo":{"city":"北京","cityid":"101010100","temp":"22","WD":"北风","WS":"2级","SD":"19%","WSE":"2","time":"16:05","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}

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

这俩都见过吧
反正数据就是这样,也没啥好说的,但是只有实时天气,实在不爽,想做个天气应用怎么也得有未来天气,指数啥的吧!!
http://www.weather.com.cn/data/zs/101010100.html
说:你看到了啥,不错上面地址就是天气指数各种详细,还是json数据,各种好用!!!
还不够???对啊未来天气怎么办???刚才那个m.weather.com.cn.....挂掉了没办法啊!!!但是数据总会有的,不要灰心!!
==================================我是分割线============================================================


真正的重点,今天去中华万年历的时候不小心抓包就抓到了一个网址,打开一看碉堡了!!!通过对比,和中国天气同步!!!!

{"desc":"OK","status":1000,"data":{"wendu":"22","ganmao":"风较大,较易发生感冒,注意防护。","forecast":[{"fengxiang":"北风","fengli":"5-6级","high":"高温 24℃","type":"晴","low":"低温 11℃","date":"3日星期六"},{"fengxiang":"北风","fengli":"4-5级","high":"高温 19℃","low":"低温 8℃","date":"4日星期日"},{"fengxiang":"无持续风向","fengli":"微风","high":"高温 21℃","low":"低温 9℃","date":"5日星期一"},"type":"多云","low":"低温 10℃","date":"6日星期二"},"low":"低温 12℃","date":"7日星期三"},"high":"高温 23℃","date":"8日星期四"}],"yesterday":{"fl":"微风","fx":"无持续风向","date":"2日星期五"},"aqi":"59","city":"北京"}}

有没有很爽的感觉???对json数据,未来七天的天气。。。全了!!!
包含实时气温,感冒指数,未来七天天气(风力,风向,高低温,时间),空气质量指数(有的城市没有),城市名称
下面贴地址!!!!

本帖隐藏的内容

http://wthrcdn.etouch.cn/weather_mini?city=北京
通过城市名字获得天气数据,json数据
http://wthrcdn.etouch.cn/weather_mini?citykey=101010100
通过城市id获得天气数据,json数据

如果这还不够!!!下面还有!!!!
<resp><br style="word-wrap: break-word;" />
<city>北京</city><br style="word-wrap: break-word;" />
<updatetime>16:10</updatetime><br style="word-wrap: break-word;" />
<wendu>23</wendu><br style="word-wrap: break-word;" />
<fengli>3级</fengli><br style="word-wrap: break-word;" />
<shidu>19%</shidu><br style="word-wrap: break-word;" />
<fengxiang>北风</fengxiang><br style="word-wrap: break-word;" />
<sunrise_1/><br style="word-wrap: break-word;" />
<sunset_1/><br style="word-wrap: break-word;" />
<sunrise_2/><br style="word-wrap: break-word;" />
<sunset_2/><br style="word-wrap: break-word;" />
<environment><br style="word-wrap: break-word;" />
<aqi>59</aqi><br style="word-wrap: break-word;" />
<pm25>30</pm25><br style="word-wrap: break-word;" />
<suggest>极少数敏感人群应减少户外活动</suggest><br style="word-wrap: break-word;" />
<quality>良</quality><br style="word-wrap: break-word;" />
<MajorPollutants>颗粒物(PM10)</MajorPollutants><br style="word-wrap: break-word;" />
<o3>93</o3><br style="word-wrap: break-word;" />
<co>0</co><br style="word-wrap: break-word;" />
<pm10>67</pm10><br style="word-wrap: break-word;" />
<so2>8</so2><br style="word-wrap: break-word;" />
<no2>25</no2><br style="word-wrap: break-word;" />
<time>15:00:00</time><br style="word-wrap: break-word;" />
</environment><br style="word-wrap: break-word;" />
<alarm><br style="word-wrap: break-word;" />
<cityKey>10101</cityKey><br style="word-wrap: break-word;" />
<cityName><br style="word-wrap: break-word;" />
<![CDATA[ 北京市 ]]><br style="word-wrap: break-word;" />
</cityName><br style="word-wrap: break-word;" />
<alarmType><br style="word-wrap: break-word;" />
<![CDATA[ 大风 ]]><br style="word-wrap: break-word;" />
</alarmType><br style="word-wrap: break-word;" />
<alarmDegree><br style="word-wrap: break-word;" />
<![CDATA[ 蓝色 ]]><br style="word-wrap: break-word;" />
</alarmDegree><br style="word-wrap: break-word;" />
<alarmText><br style="word-wrap: break-word;" />
<![CDATA[ 北京市气象台发布大风蓝色预警 ]]><br style="word-wrap: break-word;" />
</alarmText><br style="word-wrap: break-word;" />
<alarm_details><br style="word-wrap: break-word;" />
<![CDATA[ 预计,3日下午到夜间,本市大部分地区将出现6级以上大风,阵风7-8级,请注意防范。 ]]><br style="word-wrap: break-word;" />
</alarm_details><br style="word-wrap: break-word;" />
<standard><br style="word-wrap: break-word;" />
<![CDATA[<br style="word-wrap: break-word;" />
24小时内可能受大风影响,平均风力可达6级以上,或者阵风7级以上;或者已经受大风影响,平均风力为6~7级,或者阵风7~8级并可能持续。<br style="word-wrap: break-word;" />
]]><br style="word-wrap: break-word;" />
</standard><br style="word-wrap: break-word;" />
<suggest><br style="word-wrap: break-word;" />
<![CDATA[<br style="word-wrap: break-word;" />
1.政府及相关部门按照职责做好防大风工作;2.关好门窗,加固围板、棚架、广告牌等易被风吹动的搭建物,妥善安置易受大风影响的室外物品,遮盖建筑物资;3.相关水域水上作业和过往船舶采取积极的应对措施,如回港避风或者绕道航行等;4.行人注意尽量少骑自行车,刮风时不要在广告牌、临时搭建物等下面逗留;5.有关部门和单位注意森林、草原等防火。<br style="word-wrap: break-word;" />
]]><br style="word-wrap: break-word;" />
</suggest><br style="word-wrap: break-word;" />
<imgUrl><br style="word-wrap: break-word;" />
<![CDATA[<br style="word-wrap: break-word;" />
http://www.weather.com.cn/m2/i/about/alarmpic/0501.gif<br style="word-wrap: break-word;" />
]]><br style="word-wrap: break-word;" />
</imgUrl><br style="word-wrap: break-word;" />
<time>2014-05-03 12:51:14</time><br style="word-wrap: break-word;" />
</alarm><br style="word-wrap: break-word;" />
<yesterday><br style="word-wrap: break-word;" />
<date_1>2日星期五</date_1><br style="word-wrap: break-word;" />
<high_1>高温 23℃</high_1><br style="word-wrap: break-word;" />
<low_1>低温 12℃</low_1><br style="word-wrap: break-word;" />
<day_1><br style="word-wrap: break-word;" />
<type_1>晴</type_1><br style="word-wrap: break-word;" />
<fx_1>无持续风向</fx_1><br style="word-wrap: break-word;" />
<fl_1>微风</fl_1><br style="word-wrap: break-word;" />
</day_1><br style="word-wrap: break-word;" />
<night_1><br style="word-wrap: break-word;" />
<type_1>晴</type_1><br style="word-wrap: break-word;" />
<fx_1>无持续风向</fx_1><br style="word-wrap: break-word;" />
<fl_1>微风</fl_1><br style="word-wrap: break-word;" />
</night_1><br style="word-wrap: break-word;" />
</yesterday><br style="word-wrap: break-word;" />
<forecast><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>3日星期六</date><br style="word-wrap: break-word;" />
<high>高温 24℃</high><br style="word-wrap: break-word;" />
<low>低温 11℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>北风</fengxiang><br style="word-wrap: break-word;" />
<fengli>5-6级</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>多云</type><br style="word-wrap: break-word;" />
<fengxiang>北风</fengxiang><br style="word-wrap: break-word;" />
<fengli>5-6级</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>4日星期日</date><br style="word-wrap: break-word;" />
<high>高温 19℃</high><br style="word-wrap: break-word;" />
<low>低温 8℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>北风</fengxiang><br style="word-wrap: break-word;" />
<fengli>4-5级</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>5日星期一</date><br style="word-wrap: break-word;" />
<high>高温 21℃</high><br style="word-wrap: break-word;" />
<low>低温 9℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>6日星期二</date><br style="word-wrap: break-word;" />
<high>高温 21℃</high><br style="word-wrap: break-word;" />
<low>低温 10℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>多云</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>7日星期三</date><br style="word-wrap: break-word;" />
<high>高温 24℃</high><br style="word-wrap: break-word;" />
<low>低温 12℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
<weather><br style="word-wrap: break-word;" />
<date>8日星期四</date><br style="word-wrap: break-word;" />
<high>高温 23℃</high><br style="word-wrap: break-word;" />
<low>低温 11℃</low><br style="word-wrap: break-word;" />
<day><br style="word-wrap: break-word;" />
<type>晴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</day><br style="word-wrap: break-word;" />
<night><br style="word-wrap: break-word;" />
<type>阴</type><br style="word-wrap: break-word;" />
<fengxiang>无持续风向</fengxiang><br style="word-wrap: break-word;" />
<fengli>微风</fengli><br style="word-wrap: break-word;" />
</night><br style="word-wrap: break-word;" />
</weather><br style="word-wrap: break-word;" />
</forecast><br style="word-wrap: break-word;" />
<zhishus><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>感冒指数</name><br style="word-wrap: break-word;" />
<value>较易发</value><br style="word-wrap: break-word;" />
<detail>风较大,较易发生感冒,注意防护。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>紫外线</name><br style="word-wrap: break-word;" />
<value>弱</value><br style="word-wrap: break-word;" />
<detail>辐射较弱,涂擦SPF12-15、PA+护肤品。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>穿衣指数</name><br style="word-wrap: break-word;" />
<value>较冷</value><br style="word-wrap: break-word;" />
<detail>建议着厚外套加毛衣等服装。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>舒适度</name><br style="word-wrap: break-word;" />
<value>舒适</value><br style="word-wrap: break-word;" />
<detail>白天不冷不热,风力不大。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>洗车指数</name><br style="word-wrap: break-word;" />
<value>不宜</value><br style="word-wrap: break-word;" />
<detail>有雨,雨水和泥水会弄脏爱车。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>旅游指数</name><br style="word-wrap: break-word;" />
<value>一般</value><br style="word-wrap: break-word;" />
<detail>有降水,风稍大,外出注意防雷防风。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>运动指数</name><br style="word-wrap: break-word;" />
<value>较不宜</value><br style="word-wrap: break-word;" />
<detail>有降水,推荐您在室内进行休闲运动。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>晨练指数</name><br style="word-wrap: break-word;" />
<value>较不宜</value><br style="word-wrap: break-word;" />
<detail>室外锻炼请携带雨具。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>约会指数</name><br style="word-wrap: break-word;" />
<value>不适宜</value><br style="word-wrap: break-word;" />
<detail>建议在室内约会,免去天气的骚扰。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>逛街指数</name><br style="word-wrap: break-word;" />
<value>较不宜</value><br style="word-wrap: break-word;" />
<detail>风大有降水,逛街注意带雨具。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>晾晒指数</name><br style="word-wrap: break-word;" />
<value>不宜</value><br style="word-wrap: break-word;" />
<detail>降水可能会淋湿衣物,请选择在室内晾晒。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
<zhishu><br style="word-wrap: break-word;" />
<name>雨伞指数</name><br style="word-wrap: break-word;" />
<value>带伞</value><br style="word-wrap: break-word;" />
<detail>有降水,短时间出行不必带伞。</detail><br style="word-wrap: break-word;" />
</zhishu><br style="word-wrap: break-word;" />
</zhishus><br style="word-wrap: break-word;" />
</resp>

这次是xml数据,
包含实时天气,日出日落,空气质量(某些城市可能不存在),天气预警(预警时存在),昨日天气(分白天黑夜),未来七天天气(分白天黑夜),天气指数
我想现在要求再高,也能满足你的需求了吧!!!!!
下面贴接口!!!!
本帖隐藏的内容 http://wthrcdn.etouch.cn/WeatherApi?citykey=101010100
通过城市id获得天气数据,xml文件数据,
错误时会有<error>节点
http://wthrcdn.etouch.cn/WeatherApi?city=北京
通过城市名字获得天气数据,xml文件数据

ok,教程贴完了!!!希望朋友们多多支持!!!本菜鸟在此谢过了!!!!

猜你在找的XML相关文章