Skip to main content

Face Comparison (Live)

Endpoint​

POST https://api.verifik.co/v2/face-recognition/compare-live

Compares a live probe image against a gallery and performs liveness validation on the probe. Both comparison and liveness thresholds are configurable.

Headers​

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Params​

NameTypeRequiredDescription
probestringYesBase64 image string for the live capture.
gallerystring[]YesArray of base64 image strings to compare against.
osstringYesOrigin of capture. Suggested: DESKTOP, IOS, ANDROID.
search_modestringYesOne of FAST or ACCURATE.
liveness_min_scorenumberYesLiveness threshold (0.52–1.0).
compare_min_scorenumberNoOptional comparison threshold (0.67–0.95).

Request​

const fetch = require("node-fetch");

async function run() {
const res = await fetch("https://api.verifik.co/v2/face-recognition/compare-live", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
probe: "<base64>",
gallery: ["<base64>"],
os: "DESKTOP",
search_mode: "ACCURATE",
liveness_min_score: 0.65,
compare_min_score: 0.8
}),
});
console.log(await res.json());
}

run();

Response​

{
"id": "XYZ12",
"data": {
"score": 0.89,
"liveness": {
"liveness_score": 0.92,
"min_score": 0.65,
"passed": true
}
},
"signature": {
"message": "Certified by Verifik.co",
"dateTime": "January 16, 2024 3:44 PM"
}
}

Notes​

  • probe must be a single base64 string; gallery is an array of base64 strings.
  • liveness_min_score required range: 0.52–1.0. Optional compare_min_score: 0.67–0.95.
  • Response includes comparison score and liveness result; wrapped with id, data, signature.