Prompt

How do I verify a passport with an API?

Legal / Compliance & Regulatory1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

Verifying a passport with an API usually means one or more of these things:

  1. Document authenticity — is the passport real / tamper-free?
  2. Data validation — do the OCR/MRZ details make sense?
  3. Identity verification — does the person presenting it match the document?
  4. Government registry check — is the passport number valid and current?
    • This is rarely available directly via public APIs and usually requires special government or regulated access.

Typical API-based passport verification flow

1) Collect the document image

Ask the user to upload:

  • passport photo page
  • sometimes the MRZ page is enough if your provider supports it

2) Send to a document verification API

Common providers include:

  • Onfido
  • Jumio
  • Veriff
  • Persona
  • Mitek
  • AU10TIX

These APIs usually perform:

  • OCR extraction
  • MRZ parsing
  • security feature checks
  • liveness/selfie match
  • face comparison

3) Receive verification result

The API typically returns:

  • document type: passport
  • extracted fields:
    • full name
    • passport number
    • nationality
    • date of birth
    • expiration date
  • checks:
    • document readable
    • MRZ valid
    • checksum valid
    • document not expired
    • image tampering / fraud signals
    • face match score

4) Decide pass/fail

You define your own rules, for example:

  • reject if document expired
  • reject if OCR confidence too low
  • reject if selfie mismatch
  • escalate to manual review if uncertain

Example: what a passport verification API call looks like

Most APIs follow a pattern like:

POST /verify-document
Content-Type: multipart/form-data

file=@passport.jpg
type=passport

Response might look like:

{
  "status": "verified",
  "document_type": "passport",
  "fields": {
    "first_name": "JOHN",
    "last_name": "DOE",
    "passport_number": "123456789",
    "nationality": "USA",
    "date_of_birth": "1990-01-01",
    "expiry_date": "2030-01-01"
  },
  "checks": {
    "mrz_valid": true,
    "ocr_confidence": 0.98,
    "tamper_detected": false,
    "face_match": true
  }
}

Important limitations

  • You generally cannot “look up” a passport in a public database with a normal API.
  • A “verified” result usually means:
    • the document appears genuine,
    • the data is consistent,
    • and the person matches the document.
  • Legal/regulatory requirements vary by country:
    • KYC/AML
    • GDPR/privacy rules
    • consent requirements
    • retention limits

If you want to build this yourself

You can combine:

  • OCR: Google Vision, AWS Textract, Azure OCR
  • MRZ parsing: open-source MRZ libraries
  • Face match / liveness: AWS Rekognition, Google Face APIs where permitted, or specialized vendors
  • Fraud checks: custom image analysis or third-party verification provider

But for production compliance, a dedicated identity verification vendor is usually easier.


Recommendation

If your goal is to verify passports for onboarding, use a KYC vendor API rather than building from scratch.

If you want, I can give you:

  1. a sample API integration in Python/Node.js, or
  2. a list of passport verification providers with pricing/features.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.