真正的中国天气api接口xml,json(求加精) ..._方阳的博客-程序员宅基地

技术标签: 天气  xml  免费  android  json  API  

我只想说现在网上那几个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

{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"24℃","temp2":"11℃","weather":"雷阵雨转多云","img1":"d4.gif","img2":"n1.gif","ptime":"11:00"}}


这俩都见过吧
反正数据就是这样,也没啥好说的,但是只有实时天气,实在不爽,想做个天气应用怎么也得有未来天气,指数啥的吧!!
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℃","type":"晴","low":"低温 8℃","date":"4日星期日"},{"fengxiang":"无持续风向","fengli":"微风","high":"高温 21℃","type":"晴","low":"低温 9℃","date":"5日星期一"},{"fengxiang":"无持续风向","fengli":"微风","high":"高温 21℃","type":"多云","low":"低温 10℃","date":"6日星期二"},{"fengxiang":"无持续风向","fengli":"微风","high":"高温 24℃","type":"晴","low":"低温 12℃","date":"7日星期三"},{"fengxiang":"无持续风向","fengli":"微风","high":"高温 23℃","type":"晴","low":"低温 11℃","date":"8日星期四"}],"yesterday":{"fl":"微风","fx":"无持续风向","high":"高温 23℃","type":"晴","low":"低温 12℃","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,教程贴完了!!!希望朋友们多多支持!!!本菜鸟在此谢过了!!!!
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/yybj/article/details/40484697

智能推荐

cesium怎么结合bim_葛兰岱尔邀请您参加WebGL轻量化GIS+BIM引擎开发培训交流会议_weixin_39731682的博客-程序员宅基地

各位施工、建筑等行业的朋友们:为了更好的为大家提供BIM产品、技术服务,解决BIM引擎产品在项目二次开发应用或是在体验过程中遇到的各种问题,葛兰岱尔于今天下午特地举办WebGL轻量化GIS+BIM引擎开发培训线上交流会议,届时欢迎各位莅临参加。会议内容包括:BIM引擎功能的介绍、引擎开发接口讲解、二次开发环境的搭建、问题答疑会议主讲人:产品技术人员会议时间:2020/6/19 16:30...

cocos creator ListView_Zack-zzh的博客-程序员宅基地_cocos creator listview

ListView.tsconst {ccclass, property} = cc._decorator;/** * 通用 ListView 组件. * 能够显示垂直/横向ListView. 具体用法见Demo */@ccclassexport default class ListView extends cc.Component { @property(cc...

从小白学起海思Hi35xx系入门之一:搭建linux环境_oangeli的博客-程序员宅基地_海思3798刷linux

之前一直在PC端,stm32嵌入式平台做开发,linux平台没有接触过,第一次接触linux操作系统,感觉是另一个世界。linux系统很多,经过同学推荐,使用CentOs(community enterprise Operating system),其本质是redhat的克隆系统。1 、安装虚拟机(Vmware Workstation Pro 15),破解码可以在网上搜到,如果...

让我们挖吧——Logminer(5)START_LOGMNR选项介绍,Logminer DML丢失的问题解决_weixin_33982670的博客-程序员宅基地

Logminer的最终章,START_LOGMNR的参数的介绍。先说一下参数如何使用:dbms_logmnr.start_logmnr( dictfilename =&gt; '/home/oracle/logminer/logminer_dict.ora',options =&gt; dbms_logmnr.PRINT_PRETTY_SQL+dbms_...

Python文件UnicodeDecodeError: invalid start byte / illegal multibyte sequence_suoluo_2020的博客-程序员宅基地

Python代码中的中文读写经常出问题,究其原因,主要在codec上。例如,如下两个错误:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 98: invalid start byte或:'gbk' codec can't decode byte 0xfe in position 16172: illegal multibyte sequence原因:open文件时指定了encoding 类型,但在文

随便推点

原始套接字 IP_HDRINCL_chengqian7320的博客-程序员宅基地

原始套接字可以访问ICMP和ICMP等协议包,可以读写内核不处理的IP数据包。可以创建自定义的IP数据包首部。一句话,使用原始套接字可以   编写基于IP协议的通讯程序。   1.创建原始套接字具体格式如下:int sockfd;sockfd = socktet(A...

Log日志截取sql语句_skyisbluening的博客-程序员宅基地

一、Laravel 记录SQL日志1、在 App\Providers\EventServiceProvider:class 中的$listen中新增如下protected $listen = [ 'App\Events\Event' =&amp;gt; [ 'App\Listeners\EventListener', ], // 新增SqlListener监听Que...

中国大学的现实是:大学层次越低,上课越多,学生读书越少_视学算法的博客-程序员宅基地

点击上方“视学算法”,选择加"星标"或“置顶”重磅干货,第一时间送达来源:美国史教学与研究作者:高玉中国大学的现实是,上课和大学的层次地位是相反的。大学层次越低,上课越多;大学层次越低,学...

何去何从?-----奔四的程序员_lkj107的博客-程序员宅基地

      房价在短暂的调整以后再次发力,国务院也出台了一系列措施,但是看到保利同学连续获取几个地王之后,俺是彻底对房价在近几年之内调整到合理的价格失望了,只能等待央行的印钞机与市场消化能力上演火星撞地球了      房价的上涨和房租的上涨,注定了在二线城市买房子会彻底的降低俺的生活质量,梦想去外企感受一下文化,挣几年钱,然后回来做一个独立开发者? 

根据URL加载图片并付给bitmap(微信分享中使用)_流火星空的博客-程序员宅基地

原文网址: http://xiaxveliang.blog.163.com/blog/static/297080342013827768676/

【每周一文】Learning Classifiers from Only Positive and Unlabeled Data(2008)_下一步的博客-程序员宅基地

概述本文也是用于求解PULearning问题,并且提出在样本满足一定分布情况下,根据正样本和未标记样本作为负样本训练出来的分类模型,预测出来的结果和该样本属于正样本的概率存在一个固定常数系数。 根据该假设提出两种模型训练思路,能够得到最好的效果。问题求解对于给定的样本数据引入第三个随机变量S表示该样本是否被标记过,则p(x,y,s)满足一定的概率分布。 变量含义x为样本特征数据

推荐文章

热门文章

相关标签