✓ Verified ✍️ Content Creation ✓ Enhanced Data

Didit Age Estimation

Integrate Didit Age Estimation standalone API to estimate a person's age from a facial image.

Rating
4.5 (423 reviews)
Downloads
549 downloads
Version
1.0.0

Overview

Integrate Didit Age Estimation standalone API to estimate a person's age from a facial image.

Complete Documentation

View Source →

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/reference/age-estimation-standalone-api


Authentication

All requests require x-api-key header. Get your key from Didit Business Console → API & Webhooks.


Endpoint

text
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

python
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())

typescript
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)

json
{
  "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

text
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)

text
1. Configure workflow with age thresholds in Console
2. POST /v3/session/ → create session with age-estimation workflow
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.

Installation

Terminal bash

openclaw install didit-age-estimation
    
Copied!

💻Code Examples

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

post-httpsverificationdiditmev3age-estimation.txt
### Headers

| Header | Value | Required |
|---|---|---|
| `x-api-key` | Your API key | **Yes** |
| `Content-Type` | `multipart/form-data` | **Yes** |

### Request Parameters (multipart/form-data)

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `user_image` | file | **Yes** | — | Facial image (JPEG/PNG/WebP/TIFF, max 5MB) |
| `rotate_image` | boolean | No | `false` | Try 0/90/180/270 rotations for non-upright faces |
| `save_api_request` | boolean | No | `true` | Save in Business Console Manual Checks |
| `vendor_data` | string | No | — | Your identifier for session tracking |

### Example

}

.txt
### Status Values & Handling

| Status | Meaning | Action |
|---|---|---|
| `"Approved"` | Age verified above threshold, liveness passed | Proceed with your flow |
| `"Declined"` | Age below minimum or liveness failed | Check `warnings` for specifics |
| `"In Review"` | Borderline case, needs review | Trigger ID verification fallback or manual review |

### Error Responses

| Code | Meaning | Action |
|---|---|---|
| `400` | Invalid request | Check file format, size, parameters |
| `401` | Invalid API key | Verify `x-api-key` header |
| `403` | Insufficient credits | Top up at business.didit.me |

---

## Response Field Reference

| Field | Type | Description |
|---|---|---|
| `status` | string | `"Approved"`, `"Declined"`, `"In Review"`, `"Not Finished"` |
| `method` | string | `"ACTIVE_3D"`, `"FLASHING"`, or `"PASSIVE"` |
| `score` | float | 0-100 liveness confidence score |
| `age_estimation` | float | Estimated age in years (e.g. `24.3`). `null` if no face |
| `reference_image` | string | Temporary URL (expires 60 min) |
| `video_url` | string | Temporary URL for active liveness video. `null` for passive |
| `warnings` | array | `{risk, log_type, short_description, long_description}` |

### Accuracy by Age Range

| Age Range | MAE (years) | Confidence |
|---|---|---|
| Under 18 | 1.5 | High |
| 18-25 | 2.8 | High |
| 26-40 | 3.2 | High |
| 41-60 | 3.9 | Medium-High |
| 60+ | 4.5 | Medium |

---

## Warning Tags

### Auto-Decline

| Tag | Description |
|---|---|
| `NO_FACE_DETECTED` | No face found in image |
| `LIVENESS_FACE_ATTACK` | Spoofing attempt detected |
| `FACE_IN_BLOCKLIST` | Face matches a blocklist entry |

### Configurable (Decline / Review / Approve)

| Tag | Description |
|---|---|
| `AGE_BELOW_MINIMUM` | Estimated age below configured minimum |
| `AGE_NOT_DETECTED` | Unable to estimate age (image quality, lighting) |
| `LOW_LIVENESS_SCORE` | Liveness score below threshold |
| `POSSIBLE_DUPLICATED_FACE` | Significant similarity with previously verified face |

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

---

## Common Workflows

### Basic Age Gate
example.py
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())
example.ts
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,
});
example.json
{
  "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"
}
example.txt
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
example.txt
1. Configure workflow with age thresholds in Console
2. POST /v3/session/ → create session with age-estimation workflow
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

Tags

#image_and-video-generation #api

Quick Info

Category Content Creation
Model Claude 3.5
Complexity One-Click
Author rosasalberto
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install didit-age-estimation