Skip to content
Bitaloka Docs
KTP parser

KTP parser

Parse an Indonesian NIK (KTP number) into birthplace, birth date, gender and region.

Request

GET https://api.bitaloka.io/v1/nik/{nik}
Path parameter→ application/json

Parameters

NameTypeDescription
nikrequired text 16-digit NIK from a KTP.Example: 3171014501900001

Code samples

Generated from one source and tested against the live API.

curl -sS "https://api.bitaloka.io/v1/nik/3171014501900001" \
  -H "X-API-Key: $BITALOKA_API_KEY" \
  --fail-with-body

Uses: curl 7.x+ · example.sh

Response

Real response from the live API for the example request.

200 OK · application/json
{
  "valid": true,
  "input": "3171014501900001",
  "normalized": "3171014501900001",
  "gender": "P",
  "birthDate": {
    "day": 5,
    "month": 1,
    "yearTwoDigit": 90,
    "yearCandidates": [
      1990,
      2090
    ],
    "yearResolved": 1990,
    "yearIsAmbiguous": false
  },
  "region": {
    "province": {
      "code": "31",
      "name": "Daerah Khusus Ibukota Jakarta"
    },
    "regency": {
      "code": "3171",
      "name": "Kota Administrasi Jakarta Pusat"
    },
    "district": {
      "code": "317101",
      "name": "Gambir"
    }
  },
  "serial": "0001",
  "genderConsistent": false,
  "summary": "Perempuan, lahir 5 Januari 1990, Gambir, Kota Administrasi Jakarta Pusat, Daerah Khusus Ibukota Jakarta",
  "errors": [],
  "warnings": [
    {
      "code": "GENDER_MISMATCH",
      "message": "Gender from birth-day offset does not match serial parity (last digit). Possible data-entry error."
    }
  ]
}

Use from an AI agent

On the Bitaloka MCP server this service is the parse_nik tool. MCP server →

Related services