Detect Face
Server-to-Server
Detect Face
Detect a face in an image and return bounding box and landmarks
POST
Detect Face
/v1/face/compare or /v1/face/estimate-age — for example, to give the user immediate feedback that their selfie is too dark or off-frame.
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
Response
200 — Success
| Field | Type | Description |
|---|---|---|
faceDetected | boolean | True when a face was detected |
confidence | number (0–1) | Detection confidence for the top face. 0 when no face was detected |
boundingBox | object | Normalized bounding-box coordinates (omitted when no face detected) |
landmarks | object[] | Facial landmark points (omitted when no face detected) |
boundingBox shape: { top, left, width, height }, each normalized to 0–1 against the source image dimensions.
landmarks[] shape: { type, x, y }, where type is the landmark name (e.g. eyeLeft, nose, mouthRight) and x/y are normalized to the image dimensions.
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 |
When no face is detected the endpoint still returns
200 OK with
faceDetected: false. Treat that as a UX-level failure (prompt the user
to retake) rather than an integration error. Only the highest-confidence
face is returned.