zipcode_jp provides Japan zip code database/API that is build by JSON file structure. You can setup your own database/API on your Web storage.
- Clone this repository.
- Publish /docs directory.
docs/
zip_code/
001/
0010000.json
0010010.json
...
<script type="text/javascript" src="https://your.api.server/api.js"></script>
<script type="text/javascript">
ZipCodeJp.setZipCodeBaseUrl('https://your.api.server/zip_code');
ZipCodeJp.getAddressesOfZipCode('6000000', function(err, addresses) {console.log(err); console.log(addresses)});
ZipCodeJp.getPrefectures(function(err, prefectures) {console.log(err); console.log(prefectures)});
ZipCodeJp.getCitiesOfPrefecture('01', function(err, cities) {console.log(err); console.log(cities)});
ZipCodeJp.getTownsOfCity('01220', function(err, towns) {console.log(err); console.log(towns)});
</script>
Live demo https://kmdsbng.github.io/zipcode_jp_react_sample/dist/
jsfiddle https://jsfiddle.net/kmdsbng/f18t60yj/12/
MIT
zipcode_jp uses x-ken-all.csv provided by zipcloud.