郵便番号 REST API

APIドキュメント

REST APIサンプル

サンプル

新橋を含む郵便番号の一覧
$ curl -s 'https://postcode.teraren.com/postcodes.json?s=新橋&per=3' | jq
[
  {
    "jis": "01206",
    "old": "085",
    "new": "0850046",
    "prefecture_kana": "ホッカイドウ",
    "city_kana": "クシロシ",
    "suburb_kana": "シンバシオオドオリ",
    "prefecture": "北海道",
    "city": "釧路市",
    "suburb": "新橋大通",
    "is_separated_suburb": 0,
    "is_koaza": 0,
    "is_chome": 1,
    "is_include_area": 0,
    "status": 0,
    "reason": 0,
    "url": "https://postcode.teraren.com/postcodes/0850046.json"
  },
  {
    "jis": "04202",
    "old": "986",
    "new": "9860878",
    "prefecture_kana": "ミヤギケン",
    "city_kana": "イシノマキシ",
    "suburb_kana": "シンバシ",
    "prefecture": "宮城県",
    "city": "石巻市",
    "suburb": "新橋",
    "is_separated_suburb": 0,
    "is_koaza": 0,
    "is_chome": 0,
    "is_include_area": 0,
    "status": 0,
    "reason": 0,
    "url": "https://postcode.teraren.com/postcodes/9860878.json"
  },
  {
    "jis": "04213",
    "old": "98956",
    "new": "9895617",
    "prefecture_kana": "ミヤギケン",
    "city_kana": "クリハラシ",
    "suburb_kana": "シワヒメシンハシモト",
    "prefecture": "宮城県",
    "city": "栗原市",
    "suburb": "志波姫新橋本",
    "is_separated_suburb": 0,
    "is_koaza": 0,
    "is_chome": 0,
    "is_include_area": 0,
    "status": 0,
    "reason": 0,
    "url": "https://postcode.teraren.com/postcodes/9895617.json"
  }
]
郵便番号323−0831の詳細を取得
$ curl -s https://postcode.teraren.com/postcodes/3230831.json | jq
{
  "postcode_type": "area",
  "jis": "09208",
  "old": "323",
  "new": "3230831",
  "prefecture_kana": "トチギケン",
  "city_kana": "オヤマシ",
  "suburb_kana": "アマガヤチョウ",
  "prefecture": "栃木県",
  "city": "小山市",
  "suburb": "雨ケ谷町",
  "street_address": null,
  "office": null,
  "office_kana": null,
  "post_type": null,
  "is_separated_suburb": 0,
  "is_koaza": 0,
  "is_chome": 0,
  "is_include_area": 0,
  "status": 0,
  "reason": 0,
  "created_at": "2022-05-17T05:11:51.000Z",
  "updated_at": "2022-05-17T05:11:51.000Z"
}

Webページに設置するサンプル

デモ

サンプルコード