Verifik
Verifik
Verifik
  • Documentation
  • Accounts
    • Authentication
      • Email Authentication
      • Phone Authentication
      • Renew your token (JWT)
      • Create new token & revoke previous tokens
    • Clients
      • Account information
  • Services
    • SmartCheck
      • App Query example
    • SmartAccess
      • Dashboard
    • Access
      • Email Access Example
      • Phone Access Example
      • Biometric Access Example
    • SmartEnroll
    • Enroll
      • Tutorial
    • Smart Scan
  • Biometrics API's
    • Liveness
      • Liveness Detection
    • Compare
      • Compare & Liveness detection
      • Compare 1:1
    • Search
      • Search 1:N | Live
      • Search 1:N
      • Search 1:N | Crop
      • Face Detect
      • Face Verify
  • Scan Docs API's
    • Scan Studio
      • Documents supported
      • 🇨🇴[Example] Tarjeta de propiedad
    • Scan Prompt
      • Documents supported
      • Scan Prompt templates
  • Resources
    • Projects
      • The Project object
      • Create a project
      • Update a project
      • Retrieve a project
      • List all projects
    • Project Flows
      • The ProjectFlow object
      • Create a project flow
        • Login settings
        • Onboarding settings
        • Security settings
      • Update a project flow
      • Retrieve a project flow
      • List all project flows
    • App Logins
      • The AppLogin object
      • Create an app login
      • Retrieve an app login
      • List all app logins
    • App Registrations
      • The AppRegistration object
      • Create an app registration
      • Sync app registration status
      • Retrieve an app registration
      • List all app registrations
    • Credits
      • The Credit object
      • Retrieve a credit record
      • List all credit records
    • Document Validations
      • The DocumentValidation object
      • Enroll - Create Document Validation
      • Retrieve a document validation
      • List all document validations
      • Delete a document validation
    • Email Validations
      • The Email Validation object
      • Create Email Validation
      • Validate an Email Validation
      • Retrieve an Email Validation
      • List of Email Validations
    • Phone Validations
      • The Phone Validation object
      • Create Phone Validation
      • Validate Phone Validation
      • Retrieve a Phone Validation
      • List of Phone Validations
    • Collections
      • The Collection object
      • Create a Collection
      • Retrieve a Collection
      • List all Collection
    • Persons
      • The Person object
      • Create a Person
      • Create a Person [With Liveness detection]
      • Update a Person
      • Delete a Person
      • Retrieve a Person
      • List all Persons
    • Webhooks
      • The Webhook object
      • Create a Webhook
      • Update a Webhook
      • Delete a Webhook
      • Retrieve a Webhook
      • List all Webhooks
      • Webhook integration
    • Biometric Validations
      • The Biometric Validation Object
      • Create Biometric Validation
      • Validate Biometric Validation
      • Retrieve a Biometric Validation
      • List all Biometric Validations
  • Plans & Pricings
    • Database Screening plans
    • Smart Access Plans
      • Free Plans
      • Active Users
      • Sessions
      • Extra Charges
      • Enterprise Plans
    • SmartEnroll Plans
    • Enroll Plans
    • SMS/WhatsApp Pricing
  • Identity validation
    • 🇦🇷Argentina
    • 🇧🇴Bolivia
    • 🇧🇷Brazil
    • 🇨🇦Canada
      • 🇨🇦Ontario Driver license
      • 🇨🇦Quebec Driver license
      • 🇨🇦British Columbia license
    • 🇨🇱Chile
      • 🇨🇱Chilean taxpayer information
    • 🇨🇴Colombia
      • Colombian Citizen
      • Colombian Citizen with Extra Data
      • Special Stay Permit (PEP)
      • Temporary Protection Permit (PPT)
      • Colombian Foreigner ID (CE)
      • Colombian Politically Exposed Persons
    • 🇨🇷Costa Rica
    • 🇩🇴Dominican Republic
    • 🇪🇨Ecuador
    • 🇸🇻El Salvador
    • 🇬🇹Guatemala
    • 🇭🇳Honduras
    • 🇲🇽Mexican
    • 🇵🇦Panama
    • 🇵🇾Paraguay
    • 🇵🇪Peru
      • 🇵🇪[v3] Peruvian Citizen
      • 🇵🇪[v3] Full Peruvian Citizen
      • 🇵🇪Peruvian Citizen
      • 🇵🇪Peruvian Foreigner Resident
      • 🇵🇪Peruvian Citizen Information with Extra Data
    • 🇪🇸Spain Citizen
    • 🇺🇸United States
      • 🇺🇸SSN Verification (Social Security Number)
      • 🇺🇸Florida Driver License Validation
      • 🇺🇸Kansas Driver's License Verification
    • 🇺🇾Uruguay
    • 🇻🇪Venezuela
      • 🇻🇪Venezuelan Citizen Information
      • 🇻🇪Venezuelan Foreigner citizens
  • Vehicle Validation
    • 🇦🇷Argentina
    • 🇧🇴Bolivia
    • 🇧🇷Brazil
    • 🇨🇱Chile
      • 🇨🇱Vehicle Information
      • 🇨🇱Driver license
    • 🇨🇴Colombia
      • 🇨🇴Vehicle by Code - Fasecolda
      • 🇨🇴SIMIT Resolutions
      • 🇨🇴Complete vehicle with historical records by VIN - RUNT
      • 🇨🇴Information System for Drivers Transporting Dangerous Goods
      • 🇨🇴Vehicle's SOAT and RTM by Plate and Identification document
      • 🇨🇴General query of SIMIT by license plate
      • 🇨🇴Driver's License
      • 🇨🇴Vehicle by plate and identification card only
      • 🇨🇴Vehicle Values by Plate - Fasecolda
      • 🇨🇴Verifik Pico y Placa for Bogotá
      • 🇨🇴Complete vehicle with historical records by plate and identification document - RUNT
      • 🇨🇴SIMIT Agreements
      • 🇨🇴SIMIT Fines
      • 🇨🇴General query of SIMIT by Identification Document
      • 🇨🇴Sinister Verification - Fasecolda
      • 🇨🇴Vehicle Fines Check in Bogotá, Colombia
      • 🇨🇴Taxes in Bogota
      • 🇨🇴Vehicle accidentality in Bogota
    • 🇨🇷Costa Rica
    • 🇪🇨Ecuador
      • 🇪🇨Ecuador Vehicle Fines
      • 🇪🇨Vehicle Information Lookup
    • 🇲🇽Mexico
    • 🇵🇾Paraguay
    • 🇵🇪Peru
      • 🇵🇪Peruvian Vehicle
      • 🇵🇪Peruvian Vehicle Insurance
    • 🇺🇸United States
      • 🇺🇸Vehicle Information
      • 🇺🇸Vehicle Information by VIN
  • Business Validation
    • 🇦🇷Argentina
    • 🇧🇴Bolivia
    • 🇧🇷Brazil
    • 🇨🇦Canada
    • 🇨🇱Chilean
    • 🇨🇴Colombia
      • 🇨🇴Colombian Business Information - RUES
      • 🇨🇴Complete Business Registry - RUES
      • 🇨🇴Colombian Company DIAN Verification
      • 🇨🇴Verify Legal Invoicer in DIAN for Colombian Companies
    • 🇨🇷Costa Rica
    • 🇲🇽Mexico
    • 🇵🇦Panama
    • 🇵🇾Paraguay
    • 🇵🇪Peru
    • 🇪🇸Spain
    • 🇺🇸United States
  • Background Check
    • 🇧🇷Brazil
    • 🇨🇴Colombia
      • 🇨🇴Public Contracts
      • 🇨🇴Colombian Police Record Check
      • 🇨🇴Verify Police Compliance with Corrective Measures
      • 🇨🇴Comptroller Certificate
      • 🇨🇴Disciplinary Records in Colombia (attorney's office)
    • 🌎International
      • 🌎DEA Background Check
      • 🌎Europol Background Check
      • 🌎FBI Background Check
      • 🌎Interpol Background Check
      • 🌎OFAC Background Check
      • 🌎ONU Background Check
  • Military
    • 🇨🇴Colombia
  • Finance
    • 🇨🇴Delinquent debtors
  • Legal
    • 🇨🇴Lawyer Verification
    • 🇨🇴Colombian Legal Processes
    • 🇨🇴Retrieve Details of a Legal Process by Number
    • 🇨🇴Court Case Records Lookup
    • 🇨🇴Certificate of Validity for Legal Professionals
  • Certificates
    • 🇨🇴Registry Certificate
    • 🇨🇴High Altitude Job Eligibility
    • 🇨🇴SENA Certificates
  • Voting
    • 🇨🇴Retrieve Voting Information for Colombian Citizens
  • Health
    • 🇨🇴Colombian RETHUS Verification Data
    • 🇨🇴Verify Colombian Affiliations
  • Verifik LLC
    • Privacy Policy
    • Políticas de Privacidad
    • Términos y Condiciones
    • Terms and Conditions
    • Acuerdo de Niveles de Servicio
    • Service Level Agreement
    • Verifik for Enterprises HUB (Esp)
    • Verifik for Enterprises HUB (Eng)
    • SmartCheck Terms and Conditions of Use
Powered by GitBook
On this page
  • Endpoint
  • What This API DoesThis API performs two key tasks:
  • How It Works
  • This is great for:
  • Best Practices
  • Examples
  • Troubleshooting
  • What You Need
  • Ready to integrate?
  • Headers
  • Body
  • Body Example
  • Response
  • Response Structure
  1. Biometrics API's
  2. Compare

Compare & Liveness detection

API to compare selfies and perform a liveness detection on the 'probe' selfie.

This service helps you compare a single selfie (called the "probe") with a collection of selfies (called the "gallery") to verify identities and perform a liveness detection to the probe image. It’s perfect for controlling access to your app or completing Know Your Customer (KYC) checks securely.

Let’s break it down step by step!

Endpoint

https://api.verifik.co/v2/face-recognition/compare-with-liveness

What This API DoesThis API performs two key tasks:

  • Facial Comparison (1-to-many): It checks if the face in your probe selfie matches any face in the gallery of selfies.

  • Liveness Detection: It ensures the probe selfie is of a live person (not a photo or video) to prevent fraud.

By using this, you can confidently allow or deny access to your app based on whether the selfie matches and is from a live person.

How It Works

  • You send a selfie (probe) and a gallery of selfies to the API.

  • The API compares the probe face against each face in the gallery (1-to-many comparison).

  • It also checks if the probe selfie shows a live person using liveness detection.

  • You get a result with scores to decide if there’s a match and if the person is live.

This is great for:

  • App Access Control: Only let verified, live users into your app.

  • KYC (Know Your Customer): Verify user identities for compliance and security.

Best Practices

  • Security: Keep your API token safe and use HTTPS.

  • Image Quality: Use clear, well-lit selfies for best results.

  • Testing: Test with different devices (iOS, Android) and gallery sizes.

  • Thresholds: Start with default min_score values, then tweak based on false positives/negatives.

Examples

Troubleshooting

  • No Match?

    • Check image quality or try ACCURATE mode.

    • Ensure gallery contains the right faces.

  • Liveness Fails?

    • Ensure the probe is a live selfie (not a printed photo).

    • Increase liveness_min_score if too many live checks fail.

  • Errors?

    • Verify your token and base64 encoding.

What You Need

  • A selfie to compare (probe).

  • A set of selfies to compare against (gallery).

  • An API token (get this from Verifik’s dashboard or from the Authentication APIs).

Ready to integrate?

Follow the code example, test with your selfies, and adjust scores to fit your app’s needs.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

os

string

OS from where you are doing the operation. [DESKTOP, IOS, ANDROID]

probe

string

Face encoded in base64

gallery

Array

Array of images to compare with the face inside probe.

search_mode

string

search mode, it could be FAST, ACCURATE.

compare_min_score

number

Percentage for the minimum comparison between gallery and probe. (liveness will not be tested if the score is less than the minimum) [min 0.67 - max 0.95]

liveness_min_score

number

Percentage for the minimum value of the liveness test [ min 0.52 - max 1]

Body Example

{
    "os": "DESKTOP",
    "probe": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD...",
    "gallery": [
        "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD...",
        "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD..."
    ],
    "search_mode": "FAST",
    "compare_min_score": 0.85,
    "liveness_min_score": 0.6
}
  • probe: The single selfie you want to check.

  • gallery: A list of selfies to compare against (can be multiple images).

  • compare_min_score: Set how similar the faces need to be (higher = stricter = better).

  • liveness_min_score: Set how sure you want to be that the person is live (higher = stricter = safer).

Response

`
{
    "data": {
        "comparison": {
            "client": "613375a1eab2fe08527f81e2",
            "type": "compareLive",
            "search_mode": "ACCURATE",
            "gallery": [],
            "probe": [],
            "status": "success",
            "_id": "66e650d6b71ae4d43a76d95d",
            "comparedAt": "2024-09-15T03:13:26.392Z",
            "result": {
                "score": 1
            },
            "updatedAt": "2024-09-15T03:13:29.652Z",
            "createdAt": "2024-09-15T03:13:29.652Z",
            "__v": 0
        },
        "liveness": {
            "client": "613375a1eab2fe08527f81e2",
            "type": "liveness",
            "status": "success",
            "search_mode": "FAST",
            "os": "DESKTOP",
            "liveness_min_score": 0.7,
            "_id": "66e650d9b71ae4d43a76d95f",
            "result": {
                "liveness_score": 0.77,
                "passed": true,
                "min_score": 0.7
            },
            "updatedAt": "2024-09-15T03:13:31.675Z",
            "createdAt": "2024-09-15T03:13:31.675Z",
            "__v": 0
        }
    },
    "signature": {
        "dateTime": "September 15, 2024 3:13 AM",
        "message": "Certified by Verifik.co"
    },
    "id": "ABRCB"
}
{
    "code": "MissingParameter",
    "message": "missing search_mode\n"
}
 ---------------------------------------
{
    "code": "MissingParameter",
    "message": "missing probe\n"
}
---------------------------------------
{
    "code": "MissingParameter",
    "message": "missing gallery\n"
}

Response Structure

Comparison

  • client (String): The unique identifier of the client making the comparison request.

  • type (String): Describes the type of comparison. In this case, it is compareLive for live image comparison.

  • search_mode (String): Specifies the mode of search used. Options include ACCURATE for precise comparisons.

  • status (String): Indicates the success or failure of the comparison request. Expected value: success.

  • result (Object): Contains the comparison results:

    • score (Number): The score of the comparison. A value of 1 indicates a perfect match.

  • comparedAt (DateTime): Timestamp of when the comparison was performed.

  • updatedAt (DateTime): Timestamp of the last update.

  • createdAt (DateTime): Timestamp of the creation of this record.

liveness Section

  • client (String): The unique identifier of the client making the liveness check request.

  • type (String): Specifies the type of test. In this case, it is liveness.

  • status (String): Indicates the success or failure of the liveness check. Expected value: success.

  • search_mode (String): The mode of search used for liveness detection. In this case, FAST mode is used.

  • os (String): Operating system used during the check, e.g., DESKTOP.

  • liveness_min_score (Number): The minimum score needed for the liveness check to pass. In this case, the threshold is 0.6.

  • result (Object): The result of the liveness check:

    • liveness_score (Number): The score achieved in the liveness test. A score of 0.77 was achieved.

    • passed (Boolean): Whether the liveness test passed. In this case, true indicates success.

    • min_score (Number): The minimum score needed for passing. For this check, it is 0.6.

  • updatedAt (DateTime): Timestamp of the last update.

  • createdAt (DateTime): Timestamp of the creation of this record.

Signature Section

  • dateTime (String): Timestamp when the results were certified, in human-readable format.

  • message (String): Certification message confirming that the results were generated and certified by Verifik.co.

PreviousCompareNextCompare 1:1

Last updated 2 months ago