街の偏差値API
ドキュメント

使い方

APIキーをヘッダに付けて GET で呼ぶと、JSON が返ります。呼び出し先は4つです。

共通

項目内容
呼び出し先https://www.ikachi.org/machi/api/v1 に続けて下の4つのどれか
キーヘッダ X-API-Key: msk_...Authorization: Bearer msk_... でも可)
応答{"success": true, "data": {...}, "usage": {...}}usage は今日の利用回数と上限です
文字コードUTF-8。数値は数値のまま、値の無い項目は null

例(curl)

curl https://www.ikachi.org/machi/api/v1/municipalities/13101 \
  -H "X-API-Key: msk_あなたのキー"
GET/municipalities/{code}

1つの市区町村の偏差値・統計・ふるさと納税をまとめて返します。{code} は5桁の市区町村コード(例 13101 千代田区)です。コードの一覧は /municipalities で取れます。

項目内容
scores偏差値の項目ごとに hensachi(偏差値)・value(元の値)・unitrank(全国順位)・rank_total(順位を付けた数)
stats人口・面積などの統計(valueunit
furusatoreceipts 受入額・件数・全国順位/deductions よそへ寄付した住民の数と控除された住民税/balance 収支(受入額−控除額)と全国順位/history 受入額の推移(千円)/corporate 企業版ふるさと納税(実績が無ければ null

返ってくるもの(千代田区・実際のデータ)

{
    "success": true,
    "data": {
        "code": "13101",
        "name": "千代田区",
        "prefecture": {
            "code": "13",
            "name": "東京都"
        },
        "scores": {
            "young": {
                "label": "若さ",
                "hensachi": 60.4,
                "value": 13.46,
                "unit": "%",
                "rank": 260,
                "rank_total": 1740
            },
            "shops": {
                "label": "買い物・外食",
                "hensachi": 84.4,
                "value": 941.96,
                "unit": "店/1万人",
                "rank": 1,
                "rank_total": 1740
            },
            "doctor": {
                "label": "医療",
                "hensachi": 84.4,
                "value": 2901.92,
                "unit": "人/10万人",
                "rank": 1,
                "rank_total": 1740
            },
            "income": {
                "label": "豊かさ",
                "hensachi": 81.3,
                "value": 1175.54,
                "unit": "万円",
                "rank": 2,
                "rank_total": 1741
            },
            "inflow": {
                "label": "人の増減",
                "hensachi": 46.5,
                "value": -5.47,
                "unit": "‰",
                "rank": 1106,
                "rank_total": 1740
            },
            "daytime": {
                "label": "昼の人口",
                "hensachi": 84.4,
                "value": 1355.4,
                "unit": "%",
                "rank": 1,
                "rank_total": 1740
            }
        },
        "stats": {
            "pop": {
                "label": "総人口",
                "value": 66680.0,
                "unit": "人"
            },
            "area": {
                "label": "面積",
                "value": 11.66,
                "unit": "k㎡"
            },
            "density": {
                "label": "人口密度",
                "value": 5718.7,
                "unit": "人/k㎡"
            },
            "old": {
                "label": "65歳以上の割合",
                "value": 16.27,
                "unit": "%"
            },
            "single": {
                "label": "ひとり暮らし世帯",
                "value": 56.95,
                "unit": "%"
            },
            "fiscal": {
                "label": "財政力指数",
                "value": null,
                "unit": ""
            },
            "foreign": {
                "label": "外国人の割合",
                "value": 4.09,
                "unit": "%"
            },
            "birth": {
                "label": "出生率",
                "value": 8.62,
                "unit": "‰"
            },
            "marry": {
                "label": "婚姻率",
                "value": 9.18,
                "unit": "‰"
            },
            "nursery": {
                "label": "保育所等の数",
                "value": 25.0,
                "unit": "所"
            },
            "library": {
                "label": "図書館の数",
                "value": 6.0,
                "unit": "館"
            },
            "hospital": {
                "label": "一般病院の数",
                "value": 15.0,
                "unit": "施設"
            },
            "primary": {
                "label": "第1次産業で働く人",
                "value": 0.02,
                "unit": "%"
            },
            "jobless": {
                "label": "完全失業率",
                "value": 1.86,
                "unit": "%"
            },
            "commute": {
                "label": "他市区町村へ通勤",
                "value": 42.3,
                "unit": "%"
            },
            "recycle": {
                "label": "ごみのリサイクル率",
                "value": null,
                "unit": "%"
            }
        },
        "furusato": {
            "receipts": {
                "fiscal_year": "令和7年度",
                "amount_yen": 1886176700,
                "count": 18307,
                "rank": 163
            },
            "deductions": {
                "tax_year": "令和8年度課税",
                "amount_yen": 2331380033,
                "donors": 18232
            },
            "balance": {
                "amount_yen": -445203333,
                "rank": 1617
            },
            "history": [
                {
                    "fiscal_year": "平成28年度",
                    "amount_thousand_yen": 3397
                },
                {
                    "fiscal_year": "平成29年度",
                    "amount_thousand_yen": 4323
                },
                {
                    "fiscal_year": "平成30年度",
                    "amount_thousand_yen": 3488
                },
                {
                    "fiscal_year": "令和元年度",
                    "amount_thousand_yen": 8439
                },
                {
                    "fiscal_year": "令和2年度",
                    "amount_thousand_yen": 259
                },
                {
                    "fiscal_year": "令和3年度",
                    "amount_thousand_yen": 183
                },
                {
                    "fiscal_year": "令和4年度",
                    "amount_thousand_yen": 210
                },
                {
                    "fiscal_year": "令和5年度",
                    "amount_thousand_yen": 99456
                },
                {
                    "fiscal_year": "令和6年度",
                    "amount_thousand_yen": 1060764
                },
                {
                    "fiscal_year": "令和7年度",
                    "amount_thousand_yen": 1886177
                }
            ],
            "corporate": null,
            "data_updated": "2026-09-11"
        },
        "page_url": "https://www.ikachi.org/machi/?c=13101",
        "data_updated": "2026-09-10"
    },
    "usage": {
        "plan": "free",
        "used_today": 1,
        "limit_today": 100
    }
}
GET/rankings/{axis}

偏差値の項目ごとの全国ランキングです。都道府県で絞っても、順位は全国順位のままです。

指定内容
{axis} young 若さ/shops 買い物・外食/doctor 医療/income 豊かさ/inflow 人の増減/daytime 昼の人口
orderdesc 偏差値が高い順(既定)/asc 低い順
pref都道府県コード(2桁。例 13 東京都)。省略すると全国
limit返す件数。1〜100(既定 20)
offset先頭から飛ばす件数(既定 0)。続きは offset を増やして取ります

例:/rankings/doctor?pref=13&limit=3

{
    "success": true,
    "data": {
        "axis": {
            "key": "doctor",
            "label": "医療",
            "unit": "人/10万人",
            "description": "医師の数(人口10万人あたり)",
            "source": "2022年 医師・歯科医師・薬剤師統計"
        },
        "order": "desc",
        "prefecture": {
            "code": "13",
            "name": "東京都"
        },
        "total": 62,
        "offset": 0,
        "limit": 3,
        "items": [
            {
                "rank": 1,
                "code": "13101",
                "name": "千代田区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                },
                "hensachi": 84.4,
                "value": 2901.92
            },
            {
                "rank": 4,
                "code": "13105",
                "name": "文京区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                },
                "hensachi": 78.8,
                "value": 2005.67
            },
            {
                "rank": 13,
                "code": "13104",
                "name": "新宿区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                },
                "hensachi": 74.5,
                "value": 1399.03
            }
        ]
    },
    "usage": {
        "plan": "free",
        "used_today": 1,
        "limit_today": 100
    }
}
GET/municipalities

市区町村の一覧(コード・名前・都道府県)です。pref(2桁の都道府県コード)で絞れます。

例:/municipalities?pref=13items は先頭3件だけ載せています)

{
    "success": true,
    "data": {
        "prefecture": {
            "code": "13",
            "name": "東京都"
        },
        "total": 62,
        "items": [
            {
                "code": "13101",
                "name": "千代田区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                }
            },
            {
                "code": "13102",
                "name": "中央区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                }
            },
            {
                "code": "13103",
                "name": "港区",
                "prefecture": {
                    "code": "13",
                    "name": "東京都"
                }
            }
        ]
    },
    "usage": {
        "plan": "free",
        "used_today": 1,
        "limit_today": 100
    }
}
GET/meta

項目の説明(単位・出典・全国の中央値など)、偏差値の出し方、データの作成日、都道府県の一覧を返します。

例(axesstatsprefectures は先頭だけ載せています)

{
    "success": true,
    "data": {
        "title": "街の偏差値",
        "municipalities": 1741,
        "data_updated": "2026-09-10",
        "method": "偏差値は全国1,741市区町村の順位を正規分布に当てはめた値です(50が全国のまん中)。生の数値で計算すると外れ値のせいで100を超えてしまうため、順位を使っています。",
        "note": "政令指定都市は市全体で1件として扱い、行政区は含みません。東京23区は1件ずつ数えています。",
        "source": {
            "name": "総務省統計局「社会・人口統計体系 統計でみる市区町村のすがた2026」(2026年6月19日公開)",
            "url": "https://www.e-stat.go.jp/regional-statistics/ssdsview/municipality"
        },
        "axes": [
            {
                "key": "young",
                "label": "若さ",
                "unit": "%",
                "description": "15歳未満の人の割合",
                "source": "2020年 国勢調査",
                "count": 1740,
                "median": 11.16,
                "mean": 11.14,
                "min": 0.12,
                "max": 23.46
            }
        ],
        "stats": [
            {
                "key": "pop",
                "label": "総人口",
                "unit": "人",
                "source": "2020年 国勢調査"
            },
            {
                "key": "area",
                "label": "面積",
                "unit": "k㎡",
                "source": "2024年 面積調"
            }
        ],
        "prefectures": [
            {
                "code": "01",
                "name": "北海道"
            },
            {
                "code": "02",
                "name": "青森県"
            }
        ],
        "furusato": {
            "data_updated": "2026-09-11",
            "receipts": {
                "fiscal_year": "令和7年度",
                "source": "総務省「ふるさと納税に関する現況調査結果」各自治体の令和7年度受入額等",
                "url": "https://www.soumu.go.jp/main_content/001084989.xlsx"
            },
            "deductions": {
                "tax_year": "令和8年度課税",
                "source": "総務省「ふるさと納税に関する現況調査結果」各自治体の令和8年度課税における住民税控除額等",
                "url": "https://www.soumu.go.jp/main_content/001085012.xlsx"
            },
            "history": {
                "fiscal_years": [
                    "平成28年度",
                    "平成29年度",
                    "平成30年度",
                    "令和元年度",
                    "令和2年度",
                    "令和3年度",
                    "令和4年度",
                    "令和5年度",
                    "令和6年度",
                    "令和7年度"
                ],
                "unit": "千円",
                "source": "総務省「ふるさと納税に関する現況調査結果」各自治体のふるさと納税受入額及び受入件数(平成20年度~令和7年度)",
                "url": "https://www.soumu.go.jp/main_content/001084990.xlsx"
            },
            "corporate": {
                "fiscal_year": "令和6年度",
                "source": "内閣府「企業版ふるさと納税」令和6年度寄附実績一覧(PDF/1,671KB)",
                "url": "https://www.chisou.go.jp/tiiki/tiikisaisei/pdf/R06_zisseki_itiran.pdf"
            }
        }
    },
    "usage": {
        "plan": "free",
        "used_today": 1,
        "limit_today": 100
    }
}

ご注意

© 合同会社IKACHI