Estimate Age
curl --request POST \
--url https://api.deepidv.com/v1/face/estimate-ageimport requests
url = "https://api.deepidv.com/v1/face/estimate-age"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/face/estimate-age', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/face/estimate-age",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/face/estimate-age"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/face/estimate-age")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/face/estimate-age")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"faceDetected": true,
"estimatedAge": 34,
"ageRange": { "low": 28, "high": 40 },
"gender": "female",
"genderConfidence": 0.97
}
{
"faceDetected": false
}
Server-to-Server
Estimate Age
Estimate the age range and gender from a single face image
POST
/
v1
/
face
/
estimate-age
Estimate Age
curl --request POST \
--url https://api.deepidv.com/v1/face/estimate-ageimport requests
url = "https://api.deepidv.com/v1/face/estimate-age"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/face/estimate-age', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/face/estimate-age",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/face/estimate-age"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/face/estimate-age")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/face/estimate-age")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"faceDetected": true,
"estimatedAge": 34,
"ageRange": { "low": 28, "high": 40 },
"gender": "female",
"genderConfidence": 0.97
}
{
"faceDetected": false
}
POST /v1/face/estimate-age
Request
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Content-Type | Yes | multipart/form-data or application/json |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | binary | string | Yes | The image. For multipart, the file part. For JSON, a base64, base64url, or S3-key string. |
Example request
curl -X POST https://api.deepidv.com/v1/face/estimate-age \
-H "x-api-key: YOUR_API_KEY" \
-F "image=@selfie.jpg"
curl -X POST https://api.deepidv.com/v1/face/estimate-age \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "image": "uploads/selfie-abc123.jpg" }'
import fs from "node:fs";
const form = new FormData();
form.append("image", new Blob([fs.readFileSync("selfie.jpg")]), "selfie.jpg");
const response = await fetch("https://api.deepidv.com/v1/face/estimate-age", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: form,
});
const data = await response.json();
import requests
with open("selfie.jpg", "rb") as f:
response = requests.post(
"https://api.deepidv.com/v1/face/estimate-age",
headers={"x-api-key": "YOUR_API_KEY"},
files={"image": f},
)
Response
200 — Success
| Field | Type | Description |
|---|---|---|
faceDetected | boolean | True when a face was detected |
estimatedAge | integer | Single age estimate (midpoint of the range). Omitted if no face |
ageRange | object | { low, high } integer age band. Omitted if no face |
gender | string | male or female. Omitted if no face |
genderConfidence | number (0–1) | Confidence of the gender classification. Omitted if no face |
Error responses
| Status | Description |
|---|---|
400 | Invalid body, unsupported image format, or image larger than 15 MB |
401 | Missing or invalid x-api-key |
402 | Insufficient token balance |
403 | The supplied image S3 key is not readable by this organization |
429 | Rate limit exceeded |
500 | Unexpected server error — safe to retry with backoff |
{
"faceDetected": true,
"estimatedAge": 34,
"ageRange": { "low": 28, "high": 40 },
"gender": "female",
"genderConfidence": 0.97
}
{
"faceDetected": false
}
Interpreting the range
The returned range is broad by design — Rekognition estimates an age band, not a single value. A common pattern is:- If
ageRange.low >= your_minimum_age, accept immediately. - If
ageRange.high < your_minimum_age, reject immediately. - Otherwise the user falls in the ambiguous band — fall back to a full ID-based verification via
/v1/document/scanor/v1/identity/verify.
Age estimation is probabilistic and should not be used as a sole signal for
regulated age checks (alcohol, tobacco, gambling). Combine it with an ID
scan when compliance matters.