VendIDGet a free key

VendID MRZ API — docs

Read the machine-readable zone (MRZ) of passports (TD3), ID cards (TD1) and TD2 documents. Send an image, get JSON with every ICAO 9303 check digit verified. Servers in the EU (Belgium); the image is read in memory and dropped.

⚠ Free / development tier: the first request takes ~7–10 s (warm-up) The reading engine scales to zero when nobody uses it. The first request after a quiet spell takes ~7–10 s while it starts; after that ~0.5 s per scan. It stays warm for ~15 minutes after the last request.

QuickstartKeysPOST /v1/mrzWarm-upResponseErrorsmrz.js drop-inLimitsPassport SDKExamples on GitHubOpenAPI spec

Quickstart (60 seconds)

1. Get a free key — it is shown at once and e-mailed. 2. Run this, with the specimen passport if you have none at hand:

curl -o passport.jpg https://vend-id.com/sdk/specimen.jpg
curl https://vend-id.com/v1/mrz \
  -H "Authorization: Bearer YOUR_KEY" \
  -F "image=@passport.jpg"

Keys

Send the key as Authorization: Bearer vid_…. A key looks like vid_ + 32 letters and digits. We store only its hash: if you lose it, request a new one. A key in a browser page can be read by anyone who opens the page — fine for testing and for pages behind your login; for public pages call the API from your server.

POST https://vend-id.com/v1/mrz

Body: multipart/form-data with the image in the field image, or the raw image with Content-Type: image/jpeg (or png, webp). Max 10 MB. A photo of the data page or a whole camera frame both work: the document is found in the image. CORS is open, so browsers on any site can call it.

# raw body instead of multipart
curl https://vend-id.com/v1/mrz -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: image/jpeg" --data-binary @passport.jpg
// JavaScript (browser or Node 18+)
const form = new FormData();
form.append('image', file);              // a File, Blob or fs.openAsBlob('passport.jpg')
const res = await fetch('https://vend-id.com/v1/mrz', {
  method: 'POST', headers: { Authorization: 'Bearer YOUR_KEY' }, body: form,
});
const mrz = await res.json();            // 200 → fields, 422 → {error, reason}
# Python
import requests
r = requests.post("https://vend-id.com/v1/mrz",
                  headers={"Authorization": "Bearer YOUR_KEY"},
                  files={"image": open("passport.jpg", "rb")})
print(r.status_code, r.json())

Response — 200 OK

{
  "format": "TD3",                 // TD3 passport · TD1 ID card · TD2
  "document_type": "P",
  "issuing_state": "UTO",
  "surname": "ERIKSSON",
  "given_names": "ANNA MARIA",
  "document_number": "L898902C3",
  "nationality": "UTO",
  "birth_date": "1974-08-12",      // ISO date
  "sex": "F",
  "expiry_date": "2012-04-15",
  "optional_data": "ZE184226B",
  "check_digits": { "document_number": true, "birth_date": true, "expiry_date": true, "composite": true },
  "mrz": ["P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<",
          "L898902C36UTO7408122F1204159ZE184226B<<<<<10"],
  "ms": 612                         // time on our side
}

A 200 always has valid check digits. Warm, a read takes ~0.5 s; the first call after a quiet spell takes ~7–10 s (cold start).

POST https://vend-id.com/v1/warmup

Wakes the reading engine so the next read is fast. Same key as /v1/mrz, no body. Free: never counted, never billed. CORS is open, so call it from the browser the moment your check-in page or scan screen opens.

curl -X POST https://vend-id.com/v1/warmup -H "Authorization: Bearer YOUR_KEY"
# 202 {"state":"warming","eta_ms":7000}   engine starting, ready in ~7 s
# 200 {"state":"ready","eta_ms":0}         already warm
// when the page opens — don't wait for it
fetch('https://vend-id.com/v1/warmup', { method: 'POST', headers: { Authorization: 'Bearer YOUR_KEY' } });

Errors: 401 as for /v1/mrz; 502 engine_unavailable (retry, or just scan: a read wakes the engine too). Set client timeouts for /v1/mrz to 30 s or more.

Errors

StatuserrorMeaning
422no_documentNo passport or ID card found in the image.
422no_mrzDocument found, but not the MRZ lines (the <<< lines). Show the bottom of the data page.
422blurryMRZ too blurry to read.
422check_digitsRead, but the check digits don't match: no result is better than a wrong one.
400bad_requestNo image in the request.
401missing_api_key / invalid_api_keyNo key, or a key we don't know.
413body_too_largeImage over 10 MB.
415unsupported_imageNot a JPEG, PNG or WebP image. Check the file; do not retry.
429quota_exceededAbuse protection only: more than 10,000 calls in a month on one key (20× the free scans). Resets on the 1st (UTC). Running past the 500 free scans never answers 429: the key keeps working.
502engine_unavailableThe reader did not answer. Retry.

Failed reads (422) are free: only reads with valid check digits count.

mrz.js — camera drop-in

One script tag. It opens a full-screen camera view, sends frames to /v1/mrz until one reads, and hands you the same JSON. No build step, no dependencies, works in every current browser over HTTPS (phone or laptop webcam).

<script src="https://vend-id.com/sdk/mrz.js"></script>
<button onclick="scan()">Scan passport</button>
<script>
  async function scan() {
    const r = await VendIdMrz.open({ key: 'YOUR_KEY' });
    console.log(r.surname, r.given_names, r.document_number, r.birth_date);
  }
</script>
CallWhat it does
VendIdMrz.open({ key, onResult?, onError? })Camera overlay. Promise resolves with the result; rejects on a key, quota or connection error, or with code: 'closed' when the user closes it. „No passport? Use the specimen" reads the ICAO specimen. No answer within 25 s: the overlay says so and offers „Try again"; closing it then rejects with name: 'VendIdMrzTimeoutError', code: 'timeout'.
VendIdMrz.scanImage({ key, image })One File or Blob (e.g. from <input type="file">) → result. No camera. No answer within 25 s: rejects with VendIdMrzTimeoutError, code: 'timeout'.
VendIdMrz.close()Closes an open overlay.

Plans and limits

VendID Passport SDK (on the device)

The same reading on the user's device — browser (JavaScript + WebAssembly), Android, iOS, Flutter and React Native; on phones also the passport chip by NFC with Passive Authentication. The package and a test licence come with your SDK request.