Skip to content

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

Passport MRZ check digits, the QR barcode on NIN slips and cards, number formats and expiry dates.

NIMC record cross-check

NIN documents are checked against the NIMC record, so a convincing fake with a real-looking number still fails.

Portrait to selfie

A selfie or capture session is compared with the printed portrait; in live mode, add a BVN for an N-Face comparison.

Tamper and duplicate signals

Error-level analysis flags edited images, and duplicate faces and document numbers are checked within your workspace.

Quality gate first

Unusable images fail with image_quality_too_low and a retake hint before anything is billed.

Name confidence

Extracted names are compared with yours in field_matches, with field_confidence 0–100 per name, tolerant of nicknames.

How it works

From request to decision.

  1. 1

    Capture the document

    Use the Capture SDK, a hosted capture link or your own camera; send the back image where one exists.

  2. 2

    POST /v1/verify/document

    Send the document type, images, purpose code and fields to match, plus a selfie for the portrait.

  3. 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.

Request
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"
  }
}'
Response · 200 OK
{
  "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.

Part of:Mobility & logisticsInsuranceHR & gig platforms

What you get back

The fields you will read.

  • 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.

FAQ

Document Verification questions.

Need more detail? Read the documentation or talk to our team.

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.