YouAge API

Welcome to YouAge API, part of the Youverse Services suite.

The YouAge API provides facial age estimation — determining a person’s apparent age directly from a face image.

It enables automated age verification for digital onboarding, gaming, retail, and compliance workflows.

By leveraging advanced deep learning models trained on diverse demographic datasets, YouAge ensures reliable, unbiased, and accurate predictions across global populations.

The API operates via a single REST endpoint that accepts an image in Base64 format and returns an estimated age with an image validation status.


Use Cases

Digital Onboarding & KYC

Integrate YouAge into identity verification flows to estimate a user’s age before proceeding with full identity checks.

It streamlines onboarding by automatically filtering underage users and ensures compliance with KYC and AML regulations.

Gaming & Entertainment

YouAge helps enforce age restrictions in gaming and streaming services by automatically determining whether users meet minimum age requirements.
This supports COPPA, GDPR-K, and similar youth-protection laws worldwide.

E-commerce & Alcohol Delivery

E-commerce and delivery platforms can use YouAge to pre-screen users purchasing age-restricted goods (alcohol, tobacco, or adult products), reducing manual verification steps and ensuring compliance.

Parental Control Systems

Integrate YouAge in parental-control platforms to dynamically adjust content access based on real-time age estimation.

Public Terminals & Smart Kiosks

Smart vending or self-service kiosks can use YouAge to verify age eligibility instantly before granting access to restricted goods or services.


Endpoints

Age Estimation

Performs facial age estimation from a single Base64 image.

POST | {base_url}/age

Accepts: Process request

Success

Status Meaning Schema
200 OK Process response

Error responses

Status Meaning Schema
400 Bad Request Error response
401 Unauthorized Error response
403 Forbidden Error response
405 Method Not Allowed Error response
409 Conflict Error response
500 Internal Server Error Error response

Schemas

Process Request

Request processing of an image in base64 and the age configurations.

{
    "image": "string",
    "configuration": [configA, configB]
}

Properties

Name Type Required Description
image string True Base64-encoded image (BMP, PNG, or JPG).
configuration array False None Array of extensible configurations.

Process request config

Extensible configurations for biometric processing.

{
    "name": "string",
    "value": "string"
}

Enumerable types

Property Value Description
name "selection_criteria" If multiple faces present you are required to select a criteria to analyze tha single face.
value "CLOSEST_TO_CAMERA" Selects the face that appears physically closest to the camera (largest bounding box). Ideal for single-user interactions.
value "CLOSEST_TO_CENTER" Selects the face nearest to the center of the frame, reducing off-angle detections. Recommended for multi-face images where the target is centered.
value "HIGHEST_CONFIDENCE" Selects the face with the highest detection confidence, ensuring the best-quality facial data when multiple faces are present.

Process Response

Response returned after successful age estimation.

{
  "age": 31.04,
  "status": "VALID_IMAGE"
}

Properties

Property Type Description
age float Estimated apparent age in years.
status string Image quality and validation status.

Enumerable types

Property Value Description
status "VALID_IMAGE" Face successfully detected and image suitable for analysis.
status "SHARPNESS_ERROR" Image too blurred or lacking sufficient detail for reliable detection.
status "ILLUMINATION_ERROR" Lighting conditions inadequate (too dark, too bright, or uneven).
status "FACE_TOO_FAR" Detected face is too small or distant from the camera.
status "FACE_TOO_CLOSE" Face occupies too much of the frame and exceeds optimal bounds.
status "FACE_CLOSE_TO_BORDER" Face too close to image edge, risking partial crop or cutoff.
status "FACE_WITHOUT_PADDING" Face lacks sufficient background space around it for proper analysis.
status "FACE_CROPPED" Face is partially cut off or incomplete in the provided image.
status "FACE_OCCLUDED" Face partially covered (mask, hand, hair, or other obstruction).
status "FACE_ANGLE_TOO_LARGE" Head pose angle too extreme (yaw, pitch, or roll) for accurate analysis.
status "MULTIPLE_FACES" More than one face detected in the input image or frame.
status "INCONSISTENT_DETECTION" Detected face positions vary significantly across frames.
status "UNKNOWN" An unspecified or unexpected condition occurred during analysis.

Error Response

{
  "status_code": 400,
  "phrase": "string",
  "message": "string"
}

Integration Guidelines

The YouAge API should be integrated in a secure backend environment.

All requests must include an x-api-key, ensuring that sensitive biometric data and credentials remain protected.

Recommended Flow

primary Frontend Capture

Capture the user’s selfie using the official Youverse WebComponent or your own frontend implementation.

Send the Base64-encoded image securely to your backend.

primary Backend Processing

Your backend calls the YouAge API using the private x-api-key, receives the age estimation response, and forwards only the result to your frontend.

primary Decision Logic

Use the estimated age to control access (e.g., allow if over 18), or flag for further verification.


Samples

Python

import requests
import base64

base_url = "https://face-analysis.youverse.id/v1"
url = f"{base_url}/age"

# Encode image
with open("selfie.jpg", "rb") as f:
    image_b64 = base64.b64encode(f.read()).decode("utf-8")

headers = {
    "x-api-key": "YOUR_API_KEY"
}

payload = {
    "image": image_b64
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Node.js

import axios from "axios";
import fs from "fs";

const baseURL = "https://face-analysis.youverse.id/v1";
const url = `${baseURL}/age`;

// Read and encode image as base64
const imageBuffer = fs.readFileSync("selfie.jpg");
const imageBase64 = imageBuffer.toString("base64");

const payload = {
  image: imageBase64
};

axios.post(url, payload, {
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_API_KEY"
  }
})
  .then(response => console.log(response.data))
  .catch(error => console.error("Error:", error.response?.data || error.message));

OpenAPI Specification

The following OpenAPI 3.0 YAML defines the YouAge API endpoint and response schema.
You can import it directly into tools like Swagger UI, Postman, or Insomnia.

View OpenAPI YAML Specification ```yaml openapi: 3.0.3 info: title: YouAge API version: "1" description: > The YouAge API provides facial age estimation, returning an estimated age and image validation status from a single face image. servers: - url: Verify this value in your dashboard description: Production API server paths: /age: post: summary: Perform facial age estimation description: > Accepts a Base64-encoded image and returns the estimated age and image validation status. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProcessRequest' responses: "200": description: Successful age estimation content: application/json: schema: $ref: '#/components/schemas/ProcessResponse' "400": description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' "401": description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' "403": description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' "409": description: Conflict content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' "500": description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' security: - api_key: [] components: securitySchemes: api_key: type: apiKey in: header name: x-api-key schemas: ProcessRequest: type: object required: - image properties: image: type: string description: Base64-encoded face image (JPG, PNG, BMP) configuration: type: array items: $ref: '#/components/schemas/ProcessConfig' ProcessConfig: type: object properties: name: type: string example: selection_criteria value: type: string enum: [CLOSEST_TO_CAMERA, CLOSEST_TO_CENTER, HIGHEST_CONFIDENCE] description: | Defines how to select a face when multiple are detected: - **CLOSEST_TO_CAMERA**: Face closest to the camera (largest bounding box). - **CLOSEST_TO_CENTER**: Face nearest the image center (ideal for centered subjects). - **HIGHEST_CONFIDENCE**: Face with the highest detection confidence score. ProcessResponse: type: object properties: age: type: number format: float example: 31.04 status: type: string example: VALID_IMAGE description: Image quality and validation status. ErrorResponse: type: object required: - status_code - phrase - message properties: status_code: type: integer example: 400 phrase: type: string example: Bad Request message: type: string example: Invalid or missing Base64 image in request. ```

Contacts

Please check our GitHub space for integration SDKs.

We are working to expand our SDK offerings.
If you’d like to contribute or request new SDKs, please contact us.