Face Detect

Detects face and extracts attributes of it.

API call

To perform face detection and attributes extraction.

This API currently supports basic authentication. All endpoints require an Authentication header in the following form:

Authorization: 'Basic ' + Base64.encode(username + ':' + password)

Send a HTTP POST request to:

  • /api/v1/basic/face/detect

The following parameters are used for requests and responses:

ParameterDirectionDescription
sessionIdrequestunique, short-liveзрзd code to be generated by the client to track specific sessions
faceImageBaserequestonboarded person photo, Base64 format or URL link to it
returnFaceImagerequestboolean (true, false) to include/exclude detected face rectangle (Base64 format) in response
sessionIdresponseunique, short-lived code to be generated by the client to track specific sessions. Same as in request
hasErrorresponseboolean parameter - true - verification process ended up with some error; false - no errors
faceresponseincludes face attributes object
face\ageresponseAge (years)
face\genderresponseGender in -10000..10000 range, -10000 is for a Male, 10000 for a Female
face\rectangleresponseincludes left, right, top, bottom coordinates of detected face
faceImageBaseresponsecropped person photo, Base64 format
errorresponseerror message in case of hasError set to true, informing about type of error: INTERNAL_ERROR
Request:
{
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
  "faceImageBase": "data:image/png;base64,/9j/4AAQSkZ...AZ4",
  "returnFaceImage": true
}

Response - successfull call
{
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
  "hasError": false,
  "face": {
    "age": 29,
    "gender": -10000,
    "rectangle": {
      "top": 17,
      "left": 314,
      "width": 422,
      "height": 528
    },
  "faceImageBase": "/9j/4AAQSkZJRgA...RQI//9k="
  }
}

Response - error
{
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
  "hasError": true,
  "error": "INTERNAL_ERROR"
}

List of errors

ErrorMeaningDescription
INTERNAL_ERRORInternal errorsContact us