Skip to main content

Wilayah Indonesia

CLI tool to fetch and transform Indonesian administrative data (provinces, regencies, districts, subdistricts, postal codes) from the BPS API into json, csv, or sql.

Installation

bun add -g @ibnumardini/wilayah-indonesia

Usage

wilayah-indonesia --fetch # fetch latest raw data
wilayah-indonesia --transform <type> # transform to json | csv | sql
wilayah-indonesia --fetch --transform <type> # both

Data Format

Transformed records are flat and relational, e.g.:

{ "code": "1101", "name": "Simeulue", "province_code": "11" }

See API Reference for the full shape of each entity.