The Face Comparison API allows you to perform a 1:1 comparison to find facial similarity. It offers the ability to analyze and score the resemblance between two images, which can be images from a document or camera images, as long as they differ between the "gallery" and "probe" parameters.

Verifik has a guide on what compare services are and how to use them; we invite you to read it: Compare Guide.

Ensure you provide valid images encoded in base64 in the request and choose the appropriate search mode for your specific needs (FAST or ACCURATE). The response will contain essential information about the comparison work, including timestamps and certification details.

Compare 1:1 Vs Face verify

If you have read all the guides in this documentation, you may have noticed that these services perform very similar processes, so what sets them apart?:

The differentiating factor between these services is how the comparison process is performed:

Implementation

Request

import axios from 'axios';

const options = {
  method: 'POST',
  url: '<https://api.verifik.co/v2/face-recognition/compare>',
  params: {
  },
  headers: {
    Accept: 'application/json',
    Authorization: 'jwt <tu_token>'
  },
  data: {
    probe: ['Base 64 String'],
    gallery: ['Base 64 String'],
    search_mode: 'FAST/ACCURATE choose one, default FAST'
  }
};

try {
 notFou const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}

Response 200 - (Successful request)

{
  "id": "0jy93",
  "data": {
    "__v": 0,
    "_id": "65171e23640f7872b17ed99d",
    "type": "compare",
    "probe": [
      "Base 64 image"
    ],
    "client": "64404b1f9856cc8cebd762e7",
    "result": {
      "score": 1
    },
    "deleted": false,
    "gallery": [
      "Base 64 image"
    ],
    "createdAt": "2023-09-29T18:57:42.028Z",
    "updatedAt": "2023-09-29T18:57:42.028Z",
    "comparedAt": "2023-09-29T18:57:39.059Z",
    "search_mode": "FAST"
  },
  "signature": {
    "message": "Certified by Verifik.co",
    "dateTime": "September 29, 2023 6:57 PM"
  }
}