跳到内容
Bitaloka Docs
KTP 解析器

KTP 解析器

将印尼 NIK(身份证号)解析为出生地、出生日期、性别和地区。

请求

GET https://api.bitaloka.io/v1/nik/{nik}
路径参数→ application/json

参数

名称类型描述
nik必填 文本 16-digit NIK from a KTP.示例: 3171014501900001

代码示例

由同一来源生成,并已针对线上 API 测试。

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

使用: curl 7.x+ · example.sh

响应

线上 API 对示例请求返回的真实响应。

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."
    }
  ]
}

在 AI 智能体中使用

在 Bitaloka MCP 服务器上,此服务对应 parse_nik 工具。 MCP 服务器 →

相关服务