For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
HomeAPI Reference
HomeAPI Reference
  • Overview
    • API Overview
  • Vlens API
      • POSTExtract national ID front
      • POSTExtract national ID back
      • POSTExtract passport data
      • POSTExtract car license front (owner info)
      • POSTExtract car license back (vehicle specs)
      • POSTExtract driving license data
      • POSTMatch face against ID photo
      • POSTCompare two face images
      • POSTLiveness detection (three frames)
      • POSTExtract license plate text
      • POSTClassify document type
      • POSTAML validation
Dashboard
LogoLogo
Vlens APIOCR

Compare two face images

||View as Markdown|
POST
https://api.vlenseg.com/v1/ocr/face/compare
POST
/v1/ocr/face/compare
$curl -X POST https://api.vlenseg.com/v1/ocr/face/compare \
> -H "ApiKey: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "face_image1": "/9j/FACE1_BASE64...",
> "face_image2": "/9j/FACE2_BASE64..."
>}'
200OCR_faceCompare_example
1{
2 "services": {
3 "validations": {
4 "validation_errors": [
5 {
6 "field": "string",
7 "value": "string",
8 "errors": [
9 {
10 "code": 1,
11 "message": "string"
12 }
13 ]
14 }
15 ]
16 },
17 "spoofing": {
18 "fake": true
19 },
20 "classification": {
21 "doc_type": "string"
22 },
23 "liveness": true,
24 "AML": {
25 "AML_matched": true,
26 "data": [
27 {
28 "caseNo": "string",
29 "caseYear": 1,
30 "recordDate": "2024-01-15T09:30:00Z",
31 "fullName": "string",
32 "idNumber": "string",
33 "dateOfBirth": "2024-01-15T09:30:00Z",
34 "score": "string"
35 }
36 ]
37 },
38 "SRC": {
39 "isValid": true,
40 "errorCode": 1,
41 "errorKey": "string",
42 "errorMessage": "string"
43 }
44 },
45 "data": {
46 "transaction_id": "string",
47 "request_id": "string",
48 "client_transaction_id": "string",
49 "isMatched": true,
50 "dissimilarity": 1.1,
51 "threshold": 1.1,
52 "score": 1.1,
53 "detected_face_image": true,
54 "detected_id_face_image": true
55 },
56 "error_code": 1,
57 "error_message": "string"
58}
Directly compare any two face images without requiring an ID transaction. Returns the same match result as Face Match.
Was this page helpful?
Previous

Match face against ID photo

Next

Liveness detection (three frames)

Built with

Authentication

ApiKeystring
Static API key issued to your tenant. Obtain from the Vlens dashboard.
AuthorizationBearer

Short-lived JWT. Obtain via:

  • /api/credentials/Login for admin / service tokens
  • /api/DigitalIdentity/Register or login for end-user tokens

Request

This endpoint expects an object.
face_image1stringRequired

Base64-encoded first face image.

face_image2stringRequired

Base64-encoded second face image.

livenessstringOptionalDefaults to 2
Liveness mode flag.
transaction_idstring or nullOptional
client_transaction_idstring or nullOptional
request_idstring or nullOptional
countrystring or nullOptionalDefaults to EGY
getExtractedDatabooleanOptionalDefaults to false

Response

Face comparison result.
servicesobject
Results from the various backend verification services.
dataobject
Result of matching a face image against an ID photo.
error_codeinteger or null
error_messagestring or null