๐ฎ๐ฉ Nusakit API
Indonesian Data Validation API โ NIK, NPWP, Phone, Rupiah, Bank, Wilayah Administratif & Kode Pos.

One API for all Indonesian data validation. Open source, free to use, powered by Cloudflare Workers.
๐ Live API: nusakit.my.id
โจ Features
| Module |
Description |
| ๐บ๏ธ Wilayah |
Provinsi โ Kab/Kota โ Kecamatan โ Desa/Kelurahan (83,762 desa, Kepmendagri 2025) |
| ๐ฎ Kode Pos |
Cari kode pos dari kode wilayah, atau wilayah dari kode pos |
| ๐ชช NIK |
Validasi struktural & parse KTP โ extract provinsi, tanggal lahir, gender, umur |
| ๐ NPWP |
Validasi format lama (15 digit) & baru (16 digit = NIK) |
| ๐ฑ Phone |
Validasi, normalisasi, deteksi operator (Telkomsel, Indosat, XL, dll) |
| ๐ฐ Rupiah |
Format, parse, terbilang (angka โ kata bahasa Indonesia) |
| ๐ฆ Bank |
Kode bank BI, search, validasi nomor rekening |
| ๐งช Dummy |
Generator data testing โ NIK, NPWP, phone yang valid secara struktur |
| ๐ณ QRIS |
Konversi QRIS statis โ dinamis (nominal + biaya layanan) & parse payload EMVCo |
๐ Quick Start
# Validate NIK
curl https://nusakit.my.id/v1/nik/validate?nik=3201010101900001
# Terbilang โ number to Indonesian words
curl https://nusakit.my.id/v1/rupiah/terbilang?amount=1500000
# โ "satu juta lima ratus ribu rupiah"
# Search wilayah
curl https://nusakit.my.id/v1/wilayah/search?q=bandung
# Find postal code for a village/kelurahan code
curl https://nusakit.my.id/v1/kodepos/wilayah/32.04.11.2001
# Reverse: which areas use postal code 40111?
curl https://nusakit.my.id/v1/kodepos/40111
# Detect phone operator
curl https://nusakit.my.id/v1/phone/operator?phone=081234567890
# โ { "operator": "Telkomsel", "valid": true }
# List all banks
curl https://nusakit.my.id/v1/bank
# Generate dummy NIK for testing
curl -X POST https://nusakit.my.id/v1/dummy/nik \
-H "Content-Type: application/json" \
-d '{"count": 5}'
# Convert a static QRIS to dynamic with amount + fee
curl -X POST https://nusakit.my.id/v1/qris/convert \
-H "Content-Type: application/json" \
-d '{"qris": "00020101...6304XXXX", "amount": 25000, "feeType": "rupiah", "feeValue": 1000}'
๐ API Endpoints
Wilayah
| Method |
Endpoint |
Description |
| GET |
/v1/wilayah/provinces |
List all provinces |
| GET |
/v1/wilayah/provinces/:code |
Get province by code |
| GET |
/v1/wilayah/regencies/:code |
List regencies in a province |
| GET |
/v1/wilayah/districts/:code |
List districts in a regency |
| GET |
/v1/wilayah/villages/:code |
List villages in a district |
| GET |
/v1/wilayah/search?q=... |
Search any region by name |
| GET |
/v1/wilayah/lookup/:code |
Full hierarchy for a code |
Kode Pos
| Method |
Endpoint |
Description |
| GET |
/v1/kodepos/wilayah/:code |
Postal code for a village/kelurahan code (4-level) |
| GET |
/v1/kodepos/:postalCode |
List all areas sharing a 5-digit postal code |
NIK
| Method |
Endpoint |
Description |
| POST |
/v1/nik/validate |
Validate & parse NIK (JSON body: {"nik": "..."}) |
| GET |
/v1/nik/validate?nik=... |
Same, via query param |
NPWP
| Method |
Endpoint |
Description |
| POST |
/v1/npwp/validate |
Validate NPWP |
| GET |
/v1/npwp/format?npwp=... |
Format NPWP to standard notation |
Phone
| Method |
Endpoint |
Description |
| POST |
/v1/phone/validate |
Validate & normalize phone |
| GET |
/v1/phone/operator?phone=... |
Detect carrier/operator |
Rupiah
| Method |
Endpoint |
Description |
| GET |
/v1/rupiah/format?amount=... |
Format number to Rp X.XXX |
| GET |
/v1/rupiah/terbilang?amount=... |
Number to Indonesian words |
| GET |
/v1/rupiah/parse?input=... |
Parse "Rp 1.500.000" โ 1500000 |
Bank
| Method |
Endpoint |
Description |
| GET |
/v1/bank |
List all banks |
| GET |
/v1/bank/:code |
Get bank by BI code |
| POST |
/v1/bank/validate-account |
Validate account number length |
Dummy
| Method |
Endpoint |
Description |
| POST |
/v1/dummy/nik |
Generate dummy NIK(s) |
| POST |
/v1/dummy/phone |
Generate dummy phone number(s) |
| POST |
/v1/dummy/npwp |
Generate dummy NPWP(s) |
QRIS
| Method |
Endpoint |
Description |
| POST |
/v1/qris/convert |
Convert static QRIS โ dynamic with amount (+ optional feeType/feeValue) |
| POST |
/v1/qris/parse |
Parse a QRIS payload into its EMVCo TLV fields + merchant info |
๐ ๏ธ Self-Host / Development
Prerequisites
- Node.js 18+
- Wrangler CLI
- Cloudflare account (free tier works)
Setup
# Clone
git clone https://github.com/muhfauziazhar/nusakit-api.git
cd nusakit-api
# Install
npm install
# Create D1 database
wrangler d1 create nusakit-db
# โ Copy the database_id to wrangler.toml
# Create KV namespace
wrangler kv namespace create nusakit-cache
# โ Copy the id to wrangler.toml
# Apply schema
wrangler d1 execute nusakit-db --file=schema.sql --local
# Seed data (requires cahyadsn/wilayah cloned to ../cahyadsn-wilayah)
npm run build:sql
wrangler d1 execute nusakit-db --file=seed.sql --local
# (Optional) Seed kode pos (requires cahyadsn/wilayah_kodepos cloned to ../cahyadsn-wilayah_kodepos)
npm run build:kodepos
wrangler d1 execute nusakit-db --file=kodepos-seed.sql --local
# Dev server
npm run dev
# โ http://localhost:8787
Deploy
# Deploy to Cloudflare Workers
wrangler d1 execute nusakit-db --file=schema.sql --remote
wrangler d1 execute nusakit-db --file=seed.sql --remote
wrangler d1 execute nusakit-db --file=kodepos-seed.sql --remote # optional, for Kode Pos
npm run deploy
๐ Data Source
โ ๏ธ Disclaimer
- NIK/NPWP validation is structural & offline. A "valid" NIK/NPWP does not mean it's registered with Dukcapil/DJP.
- Bank account validation checks length only. No checksum or ownership verification.
- Dummy data is for testing only. Never use for real identification.
- Complies with UU PDP No. 27/2022 โ no personal data is stored or processed.
๐ License
MIT ยฉ Muhammad Fauzi Azhar
๐ Credits
Contributors