- go-jpostcode is a Go package to find Japanese address data from Japanese postal code.
- This package was created to provide data from https://github.com/kufu/jpostcode-data
- This package requires Go 1.16+.
// Find an address
address, err := jpostcode.Find("0010928")
// Search addresses (Some addresses have same postal code)
addresses, err := jpostcode.Search("1138654")
// Print address as a JSON
addressJSON, err := address.ToJSON()
if err != nil { // error handling }
fmt.Println(addressJSON)
$ go run example/server/main.go
$ curl http://localhost:8090/0010928
- A CLI tool is given as jpost.
go install github.com/syumai/go-jpostcode/cmd/jpost@latest
- To get address, just give postal code as argument.
# Get address from postal code: 0010928.
$ jpost 0010928
{"postcode":"0010928","prefecture":"北海道",...
$ make update
- MIT