{"openapi":"3.1.0","info":{"title":"Queria Geocoder","version":"0.3.0","description":"日本の住所と座標・地域コードを相互に変換する無料の API。API キーは不要。\n\n- `GET /v1/forward`: 住所 1 件を座標と地域コードに変換する\n- `POST /v1/forward/batch`: 住所を 25 件までまとめて変換する。結果は住所ごとに `/v1/forward` と同じ形\n- `GET /v1/forward/batch`: POST と同じ一括変換を、住所をクエリに入れて呼ぶ。DuckDB の `read_json` のように URL しか読めないツール向け\n- `GET /v1/reverse`: 座標から市区町村・国勢調査の小地域のコードを取得する\n- `GET /v1/autocomplete`: 途中まで書いた住所の続きの候補 (都道府県・市区町村・町字・番地) を返す\n- `GET /v1/codes/{system}/{code}`: 町字 ID・郵便番号・小地域コード・市区町村コード・3 次メッシュを、名前・代表点と他の体系のコードに変換する\n\n結果に含める項目は `include` で選ぶ（例: `include=ids,codes,small_area`）。既定は座標と照合の結果だけ。\n\n1 つの IP アドレスから 1 分に 300 回まで（一括は 1 回の呼び出しで 1 回と数える）。結果を公開するときは `source.attribution` の出典も表示する。\n\n`info.version` はセマンティックバージョニングで付ける。1.0.0 より前は互換性を約束しない。1.0.0 からは、応答の項目と列挙の値を消さず、意味を変えない (足すことはある。知らない項目と値は無視する)。1.0.0 より前に変えるときも変更履歴に書く。照合の結果は、データの更新と照合の改善で変わる。互換性の約束と変更履歴は [GitHub](https://github.com/queria-io/geocoder#api-の互換性) にある。\n\n概要と精度は [queria.io/geocoder](https://queria.io/geocoder)、ソースコードは [GitHub](https://github.com/queria-io/geocoder) を参照。"},"components":{"schemas":{"GeocodeResponse":{"allOf":[{"$ref":"#/components/schemas/ForwardItem"},{"type":"object","properties":{"source":{"$ref":"#/components/schemas/Source"}},"required":["source"]}]},"GeocodeResult":{"type":"object","properties":{"matched_address":{"type":"string","description":"照合できた住所の表記"},"unmatched_address":{"type":["array","null"],"items":{"type":"string"},"description":"照合できずに残った部分 (番号・建物名など)。残りが無ければ null"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"match_level":{"type":"string","enum":["pref","city","machiaza","machiaza_detail","rsdtdsp_blk","rsdtdsp_rsdt","parcel"],"description":"住所をどの階層まで照合できたか。rsdtdsp_rsdt は号、rsdtdsp_blk は街区、parcel は地番、machiaza_detail は小字、machiaza は町字"},"coordinates_level":{"type":["string","null"],"enum":["pref","city","machiaza","machiaza_detail","rsdtdsp_blk","rsdtdsp_rsdt","parcel","parcel_parent",null],"description":"座標を取った代表点の階層。値の意味は match_level と同じ。番号まで照合できてもその代表点に座標が無ければ、地番は親番の点 (parcel_parent)、それも無ければ町字の代表点で埋め、machiaza になる。parcel_parent は地番の親番 (「28番地10」の「28」) の点で、ABR の親番の筆の点、国交省の街区レベル位置参照情報の点、ABR の枝番の筆の点の平均の順に取る (ABR にその地番の点が無いとき)。どれも代表点で、建物の位置ではない"},"lg_code":{"type":["string","null"],"description":"全国地方公共団体コード (6 桁、検査数字つき)"},"ambiguous":{"type":"boolean","description":"住所から 1 つに決められない候補が複数あり、そのうち 1 つを選んだか。市区町村名の無い住所で同じ町名を持つ市区町村が複数あるときと、地番に甲乙丙丁が書かれておらず、甲乙丙丁の違いだけの地番が複数あるときに true になる。市区町村は prefecture_code・city_code で絞れる"},"candidates":{"type":"integer","description":"照合できた候補の数 (ふつうは 1)。市区町村の候補は人口の多い順、地番の候補は代表点の優先順位の順に並ぶ。limit を増やすと全部を受け取れる"},"score":{"type":"number","description":"include=match のときだけ"},"structured_address":{"$ref":"#/components/schemas/StructuredAddress"},"ids":{"$ref":"#/components/schemas/Ids"},"codes":{"$ref":"#/components/schemas/ForwardCodes"},"estat_small_area_code":{"type":["string","null"],"description":"座標が入る国勢調査の小地域コード。include=small_area のときだけ"},"evidence":{"$ref":"#/components/schemas/Evidence"}},"required":["matched_address","unmatched_address","lat","lng","match_level","coordinates_level","lg_code","ambiguous","candidates"]},"StructuredAddress":{"type":"object","properties":{"pref":{"type":["string","null"]},"county":{"type":["string","null"]},"city":{"type":["string","null"]},"ward":{"type":["string","null"]},"kyoto_st":{"type":["string","null"]},"oaza_cho":{"type":["string","null"]},"chome":{"type":["string","null"]},"koaza":{"type":["string","null"]},"machiaza_dist":{"type":["string","null"]},"blk_num":{"type":["string","null"]},"rsdt_num":{"type":["string","null"]},"rsdt_num2":{"type":["string","null"]},"prc_num1":{"type":["string","null"]},"prc_num2":{"type":["string","null"]},"prc_num3":{"type":["string","null"]}},"required":["pref","county","city","ward","kyoto_st","oaza_cho","chome","koaza","machiaza_dist","blk_num","rsdt_num","rsdt_num2","prc_num1","prc_num2","prc_num3"],"description":"include=structured_address のときだけ"},"Ids":{"type":"object","properties":{"lg_code":{"type":["string","null"]},"machiaza_id":{"type":["string","null"]},"rsdt_addr_flg":{"type":["string","null"]},"blk_id":{"type":["string","null"]},"rsdt_id":{"type":["string","null"]},"rsdt2_id":{"type":["string","null"]},"prc_id":{"type":["string","null"]},"machiaza_code":{"type":["string","null"],"description":"lg_code と machiaza_id をつないだ 13 桁。/v1/codes/machiaza/{machiaza_code} にそのまま渡せる。町字まで照合できなければ null"}},"required":["lg_code","machiaza_id","rsdt_addr_flg","blk_id","rsdt_id","rsdt2_id","prc_id","machiaza_code"],"description":"include=ids のときだけ"},"ForwardCodes":{"type":"object","properties":{"prefecture_code":{"type":["string","null"],"description":"都道府県コード (2 桁)"},"city_code":{"type":["string","null"],"description":"全国地方公共団体コードの頭 5 桁。都道府県までなら null"},"postal_code":{"type":["string","null"],"description":"町字の郵便番号 (7 桁)"},"mesh_1km":{"type":["string","null"],"description":"標準地域メッシュ (3 次、8 桁)"},"mesh_500m":{"type":["string","null"],"description":"2 分の 1 地域メッシュ (9 桁)"},"mesh_250m":{"type":["string","null"],"description":"4 分の 1 地域メッシュ (10 桁)"}},"required":["prefecture_code","city_code","postal_code","mesh_1km","mesh_500m","mesh_250m"],"description":"include=codes のときだけ"},"Evidence":{"type":"object","properties":{"point":{"$ref":"#/components/schemas/EvidencePoint"},"matched":{"type":"object","properties":{"area":{"type":["string","null"],"description":"照合した区域の名前 (照合の索引の表記)"},"number":{"type":["string","null"],"description":"照合した番号 (「3-1」)"},"skipped":{"type":["string","null"],"description":"区域と番号の間で読み飛ばした文字 (正規化した表記。数字は算用数字、区切りは「-」)。無ければ null"}},"required":["area","number","skipped"],"description":"住所のどこをどの区域・番号に照合したか"},"steps":{"type":"array","items":{"type":"string","enum":["former_city","renamed_ward","city_inferred","ward_inferred","kyoto_street_skipped","oaza_omitted","aza_skipped","number_tail","partway","text_skipped","prefix_dropped","prefix_added"]},"description":"上流 (abr-geocoder) の照合の後に使った段 (使った順)。former_city: 旧市区町村名を今の市区町村名に読み替えた。renamed_ward: 浜松市の旧区名を今の区名に読み替えた。city_inferred: 市区町村名の無い住所で、町名から市区町村を推定した (同じ町名の市区町村が複数なら candidates が 2 以上)。ward_inferred: 政令市の市名を省いて区から書いた住所で、市名を補った。kyoto_street_skipped: 市区町村名の無い住所で、頭の京都の通り名を外して町名を引いた。oaza_omitted: 大字を省いた丁目の住所で、大字を補った (照合の索引の無いデータだけ。索引があれば区域と番号は索引で引き直す)。aza_skipped: ABR に無い小字の名前を外して、大字と番号で照合した (照合の索引の無いデータだけ。索引があれば区域と番号は索引で引き直す)。number_tail: 番号の書き方 (「28街区28号」など) や番号の後ろの建物名を読み替えて照合した (照合の索引の無いデータだけ。索引があれば区域と番号は索引で引き直す)。partway: 住所の頭からは区域に照合できず、途中から区域を読んだ。text_skipped: 区域と番号の間の、索引に無い文字を読み飛ばした (skipped)。prefix_dropped: 番号の頭の甲乙丙丁を外した番号の点を使った。prefix_added: 甲乙丙丁が書かれていない番号に、甲乙丙丁を付けた番号の点を使った (候補が複数なら candidates が 2 以上)"}},"required":["point","matched","steps"],"description":"include=evidence のときだけ"},"EvidencePoint":{"type":["object","null"],"properties":{"dataset":{"type":["string","null"],"enum":["address_br","nlftp",null],"description":"点を取った Queria のデータセット。address_br はアドレス・ベース・レジストリ (デジタル庁)、nlftp は国土数値情報の街区レベル位置参照情報 (国土交通省)。ほかの点から求めた町字の代表点 (machiaza_derived) は null"},"point_type":{"type":"string","enum":["rsdt","block","parcel","parcel_parent","history","machiaza","machiaza_derived","city","pref"],"description":"点の種類。rsdt は住居表示の住居、block は住居表示の街区、parcel は地番、parcel_parent は地番の親番、history は位置参照情報の過去のバージョンの点、machiaza は町字の代表点、machiaza_derived は町字に自前の代表点が無く、上位の町字の点や下の点の平均などから求めた点 (dataset は null)、city は市区町村の代表点、pref は都道府県の代表点"},"rank":{"type":["integer","null"],"description":"同じ住所に点が複数あるときの優先順位 (小さいほど先)。町字・市区町村・都道府県の代表点は null"},"keys":{"type":"object","properties":{"lg_code":{"type":["string","null"]},"machiaza_id":{"type":["string","null"]},"blk_id":{"type":["string","null"]},"rsdt_id":{"type":["string","null"]},"rsdt2_id":{"type":["string","null"]},"prc_id":{"type":["string","null"]},"number":{"type":["string","null"],"description":"点の行の番号 (「3-1」)。点の無い地番を親番の点で照合したときは、点を取った親番 (「45」)"}},"required":["lg_code","machiaza_id","blk_id","rsdt_id","rsdt2_id","prc_id","number"],"description":"点の行の鍵。ID は ABR の ID。blk_id・rsdt_id・prc_id は ABR の住居表示・地番の表から引いた点だけに入り、照合の索引の番号の点 (位置参照情報の点、ABR の親番の平均、起番でない小字の地番) は lg_code・machiaza_id と number で引く"}},"required":["dataset","point_type","rank","keys"],"description":"座標を取った点。座標が無いとき、市区町村まで照合できなかったとき、照合の索引の無いデータ、点の種類か出典がこの一覧に無いときは null"},"Source":{"type":"object","properties":{"dataset":{"type":["string","null"],"description":"結果に使った Queria のデータセット (所有者/名前)。境界タイルだけを読んだ逆引き (include=address なし) は null"},"version":{"type":"string","description":"結果に使ったデータのバージョン"},"attribution":{"type":"array","items":{"type":"string"},"description":"出典の表示。結果を公開するときは一緒に表示する"}},"required":["dataset","version","attribution"]},"ForwardItem":{"type":"object","properties":{"address":{"type":"string","description":"渡した住所"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GeocodeResult"},"description":"一致の度合いの高い順。照合できない住所と、空や長すぎる住所 (一括のとき) は空の配列"}},"required":["address","results"]},"GeocodeFeatureCollection":{"type":"object","properties":{"type":{"type":"string","enum":["FeatureCollection"]},"query":{"type":"object","properties":{"address":{"type":"string"},"limit":{"type":"number"}},"required":["address","limit"]},"result_info":{"type":"object","properties":{"count":{"type":"number"},"limit":{"type":"number"},"api_version":{"type":"string"},"db_version":{"type":"string"}},"required":["count","limit","api_version","db_version"]},"features":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["Feature"]},"geometry":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}]}},"required":["type","coordinates"]},"properties":{"type":"object","properties":{"matched_address":{"type":"string"},"unmatched_address":{"type":["array","null"],"items":{"type":"string"}},"score":{"type":"number"},"match_level":{"type":"string","enum":["pref","city","machiaza","machiaza_detail","rsdtdsp_blk","rsdtdsp_rsdt","parcel"]},"coordinates_level":{"type":["string","null"],"enum":["pref","city","machiaza","machiaza_detail","rsdtdsp_blk","rsdtdsp_rsdt","parcel","parcel_parent",null]},"ids":{"$ref":"#/components/schemas/AbrIds"},"structured_address":{"allOf":[{"$ref":"#/components/schemas/StructuredAddress"},{"description":"住所の区切り。項目名は abr-geocoder と同じ"}]},"ambiguous":{"type":"boolean"},"candidates":{"type":"integer"},"codes":{"$ref":"#/components/schemas/ForwardCodes"},"estat_small_area_code":{"type":["string","null"],"description":"座標が入る国勢調査の小地域コード。include=small_area のときだけ"},"evidence":{"$ref":"#/components/schemas/Evidence"}},"required":["matched_address","unmatched_address","score","match_level","coordinates_level","ids","structured_address","ambiguous","candidates"]}},"required":["type","geometry","properties"]}},"attribution":{"type":"array","items":{"type":"string"},"description":"出典の表示"}},"required":["type","query","result_info","features","attribution"],"description":"format=geojson のとき。abr-geocoder の /geocode と同じ形"},"AbrIds":{"type":"object","properties":{"lg_code":{"type":["string","null"]},"machiaza_id":{"type":["string","null"]},"rsdt_addr_flg":{"type":["string","null"]},"blk_id":{"type":["string","null"]},"rsdt_id":{"type":["string","null"]},"rsdt2_id":{"type":["string","null"]},"prc_id":{"type":["string","null"]}},"required":["lg_code","machiaza_id","rsdt_addr_flg","blk_id","rsdt_id","rsdt2_id","prc_id"],"description":"ABR の ID。rsdt_addr_flg は '1' が住居表示、'0' が地番の町字、決まらなければ null。丁目を省いた町名 (「学園南」) に照合したときの machiaza_id は、丁目の町字 ID の頭 4 桁 (大字・町) に 000 を付けたもので、ABR の町字の表には行が無いことがある"},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","method_not_allowed","rate_limited","internal"],"description":"エラーの種類。invalid_request は 400、not_found は 404、method_not_allowed は 405、rate_limited は 429、internal は 502"},"message":{"type":"string","description":"人が読む説明"}},"required":["code","message"]}},"required":["error"]},"BatchResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ForwardItem"},"description":"渡した住所と同じ順・同じ数。中身は /v1/forward と同じ"},"source":{"$ref":"#/components/schemas/Source"}},"required":["results","source"]},"BatchRequest":{"type":"object","properties":{"addresses":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":25},"limit":{"type":"integer","minimum":1,"maximum":10,"description":"/v1/forward と同じ。住所ごとに効く"},"include":{"type":"string","description":"/v1/forward と同じ"},"prefecture_code":{"type":"string","pattern":"^\\d{2}$","description":"/v1/forward と同じ。全部の住所に効く"},"city_code":{"type":"string","pattern":"^\\d{5,6}$","description":"/v1/forward と同じ。全部の住所に効く"}},"required":["addresses"]},"ReverseResult":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"lg_code":{"type":["string","null"],"description":"全国地方公共団体コード (6 桁、検査数字つき)"},"estat_small_area_code":{"type":["string","null"],"description":"国勢調査の小地域コード。ABR の町字ではない"},"match_level":{"type":["string","null"],"enum":["prefecture","city","small_area",null],"description":"点が実際に入った区画の階層。どこにも入らなければ null"},"address":{"type":["object","null"],"properties":{"matched_address":{"type":"string","description":"近くの点の住所"},"match_level":{"type":"string","description":"住所がどこまで細かいか (machiaza・machiaza_detail・rsdtdsp_blk・rsdtdsp_rsdt)"},"lat":{"type":"number","description":"その住所の点の緯度"},"lng":{"type":"number","description":"その住所の点の経度"},"distance_m":{"type":"number","description":"渡した座標からその点までの距離 (m)"},"machiaza_id":{"type":"string","description":"ABR の町字 ID (7 桁)"}},"required":["matched_address","match_level","lat","lng","distance_m","machiaza_id"],"description":"include=address のときだけ。市区町村の中でいちばん近い町字・街区・住居の点の住所。町字の形は見ていないので、境目の近くでは隣の町字になることがある。市区町村に入らなければ null"},"codes":{"$ref":"#/components/schemas/ReverseCodes"},"source":{"$ref":"#/components/schemas/Source"}},"required":["lat","lng","lg_code","estat_small_area_code","match_level","source"]},"ReverseCodes":{"type":"object","properties":{"prefecture_code":{"type":["string","null"],"description":"都道府県コード (2 桁)"},"city_code":{"type":["string","null"],"description":"全国地方公共団体コードの頭 5 桁"},"mesh_1km":{"type":"string","description":"標準地域メッシュ (3 次、8 桁)"},"mesh_500m":{"type":"string","description":"2 分の 1 地域メッシュ (9 桁)"},"mesh_250m":{"type":"string","description":"4 分の 1 地域メッシュ (10 桁)"}},"required":["prefecture_code","city_code","mesh_1km","mesh_500m","mesh_250m"],"description":"include=codes のときだけ"},"AutocompleteResponse":{"type":"object","properties":{"address":{"type":"string","description":"渡した住所"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Suggestion"},"description":"候補。無ければ空の配列"},"source":{"$ref":"#/components/schemas/Source"}},"required":["address","results","source"]},"Suggestion":{"type":"object","properties":{"address":{"type":"string","description":"都道府県から書いた住所。番地は住居表示なら「○番」、地番なら「○番地」で終わる"},"level":{"type":"string","enum":["pref","city","machiaza","block","parcel"],"description":"候補の階層。pref は都道府県、city は市区町村、machiaza は町字、block は住居表示の街区、parcel は地番の本番"},"prefecture_code":{"type":"string","description":"都道府県コード (2 桁)"},"lg_code":{"type":["string","null"],"description":"全国地方公共団体コード (6 桁、検査数字つき)。都道府県の候補は null"},"machiaza_id":{"type":["string","null"],"description":"ABR の町字 ID (7 桁)。町字と番地の候補だけ"},"machiaza_code":{"type":["string","null"],"description":"lg_code と machiaza_id をつないだ 13 桁。/v1/codes/machiaza/{machiaza_code} にそのまま渡せる。町字と番地の候補だけ"},"number":{"type":["string","null"],"description":"街区符号か地番の本番。番地の候補だけ"},"postal_code":{"type":["string","null"],"description":"町字の郵便番号 (7 桁)。町字と番地の候補で、町字に 1 つに決まるときだけ"},"lat":{"type":["number","null"],"description":"代表点の緯度。地番は同じ本番の筆の点の平均。点が無ければ null"},"lng":{"type":["number","null"],"description":"代表点の経度"}},"required":["address","level","prefecture_code","lg_code","machiaza_id","machiaza_code","number","postal_code","lat","lng"]},"CodeResult":{"type":"object","properties":{"system":{"type":"string","enum":["machiaza","postal_code","small_area","city","mesh_1km"]},"code":{"type":"string","description":"渡したコード (郵便番号はハイフンを外したもの)"},"name":{"type":["string","null"],"description":"都道府県から書いた名前。町字・小地域・市区町村だけ。郵便番号とメッシュは null"},"lat":{"type":["number","null"],"description":"代表点の緯度。メッシュは中心。郵便番号は null"},"lng":{"type":["number","null"],"description":"代表点の経度"},"prefecture_code":{"type":["string","null"],"description":"都道府県コード (2 桁)。郵便番号とメッシュは、対応する町字がすべて同じ都道府県にあるときだけ"},"city_code":{"type":["string","null"],"description":"全国地方公共団体コードの頭 5 桁。郵便番号とメッシュは、対応する町字がすべて同じ市区町村にあるときだけ"},"lg_code":{"type":["string","null"],"description":"全国地方公共団体コード (6 桁、検査数字つき)"},"related":{"type":"object","properties":{"machiaza":{"type":"array","items":{"$ref":"#/components/schemas/RelatedCode"}},"postal_code":{"type":"array","items":{"$ref":"#/components/schemas/RelatedCode"}},"small_area":{"type":"array","items":{"$ref":"#/components/schemas/RelatedCode"}},"mesh_1km":{"type":"array","items":{"$ref":"#/components/schemas/RelatedCode"}}},"required":["machiaza","postal_code","small_area","mesh_1km"],"description":"区域が重なる他の体系のコード。体系ごとに割合の大きい順。渡した体系と同じ体系と、市区町村を渡したときはすべて空の配列"},"source":{"$ref":"#/components/schemas/Source"}},"required":["system","code","name","lat","lng","prefecture_code","city_code","lg_code","related","source"]},"RelatedCode":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":["string","null"],"description":"都道府県から書いた名前。町字と小地域だけ。郵便番号とメッシュは null"},"lat":{"type":["number","null"],"description":"代表点の緯度。町字と小地域は代表点、メッシュは中心。郵便番号は null"},"lng":{"type":["number","null"],"description":"代表点の経度"},"share":{"type":["number","null"],"description":"渡したコードの区域のうち、このコードの区域に入る割合 (0〜1、面積か、町字と小地域の対応の種類から)。分からなければ null"}},"required":["code","name","lat","lng","share"]}},"parameters":{}},"paths":{"/v1/forward":{"get":{"summary":"住所を座標と地域コードに変換する","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"東京都千代田区紀尾井町1-3"},"required":true,"name":"address","in":"query","description":"住所。URL エンコードして渡す"},{"schema":{"type":"integer","example":1},"required":false,"name":"limit","in":"query","description":"返す候補の数の上限 (1〜10、既定 1)"},{"schema":{"type":"string","pattern":"^\\d{2}$","example":"25"},"required":false,"name":"prefecture_code","in":"query","description":"都道府県コード (2 桁)。渡すと、その都道府県の結果だけを返す"},{"schema":{"type":"string","pattern":"^\\d{5,6}$","example":"25207"},"required":false,"name":"city_code","in":"query","description":"全国地方公共団体コード (5 桁か 6 桁)。渡すと、その市区町村の結果だけを返す。prefecture_code より優先する"},{"schema":{"type":"string","example":"match"},"required":false,"name":"include","in":"query","description":"結果に含める項目の組をカンマ区切りで指定する。\n- match: 候補の並び順に使う一致の度合い (score)\n- structured_address: 都道府県・市区町村・町字・番号に区切った住所 (structured_address)\n- ids: アドレス・ベース・レジストリの町字 ID などの ID (ids)\n- codes: 都道府県コード・市区町村コード・郵便番号・地域メッシュ (codes)\n- small_area: 座標が入る国勢調査の小地域コード (estat_small_area_code)\n- evidence: 照合の根拠 (evidence)。座標を取った点の出典と行の鍵、住所のどこをどの区域・番号に照合したか、上流の照合の後に使った段"},{"schema":{"type":"string","enum":["json","geojson","csv"]},"required":false,"name":"format","in":"query","description":"json (既定)・geojson (abr-geocoder と同じ FeatureCollection)・csv (1 件 1 行、BOM 付き UTF-8。出典は X-Attribution ヘッダ)"}],"responses":{"200":{"description":"照合の結果。照合できなければ results (features) が空","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeocodeResponse"}},"application/geo+json":{"schema":{"$ref":"#/components/schemas/GeocodeFeatureCollection"}},"text/csv":{"schema":{"type":"string","description":"1 件 1 行。入れ子の項目は structured_address.pref のような列にほどく"}}}},"400":{"description":"住所が空か 100 文字を超える、またはパラメータが不正","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"住所のデータを読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/forward/batch":{"post":{"summary":"住所をまとめて変換する","description":"住所を 1 回に 25 件まで JSON の addresses で渡す。結果は渡した住所と同じ順・同じ数で返す。回数の上限は 1 回の呼び出しで 1 回と数える","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}}},"responses":{"200":{"description":"住所ごとに、/v1/forward と同じ results を返す。limit も同じく効く","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"パラメータが不正","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"住所のデータを読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"住所をまとめて変換する (GET)","description":"POST と同じ一括変換を、住所をクエリに入れて呼ぶ。DuckDB の read_json のように URL しか読めないツール向けで、それ以外は POST を使う。住所は address=…&address=… と繰り返して 25 件まで渡す。URL が長くなりすぎないよう、1 回に 10 件ほどにする。レスポンスは POST と同じ","parameters":[{"schema":{"type":"array","items":{"type":"string"}},"required":true,"name":"address","in":"query","style":"form","explode":true},{"schema":{"type":"integer","example":1},"required":false,"name":"limit","in":"query","description":"返す候補の数の上限 (1〜10、既定 1)"},{"schema":{"type":"string","example":"match"},"required":false,"name":"include","in":"query","description":"結果に含める項目の組をカンマ区切りで指定する。\n- match: 候補の並び順に使う一致の度合い (score)\n- structured_address: 都道府県・市区町村・町字・番号に区切った住所 (structured_address)\n- ids: アドレス・ベース・レジストリの町字 ID などの ID (ids)\n- codes: 都道府県コード・市区町村コード・郵便番号・地域メッシュ (codes)\n- small_area: 座標が入る国勢調査の小地域コード (estat_small_area_code)\n- evidence: 照合の根拠 (evidence)。座標を取った点の出典と行の鍵、住所のどこをどの区域・番号に照合したか、上流の照合の後に使った段"},{"schema":{"type":"string","pattern":"^\\d{2}$","example":"25"},"required":false,"name":"prefecture_code","in":"query","description":"都道府県コード (2 桁)。渡すと、その都道府県の結果だけを返す"},{"schema":{"type":"string","pattern":"^\\d{5,6}$","example":"25207"},"required":false,"name":"city_code","in":"query","description":"全国地方公共団体コード (5 桁か 6 桁)。渡すと、その市区町村の結果だけを返す。prefecture_code より優先する"}],"responses":{"200":{"description":"住所ごとに、/v1/forward と同じ results を返す。limit も同じく効く","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"パラメータが不正","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"住所のデータを読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reverse":{"get":{"summary":"座標から市区町村・小地域のコードを取得する","parameters":[{"schema":{"type":"number","example":35.6812},"required":true,"name":"lat","in":"query"},{"schema":{"type":"number","example":139.7671},"required":true,"name":"lng","in":"query"},{"schema":{"type":"string","example":"address"},"required":false,"name":"include","in":"query","description":"結果に含める項目の組をカンマ区切りで指定する。\n- address: 近くの町字・街区・住居の住所 (address)\n- codes: 都道府県コード・市区町村コード・地域メッシュ (codes)"}],"responses":{"200":{"description":"判定の結果","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseResult"}}}},"400":{"description":"座標が範囲外か数値でない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"境界か住所のデータを読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/autocomplete":{"get":{"summary":"途中まで書いた住所の続きの候補を返す","description":"フォームの住所の入力補助向け。書いた住所の頭から、都道府県・市区町村・町字の名前と前方一致で照合し、続きの候補を返す。\n\n- 都道府県・市区町村を書きかけなら、その名前で始まる都道府県と市区町村 (市区町村は人口の多い順)\n- 市区町村まで書いてあれば、その市区町村の町字 (町字 ID の順)\n- 町字まで書いてあれば、その町字と、続く番地 (住居表示の街区符号か地番の本番。数字の順)\n\n郡と京都の通り名は省いても照合する。全角の英数字・漢数字・「丁目」の書き方 (「1-」も含む) の違いは、照合と同じ規則で正規化する。同じ名前の市区町村が複数あるとき (都道府県を書かない府中市など) は、その市区町村を候補にする。市区町村名の無い住所 (「紀尾井町」) は、その町名を持つ市区町村を人口の多い順に補って返す。市区町村の候補が limit に足りないときも、書いたものを町名とみなして埋める。番地の後 (号・枝番・建物名) まで書いてあれば、書いた町字と番地を返す (号の候補は返さない)。駅や施設の名前は対象外。","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"example":"東京都千代田区紀尾"},"required":true,"name":"address","in":"query","description":"途中まで書いた住所"},{"schema":{"type":"integer","example":10},"required":false,"name":"limit","in":"query","description":"返す候補の数の上限 (1〜20、既定 10)"},{"schema":{"type":"string","enum":["pref","city","machiaza"],"example":"city"},"required":false,"name":"max_level","in":"query","description":"候補の深さの上限。pref は都道府県、city は市区町村、machiaza は町字まで。それより先まで書いてあれば、書いた住所を含むその階層の候補を返す (city なら「千代田区紀尾井町」に「東京都千代田区」)。省けば番地まで"}],"responses":{"200":{"description":"候補","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutocompleteResponse"}}}},"400":{"description":"住所が空か 100 文字を超える、または limit が不正","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"住所のデータを読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/codes/{system}/{code}":{"get":{"summary":"地域コードを他の体系のコードに変換する","description":"町字 ID・郵便番号・小地域コード・市区町村コード・3 次メッシュのどれか 1 つを渡すと、名前と代表点、区域が重なる他の体系のコードを返す。\n\n- machiaza: 町字 ID。全国地方公共団体コード (6 桁) と ABR の町字 ID (7 桁) をつないだ 13 桁\n- postal_code: 郵便番号 (7 桁。ハイフン入りの 8 文字も受ける)\n- small_area: 国勢調査の小地域コード (9 桁、内訳区画は 11 桁)\n- city: 全国地方公共団体コード (5 桁か、検査数字つきの 6 桁)\n- mesh_1km: 標準地域メッシュ (3 次、8 桁)\n\n対応は japan_address_code の対応表 (町字と小地域・郵便番号・3 次メッシュ、小地域と 3 次メッシュ) をそのまま引く。郵便番号は、ABR の町字マスタの番号と、町域名が一致したか町域が細分されていて全部同じ番号のものだけを使う。郵便番号と小地域・3 次メッシュは直接の対応表が無いので、町字を経由した組を返す (share は null)。町字のコードは /v1/forward の ids.machiaza_code と /v1/autocomplete の machiaza_code をそのまま渡せる。市区町村は名前と代表点だけを返す","parameters":[{"schema":{"type":"string","enum":["machiaza","postal_code","small_area","city","mesh_1km"],"example":"postal_code"},"required":true,"name":"system","in":"path"},{"schema":{"type":"string","example":"1020094"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"変換の結果","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeResult"}}}},"400":{"description":"体系が無いか、コードの形が体系と合わない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"コードがデータに無い","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"リクエストの回数が上限 (1 分に 300 回) を超えた","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"コードの対応表を読み込めない","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}