Authenticate from your server.
API access is available on request. Use your key only in your server application, never in browser code, mobile client bundles, URLs or public repositories.
| Property | Value |
|---|---|
| Base URL | MRZ_BASE_URL — provided after activation |
| Authentication | Authorization: Bearer <API_KEY> |
| Method | POST |
| Response format | application/json |
| Transport | HTTPS |
Missing or incorrect credentials return 401 unauthorized. Keys are matched exactly. After activation, you receive the separate base URL. Configure MRZ_BASE_URL and protected MRZ_API_KEY on your server. The /v1/mrz route on this website is currently disabled (HTTP 404).
Send one image as Base64 JSON.
Set Content-Type: application/json and send exactly the image_base64 field. Encode the image bytes using standard Base64.
{
"image_base64": "BASE64_IMAGE"
}Replace the placeholder. JSON contains exactly one field; its value is not a file path or image URL.
| Rule | Requirement |
|---|---|
| Base64 | Standard alphabet A–Z a–z 0–9 + /, correct = padding and canonical zero pad bits. No whitespace, line breaks, URL-safe characters or data:image/…;base64, prefix. |
| JSON shape | An object with exactly one string field. No extra fields, duplicate keys, arrays or null values. |
| Image size | At most 25 MiB = 26,214,400 decoded bytes. At most 34,952,536 Base64 characters. |
include_crop | Query parameter true (default) or false. With false, the Base64 crop image is omitted; the recognised data keeps the same response format. |
Multipart remains supported.
Existing integrations can continue to send the image in multipart field file. Let the HTTP client generate the Content-Type with its boundary. Recognition and response semantics are the same for both input formats.
curl "${MRZ_BASE_URL}/v1/mrz?include_crop=false" \
--header "Authorization: Bearer $MRZ_API_KEY" \
--form 'file=@document.jpg' POST /v1/mrz
HTTP 200 returns a MRZResponse object. Each document remains a separate candidate.
| Field | Type | Meaning |
|---|---|---|
image | object | Width, height and coordinate_space: exif_oriented_pixels. Coordinates reference the EXIF-oriented original image. |
documents | array | Zero, one or multiple separate document candidates. An empty list is valid. Do not merge fields across candidates. |
timed_out | boolean | true marks an incomplete result. Check it first even with HTTP 200. |
processing_ms | number | Processing duration for this result in milliseconds; not a latency guarantee. |
engine_version | string | Recognition engine version. Useful for support and compatibility diagnostics. |
Result states
| State | Meaning | Recommended handling |
|---|---|---|
recognized | MRZ recognised. | Still review fields, checks, corrections and diagnostics. Do not treat as proof of identity. |
uncertain | Recognition or association is uncertain. | Request manual review or a better image. Do not auto-import. |
no_mrz | No usable MRZ for this candidate. | Capture a complete, sharp MRZ again. An available crop does not mean recognition succeeded. |
documents: [] | No document candidate in the result. | Treat as no recognition, not a successfully empty document. |
timed_out: true | Processing was incomplete. | Do not auto-import. Check time budget, image quality and temporary load. |
Complete response example
Illustrative example using public ICAO Utopia data. Image bytes are replaced with BASE64_JPEG; timing and version values illustrate the type and are not performance claims.
{
"image": {
"width": 1200,
"height": 760,
"coordinate_space": "exif_oriented_pixels"
},
"documents": [
{
"status": "recognized",
"format": "TD3",
"raw_mrz": [
"P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<",
"L898902C36UTO7408122F1204159ZE184226B<<<<<10"
],
"mrz": [
"P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<",
"L898902C36UTO7408122F1204159ZE184226B<<<<<10"
],
"fields": {
"document_code": "P<",
"issuing_state": "UTO",
"document_number_raw": "L898902C3",
"nationality": "UTO",
"date_of_birth": "740812",
"sex": "F",
"date_of_expiry": "120415",
"optional_data": "ZE184226B<<<<<",
"names_raw": "ERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<",
"document_number": "L898902C3",
"document_number_extended": false,
"surname_raw": "ERIKSSON",
"given_names_raw": "ANNA<MARIA",
"surname": "ERIKSSON",
"given_names": "ANNA MARIA"
},
"checks": {
"date_of_birth": {
"expected": "2",
"actual": "2",
"valid": true,
"applicable": true
},
"date_of_expiry": {
"expected": "9",
"actual": "9",
"valid": true,
"applicable": true
},
"optional_data": {
"expected": "1",
"actual": "1",
"valid": true,
"applicable": true
},
"document_number": {
"expected": "6",
"actual": "6",
"valid": true,
"applicable": true
},
"composite": {
"expected": "0",
"actual": "0",
"valid": true,
"applicable": true
}
},
"corrections": [],
"errors": [],
"mrz_quad": [
[
60.63999938964844,
516.3800048828125
],
[
1112.280029296875,
515.219970703125
],
[
1112.6600341796875,
601.4600219726562
],
[
60.790000915527344,
602.9500122070312
]
],
"recognition_score": 0.9833,
"recognition_method": "neural_mrz_casefold_aspect0.7+neural_mrz_casefold",
"document_quad": [
[
11.5600004196167,
3.5999999046325684
],
[
1185.4300537109375,
9.420000076293945
],
[
1185.760009765625,
756.9400024414062
],
[
9.619999885559082,
754.3699951171875
]
],
"crop_quad": [
[
11.559963226318358,
3.598575592041015
],
[
1185.4285889897849,
9.422903061521222
],
[
1185.759399282995,
756.9421386655698
],
[
9.615039825346546,
754.3733520866444
]
],
"document_score": 0.9992,
"crop_basis": "document",
"association_basis": null,
"recognition_retry": null,
"crop_jpeg_base64": "BASE64_JPEG"
}
],
"timed_out": false,
"processing_ms": 125.5,
"engine_version": "0.1.6"
}Document object: all public fields
| Field | Type | Meaning |
|---|---|---|
status | string | recognized · uncertain · no_mrz |
format | string | null | TD1 · TD2 · TD3 |
raw_mrz / mrz | string[] | Original and selected MRZ lines. Preserve line lengths and < fillers. |
fields | object | Extracted data. Values are string, boolean or null; not every field is always present. |
checks | object | Check objects for document number, dates, optional data and composite check. See below. |
corrections | array | line and index are zero-based; from, to and score record character corrections. |
errors | string[] | Candidate diagnostics. This is not an HTTP error field. Review before importing. |
document_quad / mrz_quad / crop_quad | array | null | Coordinate pairs [x,y] for each geometry. Missing geometry is null. |
crop_basis | string | null | document, input_border_context, document_mrz_extension |
association_basis | string | null | Optional association evidence: unique_partial_overlap_surface, unique_continuous_surface_corridor, unique_context_detector_consensus. Not proof of physical document identity. |
recognition_score / document_score | number | null | Internal scores. Do not interpret as calibrated correctness probabilities or percentages. |
recognition_method | string | null | Name of the recognition method. Diagnostic metadata, not a fixed enum for business logic. |
recognition_retry | object | null | Evidence of a reread: method and previous source_document without image bytes. May contain additional evidence. |
crop_jpeg_base64 | string | null | Document crop as plain Base64 JPEG bytes. May be absent or null, especially with include_crop=false. Not a separately cropped portrait. |
Extracted fields
| Field | Meaning |
|---|---|
surname, given_names | Normalised names; original reading in surname_raw, given_names_raw, names_raw. |
document_number | Full document number; document_number_raw retains the original main field, document_number_extended marks continuations. |
document_code | Original two-character code, e.g. P<. |
issuing_state, nationality | MRZ codes including any fillers. Unknown codes are preserved and flagged. |
date_of_birth, date_of_expiry | Raw MRZ dates in YYMMDD format; incomplete birth dates may contain <. This endpoint does not determine the century. |
sex | MRZ value M, F or <. |
optional_data, optional_data_2, optional_data_remaining | Format-dependent optional raw data. No personal identification number is inferred from them. |
Interpret check digits correctly
{"expected":"6","actual":"6","valid":true,"applicable":true}expected is the calculated digit, actual is the observed digit; either can be null. Only applicable=true and valid=true mean an applicable check passed. Missing or non-applicable checks do not count as passed. Check names: document_number, date_of_birth, date_of_expiry, optional_data and composite.
Handle diagnostics and multiple documents.
Each candidate carries its diagnostics in errors. Also inspect checks, corrections and, when present, recognition_retry. A recognized status does not replace these checks.
| Evidence | Meaning & handling |
|---|---|
| Check digits | checksum_<name> in errors marks a failed check digit. The individual values are in checks. |
| Corrections | Review corrections and differences between raw_mrz and mrz. Not all fields are protected by check digits. |
| Reread | recognition_retry describes a reread of the same lossless crop. Its source_document preserves the preceding result without image bytes. |
| Document association | association_basis and coordinates describe the spatial association of a document and MRZ. They do not prove a person’s identity or document authenticity. |
Document diagnostics
The current engine can return the following diagnostic groups. Failed check digits also appear as checksum_<name> in errors. Preserve unknown future codes and route them to review instead of assuming success.
Syntax and field contents
Unknown country/state codes
Correction and character evidence
Image position and time budget
Multiple candidates remain separate.
documents contains every candidate, including those with uncertain or no_mrz. The API does not select one flat result or merge fields. If your application expects exactly one document, check the count and candidates explicitly. Ask for a separate document image or provide manual selection when ambiguous. documents: [] means no candidate was found.
HTTP errors and concrete next steps.
Request and service failures use HTTP 4xx/5xx. The table covers current engine mappings, including shared decoder diagnostics. Not every diagnostic code can occur for every format.
| HTTP | Error / response | What your application should do |
|---|---|---|
| 400 | invalid_content_length | Invalid Content-Length. Let the HTTP client calculate this header. |
| 422 | invalid_request | Invalid JSON shape: image_base64 is missing, is not a string, or extra fields are present. Send an object with exactly this string field. |
| 401 | unauthorized | Bearer token missing or incorrect. Check the key; do not retry unchanged. |
| 405 | detail | Wrong method. Use POST. |
| 408 | upload_timeout | Upload exceeded its time window. Check the connection or send a smaller file. |
| 413 | upload_too_large | Transport, Base64 or decoded-file limit exceeded. Reduce the image; Base64 increases data size. |
| 413 | Image, pixel or decoder limit. Reduce dimensions; do not send PDFs to this single-image endpoint. | |
| 422 | invalid_json | Malformed JSON, duplicate keys or an invalid JSON constant. Generate valid UTF-8 JSON. |
| 422 | invalid_base64 | Empty, invalid or non-canonical Base64. Re-encode original bytes using standard Base64 without line breaks. |
| 422 | No usable image. Send a supported file with a legible MRZ. | |
| 422 | Format-specific decoder failure. Check the file or convert to JPEG/PNG while preserving quality. | |
| 422 | PDF/page diagnostics from the shared decoder. This interface accepts one image; send a suitable page as an image. The internal batch API is not publicly exposed. | |
| 422 | detail: […] | FastAPI validation on /v1/mrz, e.g. a missing multipart field or invalid query parameter. Correct fields/parameters. |
| 500 | processing_failed | Internal processing or response error. Retry only a limited number of times; contact support if repeated. |
| 503 | service_busy | Processing capacity is occupied. Honour Retry-After: 2 and reduce concurrency. |
| 504 | processing_timeout | Processing stopped. Error response includes timeout evidence; after a short pause try a smaller or more suitable image. |
| 4xx / 5xx | request_failed / detail | Generic HTTP or proxy failure. Check the HTTP status and Content-Type; error responses do not match the successful MRZResponse model. |
Distinguish error envelopes
{"error":"invalid_base64"}{"error":"processing_timeout","timed_out":true,"documents":[]}Proxy errors may return a simple object such as {"error":"request_failed"}. An unknown URL can return HTTP 404 with text rather than JSON. Always check status and Content-Type before reading a success model. Handle new diagnostic codes defensively.
A reliable flow for your application.
Check the HTTP response
4xx: correct input or credentials. 503: honour Retry-After. 500/502/504: retry a limited number of times with a pause. Catch network failures and non-JSON responses separately.
Check the processing outcome
timed_out=false, intended candidate present, anddocuments[].status=recognized. Explicitly check candidate count and association. Do not import partial fields from negative outcomes.Validate warnings and fields
Evaluate checks, corrections, raw readings and association evidence. Validate required fields, date assumptions, age and expiry against your business rules. Do not fill missing fields with guesses.
Import or route to review
Import only after your acceptance criteria are met. Route uncertain, ambiguous or incomplete results to a visible review process. Never declare documents authentic because check digits pass.
Decode image outputs from Base64 and validate JPEG format and dimensions before further processing. Create a display data URL only in your own UI. Log technical status/error codes rather than document images, full responses or API keys.
Formats and limits
| Area | Behaviour |
|---|---|
| Enterprise API | 25 MiB decoded image bytes; 40 million pixels. One image per request. |
| Input formats | JPEG, PNG, WebP, HEIC and supported camera RAW files. RAW support depends on the format/camera model. |
Do not send to /v1/mrz. Provide a document page as an image first. | |
| MRZ formats | TD1: 3 × 30 · TD2: 2 × 36 · TD3: 2 × 44 |
| Prepared Enterprise API: response and retention | Synchronous JSON response. The current base recognition service processes images in memory and does not persist documents or results. The protected customer archive with 30-day retention included in paid offers is configured individually. The free demo does not provide download links to a customer archive. Store your own downloads only according to your intended workflow. |
AI image enhancement is a separate extension on request. This interface has no standard parameter to activate “Enhance Output Image with AI”.
Public website demo
Consent and training storage in the demo
Selecting files or samples, dropping files or activating the camera starts transmission after the visible storage notice. The interface sends X-Training-Consent: training-v3; training-v1 and training-v2 remain accepted for older clients. The header identifies the notice version.
Original images and complete results are stored encrypted for 30 days from upload for training and quality improvement, then deleted automatically. You can request earlier deletion at info@oasisscan.de using your upload ID. This storage applies only to the public demo.
X-Training-Upload-ID provides the ID of an accepted storage record. An upload may already be stored even when recognition fails; do not automatically repeat it in that case. Cancelling or resetting does not delete stored data.
Demo-specific errors: 422 training_consent_required means the notice marker is missing or unsupported; 503 training_storage_unavailable means secure storage is temporarily unavailable. Processing does not silently continue without storage. 503 service_busy without an upload ID can be retried a limited number of times after Retry-After. Browser batch mode uses up to four concurrent single-image requests and shows a status and upload ID per file. See the privacy notice.