Identity · 1 endpoint
NIK Parser
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.
- Status
- Operational
- Price
- 1 credit / request
- Rate limit
- 300 / 60s
- Cache
- None
- Requests
- 0
Endpoint
How to call it
GET/v1/id/nik
Code
Request — cURL
v1
curl https://api.diraz.co.id/v1/id/nik \
-H "Authorization: Bearer drz_live_…"For AI agents
Callable through the MCP server with the same key:
call_api {"endpoint":"id-nik","params":{"nik":"3171065508900002"}}Parameters
- nikstring · required
- The 16-digit number.
Example response
200 OK
JSON
{
"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
When something goes wrong
Every failure carries a stable machine-readable code and the same meta.request_id a success carries — quote it and we can find your request. Errors are never billed.
401 Unauthorized
JSON
{
"error": {
"code": "UNAUTHORIZED",
"message": "The API key is invalid, expired, or revoked."
},
"meta": {
"request_id": "req_7Q2fK4mZ"
}
}- 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.
Health
Is it up?
- NIK Parser
1/1 passing