Identity Document scanner API

Accurate data is automatically extracted.

Andia Scanning technology works on driving licenses, passports, Mexican Voter IDs, travel visas, and others documents.

Requirements

A desktop or mobile web browser.

Integration

The integration of this SDK is very straight forward.

1) Inside any HTML page just import the Javascript library before the </body> tag

<script src="https://s3.us-east-2.amazonaws.com/api.andia/andiaScanSdk.js" ></script>
<div class="component-wrapper">
<andia-ui-web autoscroll>
<img slot="loader-image" src="https://s3.us-east-2.amazonaws.com/api.andia/loader-icon.1.0.41.gif" />
</andia-ui-web>
</div>
<div id="result" ></div>

2) Callback

To get the result of the scan, just implement the following 2 javascript functions

<script type="text/javascript">
AndiaScan.SDK.SetApiKey('YOUR_API_KEY');
document.querySelector('andia-ui-web').addEventListener('resultReady', function(event) {
var result = event.detail.result;
$("#result").append(JSON.stringify(result)); //do something
console.log(JSON.stringify(result));
});
document.querySelector('andia-ui-web').addEventListener('error', function(event) {
var error = event.error, message = event.message;
$("#result").append(JSON.stringify(error)); //do something
});
</script>

Parameters

YOUR_API_KEY . Your customer API_KEY , mandatory (we provide these credentials)

Response JSON

success . Boolean, true if the Selfie was made successful

data A JSON object with the following fields.

//Example Response
{
"success": true,
"error_code": 0,
"data": [{
"primaryID": "DIAZ LOPEZ",
"secondaryID": "JOSE ROBERTO",
"documentCode": "P<",
"documentNumber": "G12501128",
"documentType": "PASSPORT",
"issuer": "MEX",
"sex": "M",
"nationality": "MEX",
"dateOfBirth": {
"day": 19,
"month": 10,
"year": 1993,
"originalString": "931019"
},
"dateOfExpiry": {
"day": 13,
"month": 11,
"year": 2022,
"originalString": "221113"
},
"alienNumber": "",
"applicationReceiptNumber": "",
"immigrantCaseNumber": "",
"mrtdVerified": true,
"opt1": "<<<<<<<<<<<<<<",
"opt2": "",
"rawMRZString": "P<MEXDIAZ<LOPEZ<<JOSE<LOPEZ<<<<<<<<<<<<<<<<<\nG125011284MEX9310195M2211178<<<<<<<<<<<<<<04\n",
"type": "MRTD"
}]
}