# Demographic Estimation API

# Overview

The Demographic Estimation API provides AI-powered age estimation and gender detection services for faces in images. This API enables applications to analyze demographic characteristics of individuals for age verification, audience analytics, and personalized user experiences.

Key Features:

  • Age Estimation: Predict the age of detected faces with uncertainty scores
  • Gender Detection: Identify the gender of detected faces
  • Multi-Face Support: Process multiple faces in a single image
  • High Accuracy: State-of-the-art AI models for demographic analysis
  • Regional Deployment: Available in multiple regions for low latency

# Base URLs

Region Base URL
EU https://demographic-estimation-api-eu.realeyes.ai/v1/
US https://demographic-estimation-api-us.realeyes.ai/v1/

# API Endpoints

# 1. Get Age Estimation

Estimates the age of faces detected in an image.

Endpoint: POST /v1/demographic-estimation/get-age

Request Body:

{
  "image": {
    "bytes": "base64-encoded-image-string",
    "url": null
  },
  "maxFaceCount": 1
}

Request Parameters:

  • image.bytes (string): Base64-encoded JPEG or PNG image
  • image.url (string, optional): URL of the image (alternative to bytes)
  • maxFaceCount (integer, default: 1): Maximum number of faces to process

Response:

{
  "faces": [
    {
      "face": {
        "confidence": 0.9987,
        "boundingBox": {
          "x": 120,
          "y": 80,
          "width": 200,
          "height": 250
        }
      },
      "age": {
        "prediction": 28.5,
        "uncertainty": 0.45
      }
    }
  ],
  "unprocessedFaceCount": 0
}

Response Fields:

  • faces: Array of detected faces with age estimations
    • face.confidence: Face detection confidence score [0.0, 1.0]
    • face.boundingBox: Face location (X, Y, Width, Height in pixels)
    • age.prediction: Estimated age in years
    • age.uncertainty: Uncertainty score [0.0, infinity] (recommend rejecting values > 1.0)
  • unprocessedFaceCount: Number of faces not processed due to maxFaceCount limit

cURL Example:

curl -X POST "https://demographic-estimation-api-eu.realeyes.ai/v1/demographic-estimation/get-age" \
  -H "Authorization: ApiKey YWJjMTIzOnh5ejc4OQ==" \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "bytes": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
    },
    "maxFaceCount": 5
  }'

# 2. Get Gender Detection

Detects the gender of faces in an image.

Endpoint: POST /v1/demographic-estimation/get-gender

Request Body:

{
  "image": {
    "bytes": "base64-encoded-image-string",
    "url": null
  },
  "maxFaceCount": 1
}

Request Parameters:

  • image.bytes (string): Base64-encoded JPEG or PNG image
  • image.url (string, optional): URL of the image (alternative to bytes)
  • maxFaceCount (integer, default: 1): Maximum number of faces to process

Response:

{
  "faces": [
    {
      "face": {
        "confidence": 0.9987,
        "boundingBox": {
          "x": 120,
          "y": 80,
          "width": 200,
          "height": 250
        }
      },
      "gender": "Male"
    }
  ],
  "unprocessedFaceCount": 0
}

Response Fields:

  • faces: Array of detected faces with gender detection results
    • face.confidence: Face detection confidence score [0.0, 1.0]
    • face.boundingBox: Face location (X, Y, Width, Height in pixels)
    • gender: Detected gender ("Male" or "Female")
  • unprocessedFaceCount: Number of faces not processed due to maxFaceCount limit

cURL Example:

curl -X POST "https://demographic-estimation-api-eu.realeyes.ai/v1/demographic-estimation/get-gender" \
  -H "Authorization: ApiKey YWJjMTIzOnh5ejc4OQ==" \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "bytes": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
    },
    "maxFaceCount": 5
  }'

# Common Response Codes

Status Code Description
200 Success
400 Bad Request - Invalid image format, missing required fields, or invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Valid authentication but insufficient permissions
500 Internal Server Error - Server-side error during processing

# Swagger Documentation

Interactive API documentation is available via Swagger UI:


Last updated: 2026-01-27