ID Card OCR API

Send a photo of an identity document and get its fields back as JSON: Indonesian KTP, SIM, KK and NPWP, or a foreign passport or driving licence. Add a selfie and the same call matches the face on the document.

2 endpoints

Call it

The first response is 402 with the exact price and every way to pay. Pay, repeat the request with the proof, and you get the result.

curl -X POST https://api.glianalabs.com/v1/tools/ocr-id \
  -H 'content-type: application/json' \
  -d '{"image_url":"https://example.com/ktp.jpg"}'

How it works

A vision model reads the document and copies each field as printed, or null when it is absent. For Indonesian documents the NIK is then checked structurally: the region code against official Kepmendagri data, and the birth date and gender it encodes against the printed ones. kyc-verify runs the same read plus a face match against a selfie, fetching the document once.

Limits worth knowing

The verification block is a confidence signal for the read, not proof the document is genuine: a well-made fake with a valid-looking NIK passes. There is no liveness check on the selfie. Identity documents are personal data, so send them as image_base64 to keep them out of storage entirely.

Questions

Which documents can it read?

Indonesian KTP, SIM, KK and NPWP, plus foreign passports and driving licences. Fields come back exactly as printed, including religion and marital status where the document shows them.

Does it verify that the ID is real?

No. It checks that an Indonesian NIK is structurally consistent with the region, birth date and gender printed beside it. That catches misreads and careless edits, not a forged card.

Is the image stored?

Not when you send image_base64. If you pass one of our /v1/media URLs, the object is deleted as soon as it has been read.

What is the size limit?

About 6 MB per image (6,291,456 bytes).

Is there a free tier?

No. Every call is paid individually, with no plan or minimum. A request that fails validation is refused before it runs, so it is never charged.

Do I need an account or an API key?

No. The first response is HTTP 402 with the exact price; pay it with USDC from your own wallet and repeat the request. To prepay instead, top up a balance in rupiah and send a gk_ key.

More from the same API