公開 API(読むだけ・鍵なし)
日本の市区町村 1,741 の数字と、世界の土地 917 の頁のデータを JSON で返します。登録も鍵も要りません。CORS は開いています(どのサイトの JavaScript からでも読めます)。1 分に 60 回まで。
どの値にも出典と利用条件がついています(応答の sources)。使う時は元の出典を書いてください。
試す
/api/v1/towns/13101 | 千代田区のすべての数字 |
/api/v1/towns/01100/yubin | 札幌市の郵便番号 |
/api/v1/compare?a=13101&b=27100 | 千代田区と大阪市 |
/api/v1/world/places/Q64 | Berlin |
/api/v1/search?q=さっぽろ | 名前で探す |
/api/v1/world/places?cc=DE | ドイツの土地 |
道の一覧
GET /api/v1/towns | All 1,741 municipalities (code, name, kana, prefecture, facets available) |
GET /api/v1/towns/{code} | One municipality: 33 indicators + 18 derived values (SSDSE-A) and every facet record (postal codes, hazard maps, furusato tax, care insurance, vacant houses, schools, climate normals, tourism, stations) |
GET /api/v1/towns/{code}/{facet} | One facet of one municipality |
GET /api/v1/compare | Two municipalities side by side (indicators and derived values) |
GET /api/v1/facets | Facets with their sources and licences |
GET /api/v1/indicators | Indicator and derived-value definitions (label, unit, year, formula) |
GET /api/v1/world/countries | Countries with world place pages |
GET /api/v1/world/places | World places (cities and first-level regions) with pages |
GET /api/v1/world/places/{qid} | One place: names in many languages, population (Wikidata), coordinates, time zone, monthly climate 2001-2020 (NASA POWER), nearby places |
GET /api/v1/search | Search municipalities and world places by name (Japanese, kana, English, local name) |
GET /api/v1/suggest | OpenSearch suggestions (application/x-suggestions+json) |
機械向けの説明
OpenAPI 3.1(/api/openapi.json) · DCAT の目録 · llms.txt
AI のエージェントから(MCP)
MCP のサーバー https://local.yohaku.city/mcp(Streamable HTTP・読むだけ・鍵なし)。道具: town_profile・compare_towns・world_place・search_places。Server Card: /mcp/server-card。
{
"mcpServers": {
"local-yohaku": { "type": "http", "url": "https://local.yohaku.city/mcp" }
}
}まとめて落とす
CSV と JSON は /data/ に。