360天气API接口

大家可以打开360天气的网址:http://tq.360.cn/

可以看到它的请求数据是jsonp的方式:

  1. 加载城市列表:http://cdn.weather.hao.360.cn/sed\_api\_area\_query.php?grade=city&\_jsonp=loadCity&code=03&_=1401681340286

  2. 加载省:http://cdn.weather.hao.360.cn/sed\_api\_area\_query.php?grade=province&\_jsonp=loadProvince&_=1401681340286

  3. 加载地区:http://cdn.weather.hao.360.cn/sed\_api\_area\_query.php?grade=town&\_jsonp=loadTown&code=0301&_=1401681340286

  4. 加载天气:http://tq.360.cn/api/weatherquery/query?app=tq360&code=101030100&\_jsonp=renderData&\_=1401681340302

关键是第四步,传人的code就是地区的编号。关于地区的编号数据库可以使用反编译的方法获得。

可以先下载360天气,反编译后资源文件中有一个city.db 。打开,转成msyql或者你需要的格式。

加载完天气后 天气状况,pm值等各种都有了,是不是很强大~

0%