Skip to content
All APIs

NIK Parser

Identity · 1 endpoint

Decode an Indonesian national identity number into province, regency, district, postal code, birth date, and sex — including the +40 day offset that trips most implementations.

Base URL

https://api.diraz.ae
2 requestsNo cache1 credit / request

Endpoint

GET/v1/id/nik

Snippet

Request — cURL

v1

curl https://api.diraz.ae/v1/id/nik \
  -H "Authorization: Bearer drz_live_…"

Query parameters

nikstring · required
The 16-digit number.

Example response

200 OK

v1

{
  "data": {
    "nik": "3171065508900002",
    "valid": true,
    "province_code": "31",
    "regency_code": "3171",
    "district_code": "317106",
    "province": "DKI JAKARTA",
    "regency": "KOTA ADM. JAKARTA PUSAT",
    "district": "MENTENG",
    "postal_code": "10330",
    "birth_date": "1990-08-15",
    "sex": "female",
    "serial": "0002",
    "issues": [],
    "warnings": []
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
valid
True when every check passed. `issues` says what failed otherwise.
province_code
Kemendagri province code, first two digits.
regency_code
Regency code, first four digits.
district_code
District code, first six digits.
province / regency / district
The place names behind those codes.
postal_code
From the district record. Null for the 284 districts with no published code — reading the last five characters instead would return part of the name and look like a postal code.
birth_date
`YYYY-MM-DD`. The two-digit year is resolved against the whole date, so a birth date is never in the future.
sex
From the birth-day offset: a woman's day carries +40. A parser that misses this reports every woman as invalid.
issues
Everything that failed. Empty when valid.
warnings
Not failures. An unrecognised region code lands here rather than in `issues`: the reference table predates the 2022 province split, and a number issued under a newer code is real. Our stale table is not the cardholder's problem.

Errors

401 Unauthorized

v1

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "The API key is invalid, expired, or revoked."
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}

Every failure carries a stable machine-readable code before the human message, and the same meta.request_id the successful responses carry. Quote it and we can find your exact request.

Errors are free

Nothing on this page is billed. You are charged for a 2xx and nothing else — a rejected key, a bad parameter, a rate limit, or an outage on our side all cost you zero. Retry without watching the meter.

UNAUTHORIZEDHTTP 401
Missing, malformed, expired, or revoked API key.
FORBIDDENHTTP 403
The key is valid but lacks the scope this product needs.
VALIDATION_ERRORHTTP 422
A query parameter is the wrong type or out of range.
RATE_LIMITEDHTTP 429
Rate limit exhausted. `Retry-After` says how long to wait.
SERVICE_UNAVAILABLEHTTP 503
No data recent enough to serve. Carries `Retry-After`, and is never billed.
Total requests2
CacheNone
Status
Operational
Category
Identity
Scope
market:read
Rate limit
300 requests / 60s per key
Pricing
1 credit / request
Request a keyView as Markdown
  • NIK Parser

1/1 passing