MRZ OCR
Read the two or three lines of chevrons at the bottom of passports, ID cards and visas, parse them into fields and check every check digit.
PDF, PNG, JPG, WebP, HEIC. Up to 10 files at onceNo file?
What makes machine-readable zones hard to read
- 0 and O, 1 and I, 8 and B that a single wrong digit breaks
- OCR-B font printed small under laminate
- Three formats: TD1 ID cards, TD2 and TD3 passports
Fields coming with document_type
{"format": "TD3","line_1": "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<","line_2": "L898902C36UTO7408122F1204159ZE184226B<<<<<10","document_number": "L898902C3","nationality": "UTO","date_of_birth": "1974-08-12","expiry_date": "2012-04-15","check_digits_valid": "true"}Best models for machine-readable zones
1Azure Document IntelligenceAzure layout model with tables, selection marks and prebuilt invoice and ID readers.60 credits / page
azure/document-intelligence60 credits / page2Google Document AIGoogle Cloud OCR with layout parsing and specialised processors.10 credits / pagegoogle/document-ai10 credits / page3Gemini FlashGeneral vision model with strong handwriting and layout understanding at a low price.15 credits / pagegoogle/gemini-flash15 credits / pageCall it from your code
curl https://api.ocrrouter.ai/v1/ocr \
-H "Authorization: Bearer $OCRROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "azure/document-intelligence",
"file_url": "https://example.com/invoice.pdf",
"format": "json"
}'