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 age verification for compliance, or detecting underage users. Includes passive liveness check. Supports configurable thresholds, adaptive fallback to ID verification, and per-country restrictions.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "didit-biometric-age-estimation" with this command: npx skills add rosasalberto/didit-biometric-age-estimation

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Dingding

钉钉开放平台开发助手,精通机器人、审批流程、日程管理等企业 API

Registry SourceRecently Updated
General

Takeout Coupon 外卖优惠券隐藏券大额券,美团、京东、闪购/饿了么

调用外卖优惠券API获取各平台(美团、淘宝闪购/饿了么、京东)的隐藏外卖券列表及聚合领券页面。返回优惠券代码和领取说明,用户可复制优惠码到对应APP领取。

Registry SourceRecently Updated
General

AI Rankings Leaderboard (AI 排行榜)

Comprehensive AI leaderboard for LLM models and AI applications. Query model rankings, model IDs, and pricing from OpenRouter and Pinchbench. Trigger words i...

Registry SourceRecently Updated