jp-local-gov-id
A JavaScript API for working with Japan’s nationwide local government codes.
What you can do
- List municipalities in a given prefecture
- Fetch prefecture information as a list
- Look up local government codes — unique IDs useful for address normalization
Installation
npm install @b4moss/jp-local-gov-id @b4moss/jp-local-gov-id-data
See Installation for details.
Quick example
import { createLocalGovClient } from "@b4moss/jp-local-gov-id";
import dataset from "@b4moss/jp-local-gov-id-data";
const client = await createLocalGovClient({ data: dataset });
await client.getByCode("131016"); // Chiyoda
See Usage for details.
Try it
Try code lookup and text search in the browser. For free-form TypeScript, open the Playground.
Code lookup
Text search
Initializing…
Packages
| Package | Description |
|---|---|
@b4moss/jp-local-gov-id | JS API (data not bundled) |
@b4moss/jp-local-gov-id-data | Split JSON datasets |
Questions and requests
Please use GitHub Issues. (A GitHub account is required.)