Biometrics & documents
ID document verification from a photo
OCR, MRZ, barcode, expiry, tamper and portrait checks on NIN slips and cards, passports, driver’s licences and voter’s cards; number-only lookups are in preview.
What it does
Document Verification, in detail.
Machine-readable checks
NIMC record cross-check
Portrait to selfie
Tamper and duplicate signals
Quality gate first
Name confidence
How it works
From request to decision.
- 1
Capture the document
Use the Capture SDK, a hosted capture link or your own camera; send the back image where one exists.
- 2
POST /v1/verify/document
Send the document type, images, purpose code and fields to match, plus a selfie for the portrait.
- 3
Act on flags
match is true only when the number was read and no hard flag fired; soft flags lower the confidence.
Routing and providers
OCR, MRZ, barcode, tamper and face checks run on Speedmap’s document pipeline, and NIN documents are cross-checked against the NIMC record. Number-only passport, licence and voter’s card lookups await the NIS, FRSC and INEC data agreements and are test-mode only until then.
Use it
One request. One normalized response.
Call POST /v1/verify/document through @speedmap/node, speedmap for Python, or the verify_document tool in Speedmap Connect.
curl -X POST http://localhost:4000/v1/verify/document \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"document_type": "passport",
"front_image": "fixture:passport",
"selfie_image": "fixture:selfie",
"reason": "financialProducts",
"match": {
"document_number": "A12345678",
"date_of_birth": "1992-04-18"
}
}'{
"reference_id": "spm_e5bcf7d01a5db21d52951d8e",
"object": "verification",
"product": "document",
"method": "document_passport",
"status": "verified",
"match": true,
"field_matches": {
"date_of_birth": true
},
"mode": "sandbox",
"summary": {
"document_type": "passport",
"document_number": "*****5678",
"document_number_found": true,
"document_number_match": true,
"first_name": "A*****",
"last_name": "O*****",
"expired": false,
"expires_at": "2031-01-01",
"mrz": {
"format": "TD3",
"valid": true
},
"record_check": null,
"face_match": {
"score": 1,
"passed": true,
"threshold": 0.6,
"portrait_found": true
},
"duplicate_faces": {
"count": 0,
"reference_ids": []
},
"fraud_flags": [],
"warnings": [],
"confidence": 0.928
},
"consent": {
"mechanism": "in_person_selfie",
"consent_id": null
}
}Use cases
Where Nigerian teams use it.
Lending from a NIN slip
Read the slip, cross-check the NIMC record and match the borrower’s selfie in one call.
Driver onboarding
Extract licence class and expiry and match the portrait to the applicant.
Pre-employment checks
Verify a passport or NIN card from the candidate’s phone through a hosted capture link.
Insurance underwriting
Confirm the document is genuine and unexpired before a policy is issued.
What you get back
The fields you will read.
| Field | Meaning |
|---|---|
| summary.document_type / classification | Detected type and confidence |
| summary.document_number | Masked, with document_number_found and document_number_match (the document number you sent in match) |
| summary.mrz / barcode_read / quality | Machine-readable checks and image quality |
| summary.record_check | NIMC cross-check result for NIN documents |
| summary.face_match | Score, threshold and verdict for the portrait-to-selfie comparison |
| field_matches | Names and date of birth you sent in match, compared with the extracted fields |
| field_confidence | 0–100 per name field, tolerant of nicknames and spellings |
| summary.fraud_flags / warnings | Hard flags such as tamper_suspected, expired, face_mismatch; soft flags such as duplicate_document_number and layout_anomaly |
summary.document_type / classification
- Meaning
- Detected type and confidence
summary.document_number
- Meaning
- Masked, with document_number_found and document_number_match (the document number you sent in match)
summary.mrz / barcode_read / quality
- Meaning
- Machine-readable checks and image quality
summary.record_check
- Meaning
- NIMC cross-check result for NIN documents
summary.face_match
- Meaning
- Score, threshold and verdict for the portrait-to-selfie comparison
field_matches
- Meaning
- Names and date of birth you sent in match, compared with the extracted fields
field_confidence
- Meaning
- 0–100 per name field, tolerant of nicknames and spellings
summary.fraud_flags / warnings
- Meaning
- Hard flags such as tamper_suspected, expired, face_mismatch; soft flags such as duplicate_document_number and layout_anomaly
Assertion tier
Flags, masked numbers and scores. Extracted names are masked.
Full tier
Adds data: every extracted field, the OCR text, MRZ, barcode payload, quality and tamper analysis, and crops of the portrait and selfie face.
Pricing
One price per document check, including the NIN cross-check. Number-only lookups show an indicative price until their data agreements are in place. Billed per live check on the Scale up plan. Failed calls and idempotent retries are never billed.
- What image formats and sizes are accepted?
- JPEG, PNG or WebP up to 8 MB, as Base64 or a public https URL.
- Is a government registry checked for every document?
- NIN documents are cross-checked against the NIMC record. Passport, licence and voter’s card registry lookups are in preview until their data agreements are live.
- What happens if the image is poor?
- An unusable image fails with 422 image_quality_too_low and is not billed. A marginal one continues with warnings such as blur, glare or low_resolution.
Start verifying in minutes. Go live when you’re ready.
Create your account in under a minute and explore the full dashboard. We switch your workspace live after a short compliance review.