Read passport or ID line (MRZ)
About this tool
How to use it
- Choose this tool.
- Add a clear picture of the passport page or ID card, or type the code lines instead.
- Leave the kind of document on automatic unless you know it.
- Press Generate.
- Read or copy the details.
What you get back
Try Read passport or ID line (MRZ) in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/images/mrz" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'text=P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10' \
-F 'type=auto' \
-F 'region=0.4'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.mrz({
"text": "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<\nL898902C36UTO7408122F1204159ZE184226B<<<<<10",
"type": "auto",
"region": 0.4
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->mrz([
'text' => 'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10',
'type' => 'auto',
'region' => 0.4,
]);
echo $result->requestId;