Skip to main content

Face Search (1:N)

In FACIA, the Face Search 1:N service plays a pivotal role by employing a robust facial search algorithm. This algorithm adeptly identifies similarities between a Selfie (Photo) and our comprehensive Image Database. Operating on a versatile 1:N matching approach, it allows users to seamlessly compare against multiple images in the database.

Create Face Search Transaction

This endpoint initiates a transaction request for the face search algorithm and returns a reference_id if the request includes proper authentication and valid fields, as mentioned below in the request parameters, using the POST method.

Endpoint

POSThttps://app.facia.ai/backend/api/transaction/create-transaction

Authorization:

Token Type: Bearer
Description:

This API utilizes Access token or Client-Secret key in header for authentication.

You can use your client_id and client_secret key when using the "/get-access-token" endpoint to obtain a Bearer token for authorization while connecting to this API. For additional details on Authorization, click Here

Run in Postman

Request Body Samples:

//POST /backend/api/transaction/create-transaction  HTTP/1.1
//Host: https://app.facia.ai
//Content-Type: application/json
//Authorization: Bearer <access-token-here>

{
"type": "face_search",
"file": "file.jpg",
"client_reference":"QWERTY12345",
"allow_override":0,
"enroll_face":false
}

Request Parameter

ParametersDescription
type Required: Yes
Type: string
Example: type=face_search
Type must be face_search.
file Required: Yes
Type: file
Example: file=file
File must be of type .jpeg, .jpg or .png.
client_reference Required: No
Type: string
Minimum: 5 characters
Maximum: 255 characters
Example: client_reference="QWERTY12345"
Required if allow_override field set to 1.
allow_override Required: No
Type: boolean
Default value: 0
Accepted values: 0,1
The client reference is mandatory if the value of the override key is set as 1. The override key allow the system to replace the latest previous image with the new one against the specified reference number of the client’s reference.
enroll_face
Required: No
Type: boolean
Example: enroll_face=true
Default value: true
If you do not want the system to enroll the face then set the value of the key as false.

Response Sample


{
"status": true,
"message": "Transaction Created",
"result": {
"data": {
"reference_id": "W4437KIWN0KDM13"
}
}
}


Response Parameter

ParametersDescription
reference_id Type: string
Example: reference_id=W4437KIWN0KDM13
The unique identifier associated with the created transaction.
message Type: string
Example: message=Transaction Created

Face Search Result

This endpoint accepts a single field in the body request payload: reference_id. Once the backend finalizes the response, this endpoint returns a face_search_response object with multiple object ids of images that share the most similar features with the provided image. Failure to provide a valid reference_id will result in a 422 status code.

Endpoint

POSThttps://app.facia.ai/backend/api/transaction/face-search-result

Authorization:

Token Type: Bearer
Description:

This API utilizes Access token or Client-Secret key in header for authentication.

You can use your client_id and client_secret key when using the "/get-access-token" endpoint to obtain a Bearer token for authorization while connecting to this API. For additional details on Authorization, click Here

Run in Postman

Request Body Samples:

//POST /backend/api/transaction/face-search-result HTTP/1.1
//Host: app.facia.ai
//Content-Type: application/json
//Authorization: Bearer <access-token-here>

{
"reference_id": "W4437KIWN0KDM13"
}

Request Parameter

ParametersDescription
reference_id Required: Yes
Type: string
Example: reference_id=W4437KIWN0KDM13
The unique identifier associated with the created transaction.

Response Sample


{
"status": true,
"message": "Success",
"result": {
"data": {
"facia_reference_id": "your_transaction's reference",
"client_reference": "clients_reference",
"face_search_response": {
"result": {
"matched_faces": [
[
"65ae1ee3bb742faa2c0507we",
0.98,
"https://app.facia.ai/backend/api/get-proof/ZFV0dDVOTmpPV01mSGs5QThxZGNqdGhtbWhidmRiaG46NjVhZTFlZTNiYjc0MmZhYTJjMDUwN2Ki",
"qwerty2345fghj65fgfgh456"
],
[
"65ae0ddc7adc1de48801b3ab",
0.98,
"https://app.facia.ai/backend/api/get-proof/TzVodnB3SnVvd3NGZ0xjU3E4MVVqdTd3S25kNnBlRjU6NjVhZTBkZGM3YWRjMWRlNDg4MDFiMzPi",
"qwerty2345fghj65fgfgh456"
]
],
"is_face_found": true
}
}
}
}
}


Response Parameter

ParametersDescription
facia_reference_id Type: string
Example: facia_reference_id=QUSHZL1GQTQ8BZH
This key includes the reference number of the request.
client_reference Type: string
Example: client_reference=QWERTY123456789
This is the client's provided reference ID associated with the transaction creation.
face_search_response Type: object
It contains the response generated by the system.
matched_faces Type: Array
This parameter returns the matched face images.
matched_faces[0][0] Type: string
ID of the uploaded proof against which the transaction was conducted.
matched_faces[0][1] Type: string
It represents the confidence score, indicating the degree of similarity between both objects.
matched_faces[0][2] Type: string
URL of the uploaded proof against which the transaction was conducted. It has expiry of 15 minutes.
matched_faces[0][3] Type: string
This is the client's request reference.
is_face_found Type: boolean
Indicates whether faces were found against the provided proof or not.