[會員登入] [正體/简体]

使用程式叫用API取回資料的方法

傳入地址查詢使用方式

查詢時用GET方式帶入se值,se值可由[申請試用]或[購買])取得,加上查詢的地址addr即可,範例:

http://zipko.info/twidx/q?se=8456231-1&addr=凱達格蘭大道1號

回傳結果會是 JSON 格式,查詢會有幾種結果,可由回傳值"st"來判斷,格式範例:

一組解
{"oaddr":"凱達格蘭大道一號","ack":1,"msg":"成功分析五碼","answer":{"zip5":"10048","zip3":"100","zip3_maybe":[],"city":"台北市","area":"中正區","rsgd":"凱達格蘭大道","range":"全","weight":18,"restaddr":"1號","possibility":"中","similiar":"","fulladdr":"10048 台北市中正區凱達格蘭大道1號","urladdr":"%E5%8F%B0%E5%8C%97%E5%B8%82%E4%B8%AD%E6%AD%A3%E5%8D%80%E5%87%B1%E9%81%94%E6%A0%BC%E8%98%AD%E5%A4%A7%E9%81%931%E8%99%9F","hanflat":"No.1, Kaidagelan Blvd., Zhongzheng Dist., Taipei 10048, Taiwan","genflat":"No.1, Kaidagelan Blvd., Jhongjheng Dist., Taipei 10048, Taiwan","zhu2":"No.1, Kaidagelan Blvd., Jungjeng Dist., Taipei 10048, Taiwan","extra":""}}
多組解
{"oaddr":"和平路一段30號","ack":2,"msg":"多組可能結果","answer":[{"zip5":"97346","zip3":"973","city":"花蓮縣","area":"吉安鄉","rsgd":"和平路1段","range":"全","weight":15,"restaddr":"30號","possibility":"中","similiar":"","fulladdr":"97346 花蓮縣吉安鄉和平路1段30號","urladdr":"%E8%8A%B1%E8%93%AE%E7%B8%A3%E5%90%89%E5%AE%89%E9%84%89%E5%92%8C%E5%B9%B3%E8%B7%AF%EF%BC%91%E6%AE%B530%E8%99%9F","extra":""},{"zip5":"81546","zip3":"815","city":"高雄市","area":"大社區","rsgd":"和平路1段","range":"雙 298號以下","weight":15,"restaddr":"30號","possibility":"中","similiar":"","fulladdr":"81546 高雄市大社區和平路1段30號","urladdr":"%E9%AB%98%E9%9B%84%E5%B8%82%E5%A4%A7%E7%A4%BE%E5%8D%80%E5%92%8C%E5%B9%B3%E8%B7%AF%EF%BC%91%E6%AE%B530%E8%99%9F","extra":""},{"zip5":"90242","zip3":"902","city":"屏東縣","area":"霧台鄉","rsgd":"和平路1段","range":"全","weight":15,"restaddr":"30號","possibility":"中","similiar":"","fulladdr":"90242 屏東縣霧台鄉和平路1段30號","urladdr":"%E5%B1%8F%E6%9D%B1%E7%B8%A3%E9%9C%A7%E5%8F%B0%E9%84%89%E5%92%8C%E5%B9%B3%E8%B7%AF%EF%BC%91%E6%AE%B530%E8%99%9F","extra":""},{"zip5":"42448","zip3":"424","city":"台中市","area":"和平區","rsgd":"和平路1段","range":"全","weight":15,"restaddr":"30號","possibility":"中","similiar":"","fulladdr":"42448 台中市和平區和平路1段30號","urladdr":"%E5%8F%B0%E4%B8%AD%E5%B8%82%E5%92%8C%E5%B9%B3%E5%8D%80%E5%92%8C%E5%B9%B3%E8%B7%AF%EF%BC%91%E6%AE%B530%E8%99%9F","extra":""}],"cnt":4}
無符合解+(可能解)
{"oaddr":"桃園市蘆竹區南祥路81之6號","ack":-4,"msg":"無符合結果","answer":{"moss":[{"zone":"桃園市蘆竹區南祥路","zip3":"338","hasjudged":"33858=> 桃園市蘆竹區南祥路單 25號以下33858=> 桃園市蘆竹區南祥路雙 20號以下33854=> 桃園市蘆竹區南祥路單 99號以上33854=> 桃園市蘆竹區南祥路雙 102號以上"}],"zip3":[],"closest":[{"zip5":"33392","city":"桃園市","area":"龜山區","rsgd":"南祥路","range":"全","restaddr":"81之6號","possibility":"高","fulladdr":"33392 桃園市龜山區南祥路81之6號","urladdr":"%E6%A1%83%E5%9C%92%E5%B8%82%E9%BE%9C%E5%B1%B1%E5%8D%80%E5%8D%97%E7%A5%A5%E8%B7%AF81%E4%B9%8B6%E8%99%9F"}]}}
只能查到三碼
{"oaddr":"台南市東區德門街151巷88弄11號","ack":-3,"msg":"僅分析出三碼","answer":[{"zip3":"701","city":"台南市","area":"東區"}]}

取得JSONP格式

上例中,帶入的參數中多加 callback=functionname,就會得到 JSONP的格式,此參數和下例中simple=1合用則失效。

傳入地址查詢最簡使用方式

同上,查詢時用GET方式帶入simple=1、se值和addr地址即可,但此方式只會傳回唯一解五碼或是st值字串,適合大量地址查碼。範例

http://zipko.info/twidx/q?simple=1&se=8456231-1&addr=凱達格蘭大道1號

一組解
10048
多組解
2
無解或錯誤
-4
只能查到三碼
-3
反查
3

傳入五碼郵遞區號反查區域的方式

同上,查詢時用GET方式帶入se值和addr=五碼郵區號即可,例如查詢40673:

http://zipko.info/twidx/q?se=8456231-1&addr=40673

反查
{"oaddr":"40673","ack":3,"msg":"反查結果","answer":[{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"松竹路2段","range":"雙 180號至 460號"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"豐樂路","range":"連 57號以下"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"崇德路3段","range":"單 677號以下"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"昌平路2段","range":"雙 12之 8號至 38號"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"崇德路3段","range":"雙 638之 1號以下"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"崇武街","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"崇仁街","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"九甲巷","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"遼陽三街","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"崇文街","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"梅川北街","range":"全"},{"zip5":"40673","city":"台中市","area":"北屯區","rsgd":"陸光九村","range":"全"}]}

http://zipko.info/twidx/q?se=8456231-1&addr=407

反查3碼
{"oaddr":"407","ack":3,"msg":"反查結果","answer":{"city":"台中市","area":"西屯區","cnt":1}}

程式地址索引

使用GET方式帶入se值和參數可傳回階層的 JSONP 格式。

程式地址索引--選取縣市

http://zipko.info/twidx/g1?se=8456231-1

[{"citycode":"1","city":"台北市"},{"citycode":"2","city":"台中市"},{"citycode":"3","city":"新北市"},{"citycode":"4","city":"高雄市"},{"citycode":"5","city":"台南市"},{"citycode":"6","city":"新竹市"},{"citycode":"7","city":"嘉義市"},{"citycode":"8","city":"嘉義縣"},{"citycode":"9","city":"彰化縣"},{"citycode":"10","city":"桃園市"},{"citycode":"11","city":"南投縣"},{"citycode":"12","city":"新竹縣"},{"citycode":"13","city":"屏東縣"},{"citycode":"14","city":"基隆市"},{"citycode":"15","city":"雲林縣"},{"citycode":"16","city":"苗栗縣"},{"citycode":"17","city":"澎湖縣"},{"citycode":"18","city":"台東縣"},{"citycode":"19","city":"宜蘭縣"},{"citycode":"20","city":"花蓮縣"},{"citycode":"21","city":"金門縣"},{"citycode":"22","city":"連江縣"}]
程式地址索引--選取鄉鎮市區

代入citycode值選取鄉鎮 cd=citycode,例如代入cd=1選取台北市鄉鎮市區

http://zipko.info/twidx/g2?cd=1&se=8456231-1

[{"citycode":"1","areacode":"1","area":"士林區","zip3":"111"},{"citycode":"1","areacode":"2","area":"大同區","zip3":"103"},{"citycode":"1","areacode":"3","area":"大安區","zip3":"106"},{"citycode":"1","areacode":"4","area":"中山區","zip3":"104"},{"citycode":"1","areacode":"5","area":"中正區","zip3":"100"},{"citycode":"1","areacode":"6","area":"內湖區","zip3":"114"},{"citycode":"1","areacode":"7","area":"文山區","zip3":"116"},{"citycode":"1","areacode":"8","area":"北投區","zip3":"112"},{"citycode":"1","areacode":"9","area":"松山區","zip3":"105"},{"citycode":"1","areacode":"10","area":"信義區","zip3":"110"},{"citycode":"1","areacode":"11","area":"南港區","zip3":"115"},{"citycode":"1","areacode":"12","area":"萬華區","zip3":"108"}]
程式地址索引--選取路街

代入areacode值選取路街 cd=areacode,例如代入cd=6選取台北市內湖區

http://zipko.info/twidx/g3?cd=6&se=8456231-1

[{"rsgdcode":"449","city":"台北市","area":"內湖區","rsgd":"五分街"},{"rsgdcode":"450","city":"台北市","area":"內湖區","rsgd":"內湖路1段"},{"rsgdcode":"451","city":"台北市","area":"內湖區","rsgd":"內湖路2段"},{"rsgdcode":"452","city":"台北市","area":"內湖區","rsgd":"內湖路3段"},{"rsgdcode":"453","city":"台北市","area":"內湖區","rsgd":"南京東路6段"},{"rsgdcode":"454","city":"台北市","area":"內湖區","rsgd":"基湖路"},{"rsgdcode":"455","city":"台北市","area":"內湖區","rsgd":"堤頂大道1段"},{"rsgdcode":"456","city":"台北市","area":"內湖區","rsgd":"堤頂大道2段"},{"rsgdcode":"457","city":"台北市","area":"內湖區","rsgd":"大湖山莊街"},{"rsgdcode":"458","city":"台北市","area":"內湖區","rsgd":"大湖街"},{"rsgdcode":"459","city":"台北市","area":"內湖區","rsgd":"安康路"},{"rsgdcode":"460","city":"台北市","area":"內湖區","rsgd":"安泰街"},{"rsgdcode":"461","city":"台北市","area":"內湖區","rsgd":"安美街"},{"rsgdcode":"462","city":"台北市","area":"內湖區","rsgd":"康寧路1段"},{"rsgdcode":"463","city":"台北市","area":"內湖區","rsgd":"康寧路3段"},{"rsgdcode":"464","city":"台北市","area":"內湖區","rsgd":"康樂街"},{"rsgdcode":"465","city":"台北市","area":"內湖區","rsgd":"康湖路"},{"rsgdcode":"466","city":"台北市","area":"內湖區","rsgd":"成功路2段"},{"rsgdcode":"467","city":"台北市","area":"內湖區","rsgd":"成功路3段"},{"rsgdcode":"468","city":"台北市","area":"內湖區","rsgd":"成功路4段"},{"rsgdcode":"469","city":"台北市","area":"內湖區","rsgd":"成功路5段"},{"rsgdcode":"470","city":"台北市","area":"內湖區","rsgd":"文德路"},{"rsgdcode":"471","city":"台北市","area":"內湖區","rsgd":"文湖街"},{"rsgdcode":"472","city":"台北市","area":"內湖區","rsgd":"新富街"},{"rsgdcode":"473","city":"台北市","area":"內湖區","rsgd":"新明路"},{"rsgdcode":"474","city":"台北市","area":"內湖區","rsgd":"新湖一路"},{"rsgdcode":"475","city":"台北市","area":"內湖區","rsgd":"新湖三路"},{"rsgdcode":"476","city":"台北市","area":"內湖區","rsgd":"新湖二路"},{"rsgdcode":"477","city":"台北市","area":"內湖區","rsgd":"新豐街"},{"rsgdcode":"478","city":"台北市","area":"內湖區","rsgd":"星雲街"},{"rsgdcode":"479","city":"台北市","area":"內湖區","rsgd":"東湖路"},{"rsgdcode":"480","city":"台北市","area":"內湖區","rsgd":"民善街"},{"rsgdcode":"481","city":"台北市","area":"內湖區","rsgd":"民權東路6段"},{"rsgdcode":"482","city":"台北市","area":"內湖區","rsgd":"永保街"},{"rsgdcode":"483","city":"台北市","area":"內湖區","rsgd":"江南街"},{"rsgdcode":"484","city":"台北市","area":"內湖區","rsgd":"洲子街"},{"rsgdcode":"485","city":"台北市","area":"內湖區","rsgd":"港墘路"},{"rsgdcode":"486","city":"台北市","area":"內湖區","rsgd":"港華街"},{"rsgdcode":"487","city":"台北市","area":"內湖區","rsgd":"潭美街"},{"rsgdcode":"488","city":"台北市","area":"內湖區","rsgd":"瑞光路"},{"rsgdcode":"489","city":"台北市","area":"內湖區","rsgd":"瑞湖街"},{"rsgdcode":"490","city":"台北市","area":"內湖區","rsgd":"環山路1段"},{"rsgdcode":"491","city":"台北市","area":"內湖區","rsgd":"環山路2段"},{"rsgdcode":"492","city":"台北市","area":"內湖區","rsgd":"環山路3段"},{"rsgdcode":"493","city":"台北市","area":"內湖區","rsgd":"石潭路"},{"rsgdcode":"494","city":"台北市","area":"內湖區","rsgd":"碧山路"},{"rsgdcode":"495","city":"台北市","area":"內湖區","rsgd":"粉寮街"},{"rsgdcode":"496","city":"台北市","area":"內湖區","rsgd":"舊宗路1段"},{"rsgdcode":"497","city":"台北市","area":"內湖區","rsgd":"舊宗路2段"},{"rsgdcode":"498","city":"台北市","area":"內湖區","rsgd":"行善路"},{"rsgdcode":"499","city":"台北市","area":"內湖區","rsgd":"行忠路"},{"rsgdcode":"500","city":"台北市","area":"內湖區","rsgd":"行愛路"},{"rsgdcode":"501","city":"台北市","area":"內湖區","rsgd":"金湖路"},{"rsgdcode":"502","city":"台北市","area":"內湖區","rsgd":"金莊路"},{"rsgdcode":"503","city":"台北市","area":"內湖區","rsgd":"金豐街"},{"rsgdcode":"504","city":"台北市","area":"內湖區","rsgd":"金龍路"},{"rsgdcode":"505","city":"台北市","area":"內湖區","rsgd":"陽光街"},{"rsgdcode":"506","city":"台北市","area":"內湖區","rsgd":"麗山街"}]
當您查了很多次以後,點個廣告,感謝您!
或請我們一杯咖啡,只花您三分鐘+$50
台灣最熱門也最準確查詢郵碼網站,歡迎投放廣告
300x90~300