Face Verification for KYC and eKYC Onboarding: A Complete Guide
Learn how to implement face verification for KYC compliance — compare selfies to ID documents, add liveness detection, and automate identity verification.
What Is KYC Face Verification?
KYC (Know Your Customer) requires businesses to verify their customers' identities. Face verification automates this by comparing a customer's live selfie against their ID document photo — confirming they are who they claim to be.
The eKYC Flow
Implementation
import requestsdef verify_identity(selfie_path, id_photo_path):
response = requests.post(
"https://faceapi.arsa.technology/api/v1/face_recognition/validate_faces",
headers={"x-key-secret": "YOUR_API_KEY"},
files={
"image1": open(selfie_path, "rb"),
"image2": open(id_photo_path, "rb")
}
)
result = response.json()
match = result["match_result"] # True/False
score = result["similarity_score"] # 0.0 to 1.0
is_real = result["face1_analysis"]["passive_liveness"]["is_real_face"]
age = result["face1_analysis"].get("age")
if match and is_real and score > 0.85:
return "VERIFIED"
elif not is_real:
return "LIVENESS_FAILED"
else:
return "MISMATCH"
Adding Active Liveness for Higher Security
For regulated industries like banking, add active liveness detection — the user performs head movements on video to prove they're physically present.