免费天气预报API接口

网友投稿 1384 2022-07-01

一、中国气象局(http://www.weather.com.cn)

1.实时接口

http://mobile.weather.com.cn/data/sk/101010100.html

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

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

其中:101010100 是城市代码。

json数据格式:

 View Json

2.一周天气预报接口

 http://mobile.weather.com.cn/data/forecast/101010100.html

其中:101010100 是城市代码。

json数据格式:

 View Json

3.获取全国所有城市代码列表

 城市代码

获取方式一(XML接口):

全国省会城市一览: http://flash.weather.com.cn/wmaps/xml/china.xml

全国县级以上城市一览,比如:

上海:http://flash.weather.com.cn/wmaps/xml/shanghai.xml 

四川:http://flash.weather.com.cn/wmaps/xml/sichuan.xml

成都:http://flash.weather.com.cn/wmaps/xml/chengdu.xml

重庆:http://flash.weather.com.cn/wmaps/xml/chongqing.xml

获取方式二(XML接口):

一次性获取全国+国外主要城市,8763个城市列表信息。URL:http://mobile.weather.com.cn/js/citylist.xml

二、免费天气API接口(http://www.tianqiapi.com)

1.接口没有调用次数、频率和IP限制, 永久免费。

2.JSON接口调用文档:http://doc.tianqiapi.com/603579

3.IFrame调用:http://www.tianqiapi.com/

三、和风天气(https://www.heweather.com)

1.数据主要包含:实时天气,3天内天气预报,生活指数,空气质量。

  访问流量:4000次/天。

  访问频率:200次/分钟。

2.URL:https://free-api.heweather.com/v5/forecast?city=yourcity&key=yourkey
   city:城市名称,city可通过城市中英文名称、ID、IP和经纬度进行查询,经纬度查询格式为:经度,纬度。例:city=北京,city=beijing,city=CN101010100,city= 60.194.130.1
   key:用户认证key

3.注册页面:https://console.heweather.com/register

   接口文档:https://www.heweather.com/documents/


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:超棒的 15 款 Bootstrap UI 编辑器(超棒的羊羊)
下一篇:python中api的使用方法是什么
相关文章

 发表评论

暂时没有评论,来抢沙发吧~