API

The API is a single Cloudflare Worker written in TypeScript (Hono + zod-openapi). It exposes an OpenAPI document and an interactive reference UI.

GET /v1/nik/:nik

Parses a 16-digit NIK. Returns gender, birth date, region and validation issues.

curl https://api.bitaloka.io/v1/nik/3174022501700001

GET /v1/plate/:plate

Parses a vehicle plate. Returns region, vehicle class and suffix breakdown.

curl https://api.bitaloka.io/v1/plate/B%201234%20ABC

GET /v1/npwp/:npwp

Validates and parses an NPWP (15-digit legacy or 16-digit NIK-based).

curl https://api.bitaloka.io/v1/npwp/09.254.294.3-407.000

POST /v1/batch

Parses up to 100 mixed items in one request.

curl -X POST https://api.bitaloka.io/v1/batch \
  -H "Content-Type: application/json" \
  -d '{ "items": [
    { "type": "nik",   "value": "3174022501700001" },
    { "type": "plate", "value": "B 1234 ABC" }
  ] }'

Result contract

All endpoints return an object with a valid boolean plus errors and warnings arrays. Errors mean the document is malformed; warnings mean it parsed but something is worth your attention (e.g. a gender mismatch or an unknown region code).