前言

我们经常在不同的应用中见到镶嵌的本地地理位置气象信息,一般配合定位使用,即先获取用户位置,然后通过用户的区域请求免费的天气接口,获取气象数据,json解析后展示。

一,常用的三个接口

我常用的接口地址有三个,都是以北京的为准,如下:

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

返回:json类型

{"weatherinfo":{"city":"北京","cityid":"101010100","temp":"19","WD":"西南风","WS":"1级","SD":"56%","WSE":"1","time":"23:45","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}

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

返回:json类型

{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"18℃","temp2":"30℃","weather":"多云转晴","img1":"n1.gif","img2":"d0.gif","ptime":"18:00"}}

3,http://m.weather.com.cn/data/101010100.html

返回:json类型

{"weatherinfo":{"city":"北京","city_en":"beijing","date_y":"2013年5月13日","date":"","week":"星期一","fchh":"18","cityid":"101010100","temp1":"18℃~30℃","temp2":"15℃~28℃","temp3":"14℃~26℃","temp4":"16℃~27℃","temp5":"15℃~33℃","temp6":"19℃~31℃","tempF1":"64.4℉~86℉","tempF2":"59℉~82.4℉","tempF3":"57.2℉~78.8℉","tempF4":"60.8℉~80.6℉","tempF5":"59℉~91.4℉","tempF6":"66.2℉~87.8℉","weather1":"多云转晴","weather2":"晴","weather3":"多云转阴","weather4":"小雨转阴","weather5":"晴","weather6":"阴","img1":"1","img2":"0","img3":"0","img4":"99","img5":"1","img6":"2","img7":"7","img8":"2","img9":"0","img10":"99","img11":"2","img12":"99","img_single":"0","img_title1":"多云","img_title2":"晴","img_title3":"晴","img_title4":"晴","img_title5":"多云","img_title6":"阴","img_title7":"小雨","img_title8":"阴","img_title9":"晴","img_title10":"晴","img_title11":"阴","img_title12":"阴","img_title_single":"晴","wind1":"北风3-4级","wind2":"微风","wind3":"微风","wind4":"微风","wind5":"微风","wind6":"微风","fx1":"北风","fx2":"北风","fl1":"3-4级","fl2":"小于3级","fl3":"小于3级","fl4":"小于3级","fl5":"小于3级","fl6":"小于3级","index":"舒适","index_d":"较凉爽,建议着长袖衬裤等春秋过渡装。体弱者宜着长袖衬衫和马甲。但昼夜温差较大,请适当增减衣服。","index48":"热","index48_d":"天气较热,建议着短裙、短裤、短套装、T恤等夏季服装。年老体弱者宜着长袖衬衫和单裤。","index_uv":"很强","index48_uv":"强","index_xc":"适宜","index_tr":"适宜","index_co":"较舒适","st1":"29","st2":"16","st3":"29","st4":"16","st5":"28","st6":"14","index_cl":"较适宜","index_ls":"极适宜","index_ag":"易发"}}

显而易见第三个api返回的数据是最全面的,现在就以第三个为准,对数据分析:

{"weatherinfo": {

    //基本信息;

    "city":"北京","city_en":"beijing",


    "date_y":"2012年2月16日","date":"", "week":"星期四","fchh":"11", "cityid":"101010100",


    //摄氏温度


    "temp1":"2℃~-7℃",


    "temp2":"1℃~-7℃",


    "temp3":"4℃~-7℃",


    "temp4":"7℃~-5℃",


    "temp5":"5℃~-3℃",


    "temp6":"5℃~-2℃",


    //华氏温度;


    "tempF1":"35.6℉~19.4℉",


    "tempF2":"33.8℉~19.4℉",


    "tempF3":"39.2℉~19.4℉",


    "tempF4":"44.6℉~23℉",


    "tempF5":"41℉~26.6℉",


    "tempF6":"41℉~28.4℉",


    //天气描述;


    "weather1":"晴",


    "weather2":"晴",


    "weather3":"晴",


    "weather4":"晴转多云",


    "weather5":"多云",


    "weather6":"多云转阴",


    //天气描述图片序号


    "img1":"0",


    "img2":"99",


    "img3":"0",


    "img4":"99",


    "img5":"0",


    "img6":"99",


    "img7":"0",


    "img8":"1",


    "img9":"1",


    "img10":"99",


    "img11":"1",


    "img12":"2",


    "img_single":"0",


    //图片名称;


    "img_title1":"晴",


    "img_title2":"晴",


    "img_title3":"晴",


    "img_title4":"晴",


    "img_title5":"晴",


    "img_title6":"晴",


    "img_title7":"晴",


    "img_title8":"多云",


    "img_title9":"多云",


    "img_title10":"多云",


    "img_title11":"多云",


    "img_title12":"阴",


    "img_title_single":"晴",


    //风速描述


    "wind1":"北风3-4级转微风",


    "wind2":"微风",


    "wind3":"微风",


    "wind4":"微风",


    "wind5":"微风",


    "wind6":"微风",


    //风速级别描述


    "fx1":"北风",


    "fx2":"微风",


    "fl1":"3-4级转小于3级",


    "fl2":"小于3级",


    "fl3":"小于3级",


    "fl4":"小于3级",


    "fl5":"小于3级",


    "fl6":"小于3级",


    //今天穿衣指数;


    "index":"冷",


    "index_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",


    //48小时穿衣指数


    "index48":"冷",


    "index48_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",


    //紫外线及48小时紫外线


    "index_uv":"弱",


    "index48_uv":"弱",


    //洗车


    "index_xc":"适宜",


    //旅游


    "index_tr":"一般",


    //舒适指数


    "index_co":"较不舒适",


    


    "st1":"1",


    "st2":"-8",


    "st3":"2",


    "st4":"-4",


    "st5":"5",


    "st6":"-5",


    //晨练


    "index_cl":"较不宜",


    //晾晒


    "index_ls":"基本适宜",


    //过敏


    "index_ag":"极不易发"}}

二,全国各主要城市或地区代号

北京:101010100朝阳:101010300顺义:101010400怀柔:101010500通州:101010600昌平:101010700延庆:101010800丰台:101010900石景山:101011000大兴:101011100房山:101011200密云:101011300门头沟:101011400平谷:101011500八达岭:101011600佛爷顶:101011700汤河口:101011800密云上甸子:101011900斋堂:101012000霞云岭:101012100北京城区:101012200海淀:101010200天津:101030100宝坻:101030300东丽:101030400西青:101030500北辰:101030600蓟县:101031400汉沽:101030800静海:101030900津南:101031000塘沽:101031100大港:101031200武清:101030200宁河:101030700上海:101020100宝山:101020300嘉定:101020500南汇:101020600浦东:101021300青浦:101020800松江:101020900奉贤:101021000崇明:101021100徐家汇:101021200闵行:101020200金山:101020700石家庄:101090101张家口:101090301承德:101090402唐山:101090501秦皇岛:101091101沧州:101090701衡水:101090801邢台:101090901邯郸:101091001保定:101090201廊坊:101090601郑州:101180101新乡:101180301许昌:101180401平顶山:101180501信阳:101180601南阳:101180701开封:101180801洛阳:101180901商丘:101181001焦作:101181101鹤壁:101181201濮阳:101181301周口:101181401漯河:101181501驻马店:101181601三门峡:101181701济源:101181801安阳:101180201合肥:101220101芜湖:101220301淮南:101220401马鞍山:101220501安庆:101220601宿州:101220701阜阳:101220801亳州:101220901黄山:101221001滁州:101221101淮北:101221201铜陵:101221301宣城:101221401六安:101221501巢湖:101221601池州:101221701蚌埠:101220201杭州:101210101舟山:101211101湖州:101210201嘉兴:101210301金华:101210901绍兴:101210501台州:101210601温州:101210701丽水:101210801衢州:101211001宁波:101210401重庆:101040100合川:101040300南川:101040400江津:101040500万盛:101040600渝北:101040700北碚:101040800巴南:101040900长寿:101041000黔江:101041100万州天城:101041200万州龙宝:101041300涪陵:101041400开县:101041500城口:101041600云阳:101041700巫溪:101041800奉节:101041900巫山:101042000潼南:101042100垫江:101042200梁平:101042300忠县:101042400石柱:101042500大足:101042600荣昌:101042700铜梁:101042800璧山:101042900丰都:101043000武隆:101043100彭水:101043200綦江:101043300酉阳:101043400秀山:101043600沙坪坝:101043700永川:101040200福州:101230101泉州:101230501漳州:101230601龙岩:101230701晋江:101230509南平:101230901厦门:101230201宁德:101230301莆田:101230401三明:101230801兰州:101160101平凉:101160301庆阳:101160401武威:101160501金昌:101160601嘉峪关:101161401酒泉:101160801天水:101160901武都:101161001临夏:101161101合作:101161201白银:101161301定西:101160201张掖:101160701广州:101280101惠州:101280301梅州:101280401汕头:101280501深圳:101280601珠海:101280701佛山:101280800肇庆:101280901湛江:101281001江门:101281101河源:101281201清远:101281301云浮:101281401潮州:101281501东莞:101281601中山:101281701阳江:101281801揭阳:101281901茂名:101282001汕尾:101282101韶关:101280201南宁:101300101柳州:101300301来宾:101300401桂林:101300501梧州:101300601防城港:101301401贵港:101300801玉林:101300901百色:101301001钦州:101301101河池:101301201北海:101301301崇左:101300201贺州:101300701贵阳:101260101安顺:101260301都匀:101260401兴义:101260906铜仁:101260601毕节:101260701六盘水:101260801遵义:101260201凯里:101260501昆明:101290101红河:101290301文山:101290601玉溪:101290701楚雄:101290801普洱:101290901昭通:101291001临沧:101291101怒江:101291201香格里拉:101291301丽江:101291401德宏:101291501景洪:101291601大理:101290201曲靖:101290401保山:101290501呼和浩特:101080101乌海:101080301集宁:101080401通辽:101080501阿拉善左旗:101081201鄂尔多斯:101080701临河:101080801锡林浩特:101080901呼伦贝尔:101081000乌兰浩特:101081101包头:101080201赤峰:101080601南昌:101240101上饶:101240301抚州:101240401宜春:101240501鹰潭:101241101赣州:101240701景德镇:101240801萍乡:101240901新余:101241001九江:101240201吉安:101240601武汉:101200101黄冈:101200501荆州:101200801宜昌:101200901恩施:101201001十堰:101201101神农架:101201201随州:101201301荆门:101201401天门:101201501仙桃:101201601潜江:101201701襄樊:101200201鄂州:101200301孝感:101200401黄石:101200601咸宁:101200701成都:101270101自贡:101270301绵阳:101270401南充:101270501达州:101270601遂宁:101270701广安:101270801巴中:101270901泸州:101271001宜宾:101271101内江:101271201资阳:101271301乐山:101271401眉山:101271501凉山:101271601雅安:101271701甘孜:101271801阿坝:101271901德阳:101272001广元:101272101攀枝花:101270201银川:101170101中卫:101170501固原:101170401石嘴山:101170201吴忠:101170301西宁:101150101黄南:101150301海北:101150801果洛:101150501玉树:101150601海西:101150701海东:101150201海南:101150401济南:101120101潍坊:101120601临沂:101120901菏泽:101121001滨州:101121101东营:101121201威海:101121301枣庄:101121401日照:101121501莱芜:101121601聊城:101121701青岛:101120201淄博:101120301德州:101120401烟台:101120501济宁:101120701泰安:101120801西安:101110101延安:101110300榆林:101110401铜川:101111001商洛:101110601安康:101110701汉中:101110801宝鸡:101110901咸阳:101110200渭南:101110501太原:101100101临汾:101100701运城:101100801朔州:101100901忻州:101101001长治:101100501大同:101100201阳泉:101100301晋中:101100401晋城:101100601吕梁:101101100乌鲁木齐:101130101石河子:101130301昌吉:101130401吐鲁番:101130501库尔勒:101130601阿拉尔:101130701阿克苏:101130801喀什:101130901伊宁:101131001塔城:101131101哈密:101131201和田:101131301阿勒泰:101131401阿图什:101131501博乐:101131601克拉玛依:101130201拉萨:101140101山南:101140301阿里:101140701昌都:101140501那曲:101140601日喀则:101140201林芝:101140401台北县:101340101高雄:101340201台中:101340401海口:101310101三亚:101310201东方:101310202临高:101310203澄迈:101310204儋州:101310205昌江:101310206白沙:101310207琼中:101310208定安:101310209屯昌:101310210琼海:101310211文昌:101310212保亭:101310214万宁:101310215陵水:101310216西沙:101310217南沙岛:101310220乐东:101310221五指山:101310222琼山:101310102长沙:101250101株洲:101250301衡阳:101250401郴州:101250501常德:101250601益阳:101250700娄底:101250801邵阳:101250901岳阳:101251001张家界:101251101怀化:101251201黔阳:101251301永州:101251401吉首:101251501湘潭:101250201南京:101190101镇江:101190301苏州:101190401南通:101190501扬州:101190601宿迁:101191301徐州:101190801淮安:101190901连云港:101191001常州:101191101泰州:101191201无锡:101190201盐城:101190701哈尔滨:101050101牡丹江:101050301佳木斯:101050401绥化:101050501黑河:101050601双鸭山:101051301伊春:101050801大庆:101050901七台河:101051002鸡西:101051101鹤岗:101051201齐齐哈尔:101050201大兴安岭:101050701长春:101060101延吉:101060301四平:101060401白山:101060901白城:101060601辽源:101060701松原:101060801吉林:101060201通化:101060501沈阳:101070101鞍山:101070301抚顺:101070401本溪:101070501丹东:101070601葫芦岛:101071401营口:101070801阜新:101070901辽阳:101071001铁岭:101071101朝阳:101071201盘锦:101071301大连:101070201锦州:101070701

三,常用接口集合(转)

webservice工厂接口 http://www.36wu.com


快递查询接口http://webservice.36wu.com/ExpressService.asmx


ip查询接口http://webservice.36wu.com/ipService.asmx


天气预报接口http://webservice.36wu.com/weatherService.asmx


身份证查询接口http://webservice.36wu.com/IdCardService.asmx


手机归属地接口http://webservice.36wu.com/MobilePhoneService.asmx


翻译接口http://webservice.36wu.com/TranslationService.asmx


火车时刻接口http://webservice.36wu.com/TrainService.asmx


股票查询接口http://webservice.36wu.com/StockService.asmx


邮编接口http://webservice.36wu.com/ZipcodeService.asmx


二维码Web服务http://webservice.36wu.com/DimensionalCodeService.asmx


公交查询Web服务http://webservice.36wu.com/mapService.asmx 


ISBN查询Web服务http://webservice.36wu.com/ISBNService.asmx


ICP备案查询Web服务http://webservice.36wu.com/ICPServic.asmx

免费接口API的更多相关文章

  1. 开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供)

    天气预报一直是各大网站的一个基本功能,最近小编也想在网站上弄一个,得瑟一下,在网络搜索了很久,终于找到了开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供),具体如下: 国家气象局提供的 ...

  2. Google地图接口API之申请免费API Key(一)

    使用谷歌地图API V3创建交互式地图,首先需要拥有一个免费的 Google 地图 API key. 如果想调用Google地图的接口,首先需要拥有一个免费的 Google 地图 API key.想要 ...

  3. JAVA的免费天气api接口调用示例

    step1:选择本文所示例的接口"免费天气api" url:https://www.juhe.cn/docs/api/id/39/aid/87 step2:每个接口都需要传入一个参 ...

  4. 免费天气预报API接口

    一.中国气象局(http://www.weather.com.cn) 1.实时接口 http://mobile.weather.com.cn/data/sk/101010100.html http:/ ...

  5. 各类免费的API接口分享,无限次

    各类免费的API接口分享: 手机号码归属地API:https://www.juhe.cn/docs/api/id/11 历史上的今天API:https://www.juhe.cn/docs/api/i ...

  6. 开放数据接口 API 简介与使用场景、调用方法

    此文章对开放数据接口 API 进行了功能介绍.使用场景介绍以及调用方法的说明,供用户在使用数据接口时参考之用. 在给大家分享的一系列软件开发视频课程中,以及在我们的社区微信群聊天中,都积极地鼓励大家开 ...

  7. IP地址查询接口API

    项目需要根据ip查询pos机设备所在的省份信息,经查询有以下几种免费接口: 1. 淘宝IP API http://ip.taobao.com/service/getIpInfo.php?ip=xxx ...

  8. ios 开源免费接口

    ios 开源免费接口 国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather. ...

  9. 免费第三方API平台整合

    各大平台免费接口,非常适用 http://developer.51cto.com/art/201412/458778.htm 绝对干货:供个人开发者赚钱免费使用的一些好的API接口http://www ...

  10. JS调用免费接口根据ip查询位置

    免费接口如下: 新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js 新浪多地域测试方法:http://in ...

随机推荐

  1. 汉字在unicode的编码情况-From http://yedict.com/zsts.htm

    字符集内容 字数 unicode编码 字符显示说明(除非安装更大字库) 基本区  分页:  一 二 三 四 共20902字 4E00-9FA5 电脑和手机都能显示 基本区补充 共90字 9FA6-9F ...

  2. [转帖]10.2 Data Collector与MDW

    10.2 Data Collector与MDW Data Collection功能是SQL SERVER 2005版本提供的数据库监控报表的功能,通过定时地对数据库的语句运行情况,服务器各种资源的监控 ...

  3. [转帖]内存管理参数zone_reclaim_mode分析

    zone_reclaim_mode 官方解释 调整方法 调整的影响 官方解释 最近在性能优化,看到了zone_reclaim_mode参数,记录备用 zone_reclaim_mode: Zone_r ...

  4. [转帖]神秘的backlog参数与TCP连接队列

    https://www.cnblogs.com/codelogs/p/16060820.html 简介# 这要从一次压测项目说起,那是我们公司的系统与另几家同行公司的系统做性能比拼,性能数据会直接影响 ...

  5. 【转帖】JVM 元数据区的内存泄漏之谜

    https://www.infoq.cn/article/Z111FLot92PD1ZP3sbrS 一.问题描述 某天,SRE 部门观察到一个非常重要的应用里面有一台服务器的业务处理时间(Transa ...

  6. [转帖]比 Python 快 35000 倍!LLVM&Swift 之父宣布全新编程语言 Mojo:编程被颠覆了

    https://www.infoq.cn/article/GFfVLVpkIGOcKYB85Opb "Mojo 可能是近几十年来最大的编程语言进步." 近日,由 LLVM 和 Sw ...

  7. [转帖]kubelet 原理解析五: exec的背后

    https://segmentfault.com/a/1190000022163850 概述 线上排查pod 问题一般有两种方式,kubectl log或者kubectl exec调试.如果你的 lo ...

  8. Vue中is属性的用法 可以动态切换组件

    is 是组件的一个属性,用来展示组件的名称 is和component联用哈 vue提供了component来展示对应的组件名称 compont是一个占位符,is这个属性,用来展示对应的组件名称 三个子 ...

  9. web字体小于12px的解决办法

    大家都知道,web端的字体在正常情况下,最小只能够是12px; 但是有些时候,可能需要字体小于12px 那么如何解决这个办法了 可以使用css3的缩放属性scale 如果字体的大小是10px; 那么我 ...

  10. 【解决了一个小问题】在某个linux基础镜像中安装python特定的版本

    作者:张富春(ahfuzhang),转载时请注明作者和引用链接,谢谢! cnblogs博客 zhihu Github 公众号:一本正经的瞎扯 在某个基础镜像中,安装了python3.6.但是一个测试需 ...