#
Emotion & Attention API
#
Overview
The Emotion & Attention API provides AI-powered facial emotion detection and attention analysis for understanding user engagement and emotional states.
The Emotion & Attention API enables you to:
- Detect multiple emotions (happiness, confusion, surprise, contempt, disgust, empathy)
- Analyze attention levels and determine if eyes are on screen
- Extract detailed facial landmark positions in 2D and 3D space
- Detect face and person presence in images
#
Base URLs
#
API Endpoints
#
Detect Emotions and Attention
Returns whether a face was detected and, for the dominant face in the image, the detected emotions, attention state, and facial landmarks.
Endpoint: POST /v1/emotion-attention/detect
Authentication: API Key or Bearer Token
Request Body:
{
"image": {
"bytes": "base64-encoded-image-string",
"url": null
}
}
Request Parameters:
Response Example:
{
"emotionsAttention": {
"hasFace": true,
"presence": true,
"eyesOnScreen": true,
"attention": true,
"confusion": false,
"contempt": false,
"disgust": false,
"happy": true,
"empathy": false,
"surprise": false
},
"landmarks": {
"scale": 1.23,
"roll": -2.5,
"yaw": 5.3,
"pitch": -1.2,
"translate": {
"x": 320.5,
"y": 240.8
},
"landmarks2D": [
{ "x": 310.2, "y": 235.6 },
{ "x": 330.8, "y": 236.1 }
],
"landmarks3D": [
{ "x": 0.12, "y": -0.05, "z": 0.98 },
{ "x": 0.15, "y": -0.04, "z": 0.97 }
],
"isGood": true
}
}
Response Fields:
Example Request:
curl -X POST "https://emotion-attention-api-eu.realeyes.ai/v1/emotion-attention/detect" \
-H "Authorization: ApiKey API-KEY-FROM-DEV-CONSOLE" \
-H "Content-Type: application/json" \
-d '{
"image": {
"bytes": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
}'
Response Codes:
200- Success400- Bad Request - Invalid image format, missing required fields, or invalid parameters401- Unauthorized - Missing or invalid authentication
#
Health Check
Check the API health status.
Endpoint: GET /v1/healthz
Authentication: None required
Response Example:
2026-02-16T13:45:30.1234567Z
Response Fields:
Example Request:
curl -X GET "https://emotion-attention-api-eu.realeyes.ai/v1/healthz"
Response Codes:
200- API is healthy
#
Common Response Codes
#
Swagger Documentation
Interactive API documentation is available via Swagger UI:
- EU: https://emotion-attention-api-eu.realeyes.ai/swagger
- US: https://emotion-attention-api-us.realeyes.ai/swagger
Last updated: 2026-02-16