天气接口

简介

由于项目需求,需要提取特定城市的天气状态,顺便把目前网上易查到的资料整理下,也方便他人查阅

 

免费_当日或未来几日

k780:http://www.k780.com/api/weather.history

接口地址:http://api.k780.com:88/?app=weather.history&weaid=1&date=2015-07-20&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json

 

中华万年历:

http://wthrcdn.etouch.cn/weather_mini?city=北京

通过城市名字获得天气数据,json数据

http://wthrcdn.etouch.cn/weather_mini?citykey=101010100

通过城市id获得天气数据,json数据

http://wthrcdn.etouch.cn/WeatherApi?citykey=101010100

通过城市id获得天气数据,xml文件数据,

http://wthrcdn.etouch.cn/WeatherApi?city=北京

通过城市名字获得天气数据,xml文件数据

 

小米:

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

 

其他来源:

新浪天气预报API:http://php.weather.sina.com.cn/xml.php?city=%B1%B1%BE%A9&password=DJOYnieT8234jlsK&day=0

 

转自https://blog.csdn.net/u011331731/article/details/72765410如文章有涉及版权问题请及时联系更改

免费_历史天气

天气网:http://lishi.tianqi.com/acheng/index.html

 

 

收费_聚合数据

天气预报:https://www.juhe.cn/docs/api/id/73

全国天气预报:https://www.juhe.cn/docs/api/id/39

 

 

友情链接

(别人已经整理好的,有效性未验证)

天气API接口大全(nohacks.cn 收集整理):http://www.nohacks.cn/post-35.html

网上的天气 API 哪一个更加可靠?:https://www.zhihu.com/question/20575288

免费的天气接口(满足你的大部分需求):http://blog.csdn.net/wanghao940101/article/details/72123184

真正的中国天气api接口xml,json(求加精) ...:http://blog.csdn.net/fancylovejava/article/details/26102635

免费的天气接口(满足你的大部分需求):http://blog.csdn.net/wanghao940101/article/details/72123184

 

 

 

转自https://blog.csdn.net/qq_23039185/article/details/80751698

1.最近使用java.net包的HttpURLConnection,来获取百度地图API返回的数据,返回乱码

2.Charset 配置的是UTF-8 

导致原因:Content-Encoding →gzip ,encoding是gzip的格式的,因为请求的时候没有设置connection的encoding,导致这个乱码

 

3.解决方法:conn.setRequestProperty("Accept-Encoding", "gzip, deflate, br");将对应的格式设置到accept-encoding里

4.提供GZIP的解压方式,获得解压后的字节数组,直接new String(字节数组) 可以得到对应的返回值

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值