induwara.lkinduwara.lk
All endpoints
GET/api/v1/nic/{number}

NIC Decoder API

Decode a Sri Lankan NIC (old 10-char or new 12-digit) into the data the number encodes: date of birth, gender, age, serial and voting eligibility. Pure parsing — no personal database lookup.

Parameters

ParamInRequiredDescription
numberpathyesThe NIC number.

Request

curl "https://induwara.lk/api/v1/nic/199234567890"

JavaScript (SDK):

import { InduwaraLK } from "https://induwara.lk/sdk/induwaralk.js";
const api = new InduwaraLK();
const data = await api.nic(/* … */);

Response

{
  "ok": true,
  "data": {
    "nic": "199234567890",
    "valid": true,
    "format": "new",
    "dateOfBirth": "1992-12-10",
    "gender": "Male",
    "age": { "years": 33, "months": 5, "days": 24 },
    "serial": 6789,
    "votingEligible": null,
    "source": "Department for Registration of Persons, Sri Lanka",
    "lastVerified": "2026-05-10"
  },
  "meta": { "tier": "anonymous", "endpoint": "nic", "limit": 50, "remaining": 49 }
}

Frequently asked questions

Is there a free Sri Lanka NIC validation API?
Yes. GET /api/v1/nic/{number} validates and decodes any old (10-char) or new (12-digit) Sri Lankan NIC for free, returning date of birth, gender, age and serial as JSON. No signup is needed to try it.
How do I get the date of birth from a Sri Lankan NIC number?
Call /api/v1/nic/{number} — the response includes dateOfBirth (ISO) and a structured age, decoded from the digits the NIC itself encodes. It is pure parsing, not a personal-data lookup.
Does the NIC API support both old and new formats?
Yes — both the old 9-digit + letter format (e.g. 921234567V) and the new 12-digit format are supported, and the API returns the equivalent new NIC for old numbers.