このページは imi-enrichment-address の WebAPI の動作確認ページです。
変換 ボタンを押すとこのブラウザから実際に WebAPI を実行して結果を表示します
現在表示されている URL に POST メソッドを使って住所文字列 または JSON を送信すると変換結果の JSON が出力されます。
住所文字列を変換する場合には Content-Type: text/plain を指定して POST します
$ curl -X POST -H 'Content-Type: text/plain' -d '東京都千代田区霞が関1-3-1' __ENDPOINT__
{
"@type": "場所型",
"住所": {
"@type": "住所型",
"表記": "東京都千代田区霞が関1-3-1",
"都道府県": "東京都",
"都道府県コード": "http://data.e-stat.go.jp/lod/sac/C13000",
"市区町村": "千代田区",
"市区町村コード": "http://data.e-stat.go.jp/lod/sac/C13101",
"町名": "霞が関",
"丁目": "1",
"番地": "3",
"号": "1"
},
"地理座標": {
"@type": "座標型",
"緯度": "35.673944",
"経度": "139.752558"
}
}
JSON を変換する場合には Content-Type: application/json を指定して POST します
$ curl -X POST -H 'Content-Type: application/json' -d '{"@type":"住所型","表記":"東京都千代田区霞が関1-3-1"}' __ENDPOINT__
{
"@type": "住所型",
"表記": "東京都千代田区霞が関1-3-1",
"都道府県": "東京都",
"都道府県コード": "http://data.e-stat.go.jp/lod/sac/C13000",
"市区町村": "千代田区",
"市区町村コード": "http://data.e-stat.go.jp/lod/sac/C13101",
"町名": "霞が関",
"丁目": "1",
"番地": "3",
"号": "1"
}
住所文字列を変換する場合には Content-Type: text/plain を指定して POST します
fetch("__ENDPOINT__", {
method: "POST",
headers: {
"Content-Type": "text/plain"
},
body: "東京都千代田区霞が関1-3-1"
}).then(function(response) {
return response.ok ? response.json() : response.text();
}).then(function(result) {
console.log(result);
});
JSON を変換する場合には Content-Type: application/json を指定して POST します
fetch("__ENDPOINT__", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: '{"@type":"場所型","住所":{"@type":"住所型","表記":"東京都千代田区霞が関1-3-1"}}'
}).then(function(response) {
return response.ok ? response.json() : response.text();
}).then(function(result) {
console.log(result);
});