← 返回
数据分析 Key 中文

Didit Biometric Age Estimation

Estimates a person's age from a facial image via the Didit standalone API. Use when implementing age gating, checking if someone is over 18 or 21, performing...
通过Didit独立API从人脸图像估算人物年龄。用于实施年龄限制、检查是否年满18或21岁,以及其他年龄验证场景。
rosasalberto
数据分析 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 501
下载
💾 6
安装
1
版本
#latest

概述

Didit Age Estimation API

Overview

Estimates a person's age from a facial image using deep learning. Also performs a passive liveness check to prevent spoofing.

Key constraints:

  • Supported formats: JPEG, PNG, WebP, TIFF
  • Maximum file size: 5MB
  • Image must contain one clearly visible face
  • Accuracy: MAE ±3.5 years overall; ±1.5 years for under-18

Capabilities: Age estimation with confidence scoring, gender estimation, passive liveness detection, configurable age thresholds, per-country age restrictions, adaptive mode with ID verification fallback for borderline cases.

Liveness methods (workflow mode):

MethodSecurityBest For
---------
ACTIVE_3D (Action + Flash)HighestBanking, government, healthcare
FLASHING (3D Flash)HighFinancial services, identity verification
PASSIVE (single-frame CNN)StandardLow-friction consumer apps

API Reference: https://docs.didit.me/standalone-apis/age-estimation

Feature Guide: https://docs.didit.me/core-technology/age-estimation/overview


Authentication

All requests require x-api-key header. Get your key from Didit Business Console → API & Webhooks, or via programmatic registration (see below).

Getting Started (No Account Yet?)

If you don't have a Didit API key, create one in 2 API calls:

  1. Register: POST https://apx.didit.me/auth/v2/programmatic/register/ with {"email": "you@gmail.com", "password": "MyStr0ng!Pass"}
  2. Check email for a 6-character OTP code
  3. Verify: POST https://apx.didit.me/auth/v2/programmatic/verify-email/ with {"email": "you@gmail.com", "code": "A3K9F2"} → response includes api_key

To add credits: GET /v3/billing/balance/ to check, POST /v3/billing/top-up/ with {"amount_in_dollars": 50} for a Stripe checkout link.

See the didit-verification-management skill for full platform management (workflows, sessions, users, billing).


Endpoint

POST https://verification.didit.me/v3/age-estimation/

Headers

HeaderValueRequired
---------
x-api-keyYour API keyYes
Content-Typemultipart/form-dataYes

Request Parameters (multipart/form-data)

ParameterTypeRequiredDefaultDescription
---------------
user_imagefileYesFacial image (JPEG/PNG/WebP/TIFF, max 5MB)
rotate_imagebooleanNofalseTry 0/90/180/270 rotations for non-upright faces
save_api_requestbooleanNotrueSave in Business Console Manual Checks
vendor_datastringNoYour identifier for session tracking

Example

import requests

response = requests.post(
    "https://verification.didit.me/v3/age-estimation/",
    headers={"x-api-key": "YOUR_API_KEY"},
    files={"user_image": ("selfie.jpg", open("selfie.jpg", "rb"), "image/jpeg")},
    data={"vendor_data": "user-123"},
)
print(response.json())
const formData = new FormData();
formData.append("user_image", selfieFile);

const response = await fetch("https://verification.didit.me/v3/age-estimation/", {
  method: "POST",
  headers: { "x-api-key": "YOUR_API_KEY" },
  body: formData,
});

Response (200 OK)

{
  "request_id": "a1b2c3d4-...",
  "liveness": {
    "status": "Approved",
    "method": "PASSIVE",
    "score": 89.92,
    "age_estimation": 24.3,
    "reference_image": "https://example.com/reference.jpg",
    "video_url": null,
    "warnings": []
  },
  "created_at": "2025-05-01T13:11:07.977806Z"
}

Status Values & Handling

StatusMeaningAction
---------
"Approved"Age verified above threshold, liveness passedProceed with your flow
"Declined"Age below minimum or liveness failedCheck warnings for specifics
"In Review"Borderline case, needs reviewTrigger ID verification fallback or manual review

Error Responses

CodeMeaningAction
---------
400Invalid requestCheck file format, size, parameters
401Invalid API keyVerify x-api-key header
403Insufficient creditsTop up at business.didit.me

Response Field Reference

FieldTypeDescription
---------
statusstring"Approved", "Declined", "In Review", "Not Finished"
methodstring"ACTIVE_3D", "FLASHING", or "PASSIVE"
scorefloat0-100 liveness confidence score
age_estimationfloatEstimated age in years (e.g. 24.3). null if no face
reference_imagestringTemporary URL (expires 60 min)
video_urlstringTemporary URL for active liveness video. null for passive
warningsarray{risk, log_type, short_description, long_description}

Accuracy by Age Range

Age RangeMAE (years)Confidence
---------
Under 181.5High
18-252.8High
26-403.2High
41-603.9Medium-High
60+4.5Medium

Warning Tags

Auto-Decline

TagDescription
------
NO_FACE_DETECTEDNo face found in image
LIVENESS_FACE_ATTACKSpoofing attempt detected
FACE_IN_BLOCKLISTFace matches a blocklist entry

Configurable (Decline / Review / Approve)

TagDescription
------
AGE_BELOW_MINIMUMEstimated age below configured minimum
AGE_NOT_DETECTEDUnable to estimate age (image quality, lighting)
LOW_LIVENESS_SCORELiveness score below threshold
POSSIBLE_DUPLICATED_FACESignificant similarity with previously verified face

Warning severity: error (→ Declined), warning (→ In Review), information (no effect).


Common Workflows

Basic Age Gate

1. Capture user selfie
2. POST /v3/age-estimation/ → {"user_image": selfie}
3. Check liveness.age_estimation >= your_minimum_age
4. If "Approved" → user meets age requirement
   If "Declined" → check warnings for AGE_BELOW_MINIMUM or liveness failure

Adaptive Age Estimation (Workflow Mode)

Uses workflow_type: "adaptive_age_verification" — creates a session where borderline ages trigger automatic ID verification fallback.

1. POST /v3/workflows/ → {"workflow_type": "adaptive_age_verification", "is_liveness_enabled": true, "is_age_restrictions_enabled": true}
2. POST /v3/session/ → create session with the workflow_id from step 1
3. User takes selfie → system estimates age
4. Clear pass (well above threshold) → Approved instantly
   Clear fail (well below threshold) → Declined
   Borderline case → automatic ID verification fallback
5. If ID fallback triggered: per-country age restrictions apply

Per-Country Age Restrictions

Configure in Console per issuing country:

CountryMin AgeOverrides
---------
USA18Mississippi: 21, Alabama: 19
KOR19
GBR18
ARE21

> Use "Apply age of majority" button in Console to auto-populate defaults.


Utility Scripts

estimate_age.py: Estimate age from a facial image via the command line.

# Requires: pip install requests
export DIDIT_API_KEY="your_api_key"
python scripts/estimate_age.py selfie.jpg
python scripts/estimate_age.py photo.png --threshold 21 --vendor-data user-123

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 10:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,106
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,628
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,181