apyhub
ARTIFICIAL INTELLIGENCE · IMAGE PROCESSING

Detect Age and Gender API

What it does

Age and Gender Detection analyzes an uploaded image and returns a face-by-face breakdown of estimated age range and gender. Send one binary image file in the request body and get back a structured result for each detected face, plus the total face count.

Each item in results includes the predicted age label, gender, age_score, gender_score, a face_index, and an optional bounding box in bbox with x, y, w, and h. That makes it easy to map predictions back to the exact face in the source image.

Use it when you need to add demographic signals to image workflows, such as sorting user-uploaded photos, analyzing event images, or tagging faces in moderation and analytics pipelines. Because the output is already structured, you can feed it directly into downstream logic without extra parsing.

Age and Gender Detection is designed for simple image-based face analysis: upload an image up to 20 MB, process the detected faces, and consume the predictions in your application.

POST
Detect faces and return age range and gender for each detected face
http://localhost:8080/dosvak/detect-age-gender
QUICKSTARTGUIDE

Quickstart

Upload one image to detect faces and estimate age and gender.

curl -X POST "http://localhost:8080/dosvak/detect-age-gender" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with results and face_count fields. results is an array of detected faces; each item may include age, bbox, gender, age_score, face_index, and gender_score. face_count is the number of faces found.

{
  "results": [
    {
      "age": "25-32",
      "bbox": {
        "h": 180,
        "w": 140,
        "x": 320,
        "y": 120
      },
      "gender": "female",
      "age_score": 0.98,
      "face_index": 0,
      "gender_score": 0.99
    }
  ],
  "face_count": 1
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Image file (max 20 MB)

About this endpoint

What it does

Detects faces in an uploaded image and returns age range and gender information for each detected face, along with a face count. The request sends a binary image file, and the response comes back as a JSON object containing detection results.

Request Body

ParameterTypeMandatoryDescription
fileStringYesImage file (max 20 MB), binary format.

Response

Returns a JSON object with results and face_count fields. results is an array of face-detection objects, and face_count is an integer.

ParameterTypeMandatoryDescription
resultsObject ArrayNoArray of detected face objects. Each object may include: age (string, age range label such as 25-32), bbox (object, nullable; contains h, w, x, y integers), gender (string ENUM: male, female), age_score (number), face_index (integer), and gender_score (number).
face_countIntegerNoNumber of faces detected.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.