1
采集2
结果menu_bookAPI 参考:活体expand_more
官方文档: docs.verifik.co/biometrics/liveness
本演示调用 POST /v2/face-recognition/liveness,传入 os 与 image(base64)。通过/未通过依据 liveness_score 与 min_score(省略 liveness_min_score 时默认 0.6)。
POST /v2/face-recognition/liveness
返回活体分数,超过最低阈值时为 passed。
| 字段 | 值 |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| os | string | 是 | DESKTOP、IOS 或 ANDROID |
| image | string | 是 | base64 图像(或 https URL;服务端可能拉取) |
| collection_id | string | 否 | 本次尝试的可选人脸库 |
| liveness_min_score | number | 否 | 通过/未通过阈值(默认 0.6) |
await fetch("https://api.verifik.co/v2/face-recognition/liveness", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify({
os: "DESKTOP",
image: "<base64>",
liveness_min_score: 0.6,
}),
});// 200 OK, example shape
{
"id": "…",
"data": {
"passed": true,
"min_score": 0.6,
"liveness_score": 0.98
},
"signature": {
"message": "Certified by Verifik.co",
"dateTime": "…"
}
}- 响应包含 id 与 data 旁的签名字段。
- 省略 os 将返回 409 MissingParameter。
活体检测
选择来源以验证真人在场。
测试样例
点击人像即可对库存照片运行活体(与上传相同)。