Loading...
Loading...
Integrate Didit Face Match standalone API to compare two facial images. Use when the user wants to compare faces, verify face identity, implement biometric comparison, facial recognition, or selfie-to-document matching using Didit. Returns a similarity score (0-100) with configurable decline threshold. Supports image rotation and multi-face detection.
npx skill4agent add didit-protocol/skills didit-face-matchuser_imageref_imagex-api-keyPOST https://apx.didit.me/auth/v2/programmatic/register/{"email": "you@gmail.com", "password": "MyStr0ng!Pass"}POST https://apx.didit.me/auth/v2/programmatic/verify-email/{"email": "you@gmail.com", "code": "A3K9F2"}api_keyGET /v3/billing/balance/POST /v3/billing/top-up/{"amount_in_dollars": 50}POST https://verification.didit.me/v3/face-match/| Header | Value | Required |
|---|---|---|
| Your API key | Yes |
| | Yes |
| Parameter | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| file | Yes | — | JPEG/PNG/WebP/TIFF, max 5MB | User's face image to verify |
| file | Yes | — | Same as above | Reference image to compare against |
| integer | No | | 0-100 | Scores below this = Declined |
| boolean | No | | — | Try 0/90/180/270 degree rotations to find upright face |
| boolean | No | | — | Save in Business Console Manual Checks |
| string | No | — | — | Your identifier for session tracking |
import requests
response = requests.post(
"https://verification.didit.me/v3/face-match/",
headers={"x-api-key": "YOUR_API_KEY"},
files={
"user_image": ("selfie.jpg", open("selfie.jpg", "rb"), "image/jpeg"),
"ref_image": ("id_photo.jpg", open("id_photo.jpg", "rb"), "image/jpeg"),
},
data={"face_match_score_decline_threshold": "50"},
)const formData = new FormData();
formData.append("user_image", selfieFile);
formData.append("ref_image", referenceFile);
formData.append("face_match_score_decline_threshold", "50");
const response = await fetch("https://verification.didit.me/v3/face-match/", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: formData,
});{
"request_id": "a1b2c3d4-...",
"face_match": {
"status": "Approved",
"score": 80,
"user_image": {
"entities": [
{"age": 27.63, "bbox": [40, 40, 100, 100], "confidence": 0.717, "gender": "male"}
],
"best_angle": 0
},
"ref_image": {
"entities": [
{"age": 22.16, "bbox": [156, 234, 679, 898], "confidence": 0.717, "gender": "male"}
],
"best_angle": 0
},
"warnings": []
},
"created_at": "2025-05-01T13:11:07.977806Z"
}| Status | Meaning | Action |
|---|---|---|
| Score >= threshold | Faces match — proceed |
| Score < threshold or no face | Check |
| Needs manual review | Wait for review or retrieve via session API |
| Code | Meaning | Action |
|---|---|---|
| Invalid request | Check file format, size, parameters |
| Invalid API key | Verify |
| Insufficient credits | Top up at business.didit.me |
| Field | Type | Description |
|---|---|---|
| string | |
| integer | 0-100 similarity score (higher = more similar). |
| float | Estimated age |
| array | Face bounding box |
| float | Face detection confidence (0-1) |
| string | |
| integer | Best rotation angle for the face |
| array | |
| Tag | Description | Auto-Decline |
|---|---|---|
| Reference or face image missing | Yes |
| No face detected in one or both images | Yes |
| Score below threshold — potential identity mismatch | Configurable |
Security best practice: Only store the status and score. Minimize biometric image data on your servers. Image URLs (in workflow mode) expire after 60 minutes.
| Score Range | Interpretation | Action |
|---|---|---|
| 90-100 | Very high confidence — same person | Auto-approve |
| 70-89 | High confidence — likely same person | Approve (default threshold 30) |
| 50-69 | Moderate — possible match | Consider manual review |
| 30-49 | Low — likely different people | Declined at default threshold |
| 0-29 | Very low — different people | Declined |
export DIDIT_API_KEY="your_api_key"
python scripts/match_faces.py selfie.jpg id_photo.jpg
python scripts/match_faces.py selfie.jpg id_photo.jpg --threshold 50 --rotate