Drop a passport photo, watch the MRZ get checked digit by digit

I build doc.cheap, an API that reads passports and ID cards and returns the printed fields as JSON. Until this week the only way to see it work was to copy a curl command. Now the home page has a live demo: drop an image and the result appears on the page, no account and no card. What happens when you drop an image The browser resizes it and sends it to the public sandbox key – the same key that is printed in the docs, so there is nothing to sign up for. The API reads the machine-readable zone (the two lines of

Drop a passport photo, watch the MRZ get checked digit by digit

I build doc.cheap, an API that reads passports and ID cards and returns the
printed fields as JSON. Until this week the only way to see it work was to
copy a curl command. Now the home page has a live demo: drop an image and the
result appears on the page, no account and no card.

What happens when you drop an image

  1. The browser resizes it and sends it to the public sandbox key – the same key that is printed in the docs, so there is nothing to sign up for.
  2. The API reads the machine-readable zone (the two lines of <<< at the bottom of a passport) and checks every check digit against ICAO 9303.
  3. It also reads the visual zone – name, dates, document number – and the page shows every field it read, with the MRZ verdict.
  4. The image is not stored.

Next to the drop zone is the exact request the page just made:

curl -X POST https://api.doc.cheap/v1/scans \
  -H "Authorization: Bearer sk_sandbox_public" \
  -H "Content-Type: application/json" \
  -d "{\"image\": \"$(base64 < document.jpg | tr -d '\n')\"}"

Paste it into a terminal and you get the same JSON. One synchronous call, no
queue to poll, no SDK.

Why a demo at all

Every document-OCR product I tried wanted a sales call or a sign-up before
showing a single result. I wanted the opposite: the first result before the
first form.

No passport at hand? The site uses a specimen passport of a fictional
state throughout; any clear photo of the data page of a real one works too.

Try it here: doc.cheap.
An account adds 100 free recognitions every month.

I would love to hear what breaks – odd lighting, a card type it does not
know, a check digit it gets wrong. Comments are read and answered.

– Teoh Chin Heng

Share