FaceAPI Developer

POST Face Verification

API Endpoint

https://api.datawow.io/api/v1/face_recognitions/verifications
MethodDescription
POSTGet 2 photo URLs then return a similarity score, and check if the faces in the photos are the same.

Example in various programming languages

You can copy the sample code here, and test it on your client.
https://documenter.getpostman.com/view/7277799/SWTK4Zqy?version=latest

Postman collection, you can import the sample code and test it with Postman:
https://www.postman.com/collections/d6169f995627970517f0

Request

All requests must be authenticated for access to API. Authentication is done via HTTP headers.

ParameterTypeValueDescription
AuthorizationheaderProject authorization token
image_url1formDataURL StringA photo’s URL which contains exactly one face
image_url2formDataURL StringA photo’s URL which contains exactly one face
custom_idformDataStringoptional custom_id

Example request


curl --location --request POST 'https://api-staging.datawow.io/api/v1/face_recognitions/verifications' \
  --header 'Authorization: YOUR_API_KEY' \
  --form 'image_url1=https://datawow-shared.s3-ap-southeast-1.amazonaws.com/api-documentation/face1.jpeg' \
  --form 'image_url2=https://datawow-shared.s3-ap-southeast-1.amazonaws.com/api-documentation/face2.jpeg' \
  --form 'custom_id=SAMPLE_CUSTOM_ID'
                

Response

Successful response will return a JSON file.

KeyTypeMetric (FAR)Description
similarityfloat-Similarity score of both faces. The higher score means they both are similar
match_level_1boolean0.1%Return whether the faces match each other.

Correctly authorize 999 out of 1,000 faces
match_level_2boolean0.01%Return whether the faces match each other.

Correctly authorize 9,999 out of 10,000 faces
match_level_3boolean0.001%Return whether the faces match each other.

Correctly authorize 99,999 out of 100,000 faces
match_level_4boolean0.0001%Return whether the faces match each other.

Correctly authorize 999,999 out of 1,000,000 faces

Example response


{
  "data": {
    "id": "5e42471df721f5270958a182",
    "type": "face_verification",
    "attributes": {
      "custom_id": "SAMPLE_CUSTOM_ID",
      "image_url1": "https://datawow-shared.s3-ap-southeast-1.amazonaws.com/api-documentation/face1.jpeg",
      "image_url2": "https://datawow-shared.s3-ap-southeast-1.amazonaws.com/api-documentation/face2.jpeg",
      "processed_at": "2020-02-11T06:18:04.512+07:00",
      "result": {
        "similarity": 0.04118707403540611,
        "match_level_1": false,
        "match_level_2": false,
        "match_level_3": false,
        "match_level_4": false
      },
      "id": "5e42471df721f5270958a182",
      "project_id": 1
    }
  },
  "meta": {
    "code": 201,
    "message": "Created"
  }
}
                

Response errors

Status CodeMessageDescription
400Cannot download image from URL: XXXOne of the image URLs cannot be downloaded. Please make sure the image exists and has public access.
400The browser (or proxy) sent a request that this server could not understand.The request is in a wrong format.
400image_url1 is missing, image_url2 is missingMissing required fields in the requests.
400Detected multiple faces in the image. Please upload a new image that has exactly one face to compare.Each image should contain exactly one face.
400Detected no face in the image. Please upload a new image that has exactly one face to compare.Each image should contain exactly one face.
401UnauthorizedAuthorization header is missing, incorrect, expired, or disabled.
500Internal Server ErrorSomething went wrong on Data Wow’s application server. The incident will be logged and reported to our team.
504Gateway TimeoutThe request has been in queue for processing longer than a time limit (60 seconds) Thus, returned with the Gateway Timeout error.