免费的天气API

高德地图的提供了免费查看天气预报API(https://lbs.amap.com/api/webservice/guide/api/weatherinfo/),每日限制调100000次;

1.和风天气

访问流量:4000次/天。
访问频率:200次/分钟。

实况天气接口https://free-api.heweather.net/s6/weather/now?location=武汉&lang=zh&unit=i&key=xxxxxx

存在bug, 不如当city=广州返回结果改城市不存在,换成城市ID则可以查出

2. 中国天气SmartWeatherAPI(http://smart.weather.com.cn/wzfw/smart/weatherapi.shtml)

  1. SmartWeatherAPI接口(简称”SWA”接口)是中国气象局面向网络媒体、手机厂商、第三方气象服务机构等用户,通过web方式提供数据气象服务的官方载体。该数据主要包括预警、实况、指数、常规预报(24小时)等数据内容。
  2. 接口文档:http://download.weather.com.cn/creative/SmartWeatherAPI_Lite_WebAPI_3.0.1.rar
  3. 使用须申请,详见官网http://smart.weather.com.cn/wzfw/smart/weatherapi.shtml

注意:(之前在网上所谓的免费的天气API是有限制,限制每日调接口次数,大部分地址都不可用),不要用抓包APi的地址(不稳定);比如http://wthrcdn.etouch.cn/weather_mini?city=北京,而该API返回来是经过压缩的Gzip文件还需自己解压

原文地址:https://www.cnblogs.com/yang12311/p/10431662.html