ID Analyzer Developer ID Analyzer Developer
  • Home
  • Portal
  • Support
ID Analyzer Developer ID Analyzer Developer
ID Analyzer Developer
  • Home
  • Portal
  • Support
  • Home
  • Core API
    • Overview
    • Quick Start
    • API Reference
  • DocuPass API
    • Overview
    • Quick Start
    • API Reference
  • Vault API
    • Overview
    • Quick Start
    • API Reference
  • AML API
    • Overview
    • Quick Start
    • API Reference
  • Client Library
    • PHP
    • .NET
    • NodeJS
    • Python
  • Guide
    • Web-based ID Scanner
    • DocuPass Custom UI Design
  • Change Log
  • ID Fort On-Premise

Core API Reference

Getting Started

ID Analyzer Core API is accessed through the HTTP protocol by making a POST request with the document image and optional parameters to the API endpoint:

                    https://api.idanalyzer.com
                

Core API supports 3 types of POST requests: multipart/form-data, x-www-form-urlencoded and application/json, simply choose the one you find most convenient and be sure to set the correct Content-Type header in your request.

Uploading Document Image

There are 3 different methods of uploading the document and face image to ID Analyzer API, through either multipart/form-data encoded image, base64-encoded image or remote hosted image. ID Analyzer supports JPG, PNG, BMP, GIF, PDF files.

Primary Document Image

You must upload a primary document image, this is usually the front of the identification document, or inner bio-data page for passports.

Key Value Description
file Image encoded in multipart/form-data Requires 1 Your request header must contain Content-Type: multipart/form-data, this type of encoding is very common when uploading files through web browser.
file_base64 Base64-encoded image Requires 1 You can upload a base64-encoded image as a string using application/x-www-form-urlencoded or application/json.
url Image URL Requires 1 Core API is capable of downloading remote image from your server. You can send an url using application/x-www-form-urlencoded or application/json.
Secondary Document Image

Performing a dual-side scan allows you to upload both front and back of a document in a single request, data obtained from both sides will be aggregated into a single response.

Key Value Description
file_back Image encoded in multipart/form-data Optional Multipart/form-data encoded image of the back of the document to perform a dual-side scan.
file_back_base64 Base64-encoded image Optional Base64-encoded image of the back of the document to perform a dual-side scan.
url_back Image URL Optional Remote image of the back of the document to perform a dual-side scan.

Biometric Verification

ID Analyzer Core API allows you to do facial recognition and verification by uploading a photo of the document holder for analysis, the API also supports video biometric verification for scenarios requiring extra security.

Photo Biometric Verification

Similar to uploading the document image, you can upload user photo in 3 different ways.

Key Value Description
face Face image encoded in multipart/form-data Optional Multipart/form-data encoded image of a person's face to perform photo biometric verification.
face_base64 Base64-encoded face image of a person Optional Base64-encoded image of a person's face to perform photo biometric verification.
faceurl Face image URL Optional Remote image of of a person's face to perform photo biometric verification.
Video Biometric Verification

Video biometric verification allows you to submit a selfie video of the document holder for verification. The video should be kept under 15 seconds in MP4, MOV or AVI format.

Key Value Description
video Selfie video encoded in multipart/form-data Optional Multipart/form-data encoded selfie video to perform video biometric verification.
video_base64 Base64-encoded selfie video Optional Base64-encoded selfie video to perform video biometric verification.
videourl Selfie video URL Optional Remote hosted selfie video to perform video biometric verification.
passcode 4 digit number Optional Override the default year of birth passcode with your own passcode. Person within the video must record themselves while pronouncing this 4 digit passcode, otherwise the video biometric verification will fail.

To further enhance the security of video biometric verification, a person recording selfie video for verification must speak what we call a passcode to pass the verification. The default passcode is the person's 4 digit year of birth as presented on the document. You must supply your own passcode if no birth year can be found on the document, you may also override the default passcode to your own code by including a passcode parameter.

3 requirements to pass video biometric check:

  • Liveness check (Real person not some photo hold up against camera)
  • Person in video pronounced the correct passcode
  • Person in video matches with photo on document

General Parameters

Use the following parameters to access all the features of Core API and fine-tune OCR results.

Key Value Description
apikey String Required Your private API key is available under your web portal.
accuracy 2: High accuracy (Default)
1: Balanced
0: High performance
Optional Configure the speed and accuracy of document recognition and ocr results. Low accuracy will reduce response time to under 1 second while high accuracy will generally takes 2~3 seconds.
authenticate Boolean (Default false) Optional Validate the document to check whether the document is authentic and has not been tampered.
authenticate_module 1: Module v1 (Default)
2: Module v2
quick: Quick check against fake ID database
Optional Specify module used for validating the document.
biometric_threshold Number between 0 to 1 (Default: 0.4) Optional Specify the minimum score to pass facial biometric verification.
return_confidence Boolean (Default false) Optional Return confidence score for each data field.
return_empty Boolean (Default false) Optional By default, the API will only return data fields containing information. You can get the API to return null on empty fields by enabling this parameter.
ocr_scaledown Number between 500 to 4000 or 0. (Default 1500) Optional Scale down uploaded image before sending sending it to OCR/Barcode engine. Increasing this value will sacrifice performance for better accuracy, value of above 2500 is recommended to read PDF417 barcodes. Set 0 to disable image resizing.
fix_orientation Boolean (Default true) Optional Detect and fix orientation of uploaded image.
disable_barcode Boolean (Default false) Optional Disable barcode reader for faster reading speed.
outputimage Boolean (Default false) Optional Produce a cropped image of the document.
outputface Boolean (Default false) Optional Produce a cropped image of the face region on the document.
outputmode url - Return hosted image URL (Default)
base64 - Return base64 encoded image
Optional Output the cropped document and face as either URL or base64-encoded content.
dualsidecheck Boolean (Default false) Optional Check if the names, document number and document type matches between the front and the back of the document when performing dual-side scan. If any information mismatches error 14 will be thrown.
verify_expiry Boolean (Default false) Optional Check if the document is still valid based on its expiry date.
verify_documentno String Optional Check if supplied document number matches with document.
verify_name String Optional Check if supplied name matches with document.
verify_dob String (YYYY/MM/DD) Optional Check if supplied date of birth matches with document.
verify_age String (range, example: 18-40) Optional Check if the document holder is aged between the given range.
verify_address String Optional Check if supplied address matches with document.
verify_postcode String Optional Check if supplied postcode matches with document.
country String (ISO ALPHA-2 Country Code) Optional Check if the document was issued by specified countries, if not error code 10 will be thrown. Separate multiple values with comma. For example "US,CA" would accept documents from United States and Canada.
region String Optional Check if the document was issued by specified state, if not error code 11 will be thrown. Separate multiple values with comma. For example "CA,TX" would accept documents from California and Texas.
type P: Passport
D: Driver's License
I: Identity Card
Optional Check if the document was one of the specified types, if not error code 12 will be thrown. For example "PD" would accept both passport and drivers license.

Vault Parameters

Vault is an optional secure cloud storage database that allows you to store user identity information, ID images and legal contracts. You can view items stored in Vault under your web portal, or retrieve them using Vault API.

Key Value Description
vault_save Boolean (Default true) Optional Save document image and parsed information in your secured vault. You can list, search and update document entries in your vault through Vault API or web portal.
checkblocklist Boolean (Default false) Optional Check the document data against blocked entries in your vault. If the document matches one of the blocked entry error 15 will be thrown
vault_saveunrecognized Boolean (Default false) Optional Save document image in your vault even if the document cannot be recognized.
vault_noduplicate Boolean (Default false) Optional Prevent duplicated images from being saved.
vault_automerge Boolean (Default false) Optional Automatically merge images with same document number into a single entry inside vault.
vault_customdata1
vault_customdata2
vault_customdata3
vault_customdata4
vault_customdata5
String Optional Add up to 5 custom strings that will be associated with the vault entry, this can be useful for filtering and searching entries.

AML/PEP Parameters

Core API has the capability to automatic search worldwide sanction, criminal and Politically Exposed Person(PEP) databases using information presented on uploaded ID. Allowing you to conduct KYC/AML compliance check on the fly and get instant results.

Key Value Description
aml_check Boolean (Default false) Optional Check document holder's name and document number against ID Analyzer AML Database.
aml_database String Optional Specify the source databases to perform AML check, if left blank, all source databases will be checked. Separate each database code with comma, for example: un_sc,us_ofac. For full list of source databases and corresponding code visit AML API Overview.
aml_strict_match Boolean (Default false) Optional By default, entities with identical name or document number will be considered a match even though their birthday or nationality may be unknown. Enable this parameter to reduce false-positives by only matching entities with exact same nationality and birthday.

Paperwork Automation Parameters

Core API allows you to generate legal documents as part of your process flow using data from user uploaded ID. You must first create a contract template under your portal and copy the template ID into the parameter below. If your legal document requires a e-signature, you should use the data results from Core API and create a DocuPass Signature session.

Key Value Description
contract_generate String Optional Contract template ID to autofill with user data.
contract_format PDF DOCX HTML Optional Output document format.
contract_prefill_data JSON String Optional JSON data in key-value pairs to autofill dynamic fields, data from user ID will be used first in case of a conflict. For example, passing {"myparameter":"abc"} would fill %{myparameter} in contract template with "abc".

API Response

Successful Response
{
    "result": {
        "documentNumber": "I1234568",
        "firstName": "IMA",
        "lastName": "CARDHOLDER",
        "fullName": "IMA CARDHOLDER",
        "sex": "F",
        "height": "5'-05\"",
        "weight": "125",
        "age": 43,
        "dob": "1977\/08\/31",
        "dob_day": 31,
        "dob_month": 8,
        "dob_year": 1977,
        "expiry": "2014\/08\/31",
        "expiry_day": 31,
        "expiry_month": 8,
        "expiry_year": 2014,
        "daysToExpiry": -2406,
        "issued": "2009\/08\/31",
        "issued_day": 31,
        "issued_month": 8,
        "issued_year": 2009,
        "daysFromIssue": 4233,
        "address1": "2570 24TH STREET",
        "address2": "ANYTOWN, CA",
        "postcode": "95818",
        "vehicleClass": "C",
        "restrictions": "NONE",
        "endorsement": "NONE",
        "documentType": "D",
        "documentSide": "FRONT",
        "issuerOrg_region_full": "California",
        "issuerOrg_region_abbr": "CA",
        "issuerOrg_full": "United States",
        "issuerOrg_iso2": "US",
        "issuerOrg_iso3": "USA",
        "nationality_full": "United States",
        "nationality_iso2": "US",
        "nationality_iso3": "USA",
        "internalId": "1739"
    },
    "confidence": {
        "documentNumber": 0.853
        "firstName": 0.951
        "lastName": 0.935
        ...
    },
    "face": {
        "isIdentical": false,
        "confidence": "0.091"
    },
    "verification": {
        "passed": false,
        "result": {
            "face": false,
            "notexpired": false,
            "name": true,
            "dob": true,
            "postcode": true,
            "address": false
        }
    },
    "authentication": {
        "score": 0.1,
        "breakdown": {
            "data_visibility": {
                "passed": true
            },
            "image_quality": {
                "passed": true
            },
            "feature_referencing": {
                "passed": true
            },
            "exif_check": {
                "passed": false,
                "code": 130,
                "reason": "Image edited in Photoshop",
                "severity": "medium"
            },
            "publicity_check": {
                "passed": false,
                "code": 140,
                "reason": "This document could be obtained in the public domain",
                "severity": "high"
            },
            "text_analysis": {
                "passed": true
            },
            "biometric_analysis": {
                "passed": true
            },
            "security_feature_check": {
                "passed": false,
                "code": 171,
                "reason": "Security feature partially missing",
                "severity": "low"
            },
            "recapture_check": {
                "passed": false,
                "code": 180,
                "reason": "Recaptured document",
                "severity": "medium"
            }
        },
        "warning": [
            "Image edited in Photoshop",
            "This document could be obtained in the public domain",
            "Security feature partially missing",
            "Recaptured document"
        ],
    },
    "aml": [
        {
            "entity": "person",
            "fullname": [
                "IMA CARDHOLDER"
            ],
            "firstname": [
                "IMA"
            ],
            "lastname": [
                "CARDHOLDER"
            ],
            "alias": [
                "IMA CARDHOLDER",
                "CARDHOLDER SAMPLE"
            ],
            "dob": [
                "1967"
            ],
            "address": [
                "2570 24TH STREET ANYTOWN, CA, US(possibly)"
            ],
            "nationality": [
                "US"
            ],
            "documentnumber": [
                {
                    "id": "I1234568",
                    "id_formatted": "I1234568",
                    "country": "us",
                    "type": "I"
                }
            ],
            "program": [
                "SDN List"
            ],
            "note": [
                "Executive Order 13224 (Terrorism)"
            ],
            "time": "2019-09-03T22:00:00.000Z",
            "source": [
                "https:\/\/www.treasury.gov\/resource-center\/sanctions\/Pages\/default.aspx"
            ],
            "database": "us_ofac",
            "schema": "sanction"
        }
    ],
    "contract": {
        "document_url": "https:\/\/objects.idanalyzer.com\/1f6e13d7298ac088490aacfb72c85235.pdf"
    },
    "vaultid": "I3MS6XjOqsB7Zbye54ohG9F7rtvW02Zv",
    "matchrate": 0.95,
    "executionTime": 1.3062239170074462890625,
    "responseID": "25ca84e72040fcf060f6f20f76031cd0",
    "quota": 999,
    "credit": 999
}
Error Response
{
    "error": {
        "message": "Document not recognized",
        "code": 9
    },
    "executionTime": 0.0062239170074462890625,
    "responseID": "45ca84e72040fcf060f6f20f76031cd0"
}
Response Reference
Key Description
result Contains an array of matched fields and their value. Possible values are:
ID Numbers
documentNumber[str]
Unique identifier associated with the document (e.g. Passport No./Driver License No./Card Number etc)
personalNumber[str]
Unique personal identifier associated with the person within a country (e.g. National ID Number)

Note. Document design standards are different for every country, you may encounter documents with both documentNumber and personalNumber, or only one of the fields.

Names
firstName[str]
First name / Given name
middleName[str]
Middle name(s)
lastName[str]
Last name / Family name
fullName[str]
If the first name and last name cannot be distinguished, full name will be returned instead
firstName_local[str]
First name in local language if available
middleName_local[str]
Middle name in local language if available
lastName_local[str]
Last name in local language if available
fullName_local[str]
Full name in local language if available
Dates
dob[str]
Date of birth in YYYY/MM/DD
dob_day[int]
Date of birth day 1 to 31
dob_month[int]
Date of birth month 1 to 12
dob_year[int]
Date of birth year in YYYY
expiry[str]
Expiry date of document in YYYY/MM/DD
expiry_day[int]
Day of expiry 1 to 31
expiry_month[int]
Month of expiry 1 to 12
expiry_year[int]
Year of expiry in YYYY
issued[str]
Date of issue in YYYY/MM/DD
issued_day[int]
Day of issue 1 to 31
issued_month[int]
Month of issue 1 to 12
issued_year[int]
Year of issue in YYYY
daysToExpiry[int]
Number of days before the document expires
daysFromIssue[int]
Number of days since the document was issued
Personal Information
age[int]
Age of the document holder
sex[str]
Gender M=Male, F=Female, X=Unspecified
height[str]
Height of person
weight[str]
Weight of person
hairColor[str]
Hair Color - ANSI D-20 hair color code (3 letters)
eyeColor[str]
Eye Color - ANSI D-20 eye color code (3 letters)
address1[str]
Address line 1
address2[str]
Address line 2
postcode[str]
Address postcode
placeOfBirth[str]
Place of birth
Document Information
documentSide[str]
Side of the document: FRONT, BACK or BIODATA
documentType[str]
Type of document: P=Passport, D=Driver's License, I=Identity Card, V=Visa, R=Residence Card, O=Other
documentName[str]
If documentType is "O", a document name will be included.
issuerOrg_region_full[str]
Document issuer subregion/state. Example: California
issuerOrg_region_abbr[str]
Document issuer subregion/state abbreviation. Example: CA
issuerOrg_full[str]
Document issued country. Example: United States
issuerOrg_iso2[str]
Document issued country code in ISO2. Example: US
issuerOrg_iso3[str]
Document issued country code in ISO3. Example: USA
nationality_full[str]
Document holder nationality. Example: United States
nationality_iso2[str]
Document holder nationality in ISO2. Example: US
nationality_iso3[str]
Document holder nationality in ISO3. Example: USA
vehicleClass[str]
Driver license vehicle class
restrictions[str]
Driver license restrictions
endorsement[str]
Driver license endorsement
Other Data
optionalData[str]
Extra unspecific data included in the document
optionalData2[str]
Extra unspecific data included in the document
internalId[int]
Used to identify the unique document ID under ID Analyzer system, same type of document should have the same ID.
confidence

If return_confidence is set to true, a key-value array containing field name and confidence level will be returned. Confidence score is a float between 0 to 1.

face

If a biometric verification request was submitted, an array will be returned:

isIdentical[bool]
true
Biometric verification passed
false
Biometric verification failed
confidence[float]
Value between 0 to 1 on how similar the two faces are, 1 being identical.

Upon Error, a different array will be returned:

error[int]
Error Code
error_message[str]
Error message. Example: Could not find face data within facial image

Biometric verification error codes:

1
Could not find face in document image.
2
Could not find face in face image.
3
Multiple face detected within face image.
4
Supplied photo failed to pass liveness check.
5
You must provide a custom passcode since year of birth is missing from the document.
6
Invalid passcode format, 4 digit number expected.
7
Video format not supported or file corrupted
8
Passcode verification failed.
9
Face is not clearly visible throughout the entire video.
10
Supplied video failed to pass liveness check.
authentication

If authenticate is set to true, the document will be validated and an array will be returned:

Authenticate Module V1 Response
score[float]
The score will be a float between 0 to 1. Valid documents will have a score closer to 1 while fake or edited documents will have a score closer to 0. It is your discretion to decide the boundary, a good starting point would be rejecting score less than 0.5
Authenticate Module V2 Response
score[float]
The score will be a float between 0 to 1. Valid documents will have a score closer to 1 while fake or edited documents will have a score closer to 0. It is your discretion to decide the boundary, a good starting point would be rejecting score less than 0.5
breakdown[array]

Returns details about each checks performed and their results.

Code Reason Severity
data_visibility Check if document number, firstname, lastname and birthday are clearly visible
100 Name is not clearly visible High
101 Document number is not clearly visible High
102 Date of birth is not clearly visible Medium
image_quality Check if the image appears to be a high quality image taken directly from camera without cropping or resizing
110 Image appears to be computer generated High
111 Image is too blurry Low
112 Document image too small Low
113 Document file too small Low
114 Black white image Low
feature_referencing Check features and details of submitted document with a genuine document reference
120 Document features does not match up with genuine document Medium
121 Unable to perform feature referencing on provided document type Low
exif_check Check if the image has been edited in photo editing software
130 Image edited in (program name) Medium
publicity_check Check if the document can be obtained from a public domain such as the internet
140 This document could be obtained in the public domain High
text_analysis Check if the text present in the document has been tampered
150 Text fragments appears to be computer generated High
151 Unnatural text '(list of texts)' detected in '(list of fields)' Medium
152 Text too blurry for analysis High
153 No text fragment detected High
biometric_analysis Check biometric features of the document
160 No photo detected High
161 Predicted age of photo is (age prediction), (age on document) shown on document Low
162 Gender mismatch between document and photo Medium
163 Photo failed to pass liveness check High
security_feature_check Check if watermark, hologram, laser engraving are present on the document
170 Security feature completely missing Medium
171 Security feature partially missing Low
172 Security feature verification not supported for this document Low
recapture_check Check if the document is a recaptured image from a screen
180 Recaptured document Medium
warning[array]
Array of string containing warning messages about validity of the document
Authenticate Module "Quick" Response
score[float]
The score will be either 0 or 1. Valid documents will have a score of 1 while fake documents will have a score of 0.
verification

If any of the verification parameters were submitted, an array will be returned:

passed[bool]
true
Document has passed all verifications
false
Document has failed at least one verification type
result[array]
Array containing result boolean for individual verification:

Field Description
checkdigit If the type of document has a check digit/soundex algorithm, whether the check digits are valid.
face If biometric verification is enabled, whether similarity confidence score is above set threshold.
notexpired Whether the document has not yet expired.
documentNumber Whether supplied document number matched with document number parsed from ID.
name Whether supplied name matched with the name parsed from ID.
age Whether document holder is within the set age range.
dob Whether supplied birthday matched with the birthday parsed from ID.
address Whether supplied address matched with the address parsed from ID.
postcode Whether supplied postcode matched with the postcode parsed from ID.
cccode If the type of document has Chinese commercial code (CC code) implementation, whether the CC codes are valid.
aml Array containing list of AML matches, returns an empty array if no match was found. For specific details refer to AML API Reference.
contract

If a template ID is set through contract_generate, an autofilled document will be generated:

document_url[string]
URL to generated document
error[string]
In case the contract failed to generate, this field will contain reason such as "Invalid contract template ID".
vaultid Unique identifier to the vault entry if vault_save is enabled.
matchrate The ratio of fields successfully recognized by the API, a low ratio would indicate the document image is too blurry.
output If outputimage is set to true and outputmode is url, this field will include an URL (or an array of URLs for dualside scan) pointing to the cropped document image. The link is only guaranteed to live for 600 seconds, and will be removed any time after.
outputface If outputface is set to true and outputmode is url, this field will include an URL pointing to the cropped face image. The link is only guaranteed to live for 600 seconds, and will be removed any time after.
cropped If outputimage is set to true and outputmode is base64, this field will include a base64-encoded image (or an array of base64-encoded images for dualside scan) of cropped document in JPEG format
croppedface If outputface is set to true and outputmode is base64, this field will include a base64-encoded image of cropped face region of the document in JPEG format
executionTime Time taken for the API operation in seconds.
responseID A unique identifier to identify the request/response.
quota Remaining API quota, resets at beginning of each month for free or yearly subscriber, or at start of each billing cycle for monthly subscriber. If you have a subscription plan, your monthly quota will be used before your credit.
credit Remaining test credit for your account. If you have a subscription plan, your monthly quota will be used before your credit.
error

This field will only be returned if there was an error, containing the following array:

code[int]
1
Invalid API Key
2
Invalid remote image URL
3
Download remote image failed
4
Invalid remote image MIME type
5
No input document image detected
6
Invalid file extension for file upload
7
Image file format not supported or corrupted
8
You have exhausted your quota, please purchase or upgrade your subscription plan.
9
Document not recognized
10
Document was not issued by one of the specified countries
11
Document was not issued by one of the specified regions
12
Document of this type is not accepted
13
Image missing from dual-side request
14
Dual-side check failed, information mismatch between front and back of document
15
Document blocked
99
Unexpected API error
message[str]
Description of the error encountered.
Interpreting Results

Once you receive response from server, you should first check if the error key is present and handle the errors. The next step is to check if all the data fields needed by your application is present inside the result object, for example you need to record customer first name, last name and date of birth, you then need to look for the result.firstName, result.lastName and result.dob values.

If you are performing a biometric verification, you should check if face.isIdentical equals to true. Alternatively, you can also check for verification.face value.

If you are authenticating the document, you should check if authentication.score is bigger than a threshold, for example, 0.5.

If you are performing additional verifications, such as name or age verification, you should check whether verification.name and verification.age equals to true.

If you are performing AML/PEP compliance checks, you should make sure that the aml field is empty, a non-empty value indicates potential matches and warrants further investigation.

Code Examples

Below are some code examples without using our client libraries.

Base64 Image upload
  • PHP
  • Python
$pathToDocumentImage = "document.jpg";
$post = [
    'file_base64' => base64_encode(file_get_contents($pathToDocumentImage)),
    'apikey' => 'YOUR API KEY'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.idanalyzer.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
$response = curl_exec($ch);
var_export($response);
import requests
import base64

documentpath = "documentimage.jpg"
facepath = "face.jpg"
apikey = "Your API Key"

with open(documentpath, "rb") as image_file:
    encoded_document_image = base64.b64encode(image_file.read())
with open(facepath, "rb") as faceimage_file:
    encoded_face_image = base64.b64encode(faceimage_file.read())

payload = {'apikey': apikey, 'file_base64': encoded_document_image, 'face_base64': encoded_face_image}

r = requests.post("https://api.idanalyzer.com", data=payload)
result = r.json()
if "error" in result:
    #failed
    print("Error #" + str(result['error']['code']) + " " + result['error']['message'])
else:
    #success
    print(result['result'])
Multipart/formdata image upload
  • PHP
  • Python
$url = 'https://api.idanalyzer.com';
$apikey = 'Your API Key';

$header = array('Content-Type: multipart/form-data');
$path_to_document = realpath('document.jpg');
$path_to_face = realpath('face.jpg');

if (function_exists('curl_file_create')) {
	$image1 = curl_file_create($path1);
	$image2 = curl_file_create($path2);
} else {
	$image1 = '@' . $path1;
	$image2 = '@' . $path2;
}

$fields = array('file' => $image1, 'face' =>  $image2, 'apikey' => $apikey);
$resource = curl_init();
curl_setopt($resource, CURLOPT_URL, $url);
curl_setopt($resource, CURLOPT_HTTPHEADER, $header);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($resource, CURLOPT_POST, 1);
curl_setopt($resource, CURLOPT_POSTFIELDS, $fields);
$result = json_decode(curl_exec($resource),true);
curl_close($resource);

if(!array_key_exists('error', $result)){
    //success
    print_r($result);
}else{
    //failed
    echo("Error #" . $result['error]['code'] . " " . $result['error']['message']);
}
import requests

documentfile = open('document_image_path', 'rb')
facefile = open('face_image_path', 'rb')
headers = {'content-type': 'multipart/form-data'}

payload = {'apikey': 'your_apikey'}
files = {'file': documentfile, 'face': facefile}
r = requests.post("https://api.idanalyzer.com", data=payload, files=files)
result = r.json()
if "error" in result:
    #failed
    print("Error #" + str(result['error']['code']) + " " + result['error']['message'])
else:
    #success
    print(result['result'])
Submitting remote images
  • PHP
  • Python
$url = 'https://api.idanalyzer.com';
$apikey = 'Your API Key';

$path_to_document = "https://www.idanalyzer.com/assets/images/sampleid.jpg";
$path_to_face = "https://www.idanalyzer.com/assets/images/sampleface.jpg";

$fields = array('url' => $path_to_document, 'faceurl' =>  $path_to_face, 'apikey' => $apikey);
$resource = curl_init();
curl_setopt($resource, CURLOPT_URL, $url);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($resource, CURLOPT_POST, 1);
curl_setopt($resource, CURLOPT_POSTFIELDS, $fields);
$result = json_decode(curl_exec($resource),true);
curl_close($resource);

if(!array_key_exists('error', $result)){
	//success
	print_r($result);
}else{
	//failed
	echo("Error #" . $result['error']['code'] . " " . $result['error']['message']);
}
import requests

path_to_document = "https://www.idanalyzer.com/assets/images/sampleid.jpg"
path_to_face = "https://www.idanalyzer.com/assets/images/sampleface.jpg"
payload = {'apikey': 'your_apikey', 'url': path_to_document, 'faceurl': path_to_face}
r = requests.post("https://api.idanalyzer.com", data=payload)
result = r.json()
if "error" in result:
    #failed
    print("Error #" + str(result['error']['code']) + " " + result['error']['message'])
else:
    #success
    print(result['result'])
On this page:
Getting Started Uploading Image Biometric Verification Parameters Reading Response Code Examples

© 2025 All Rights Reserved by ID Analyzer