Face Comparison API

API Summary:

This service provides a comparison analysis of the features of the faces in the two uploaded images, and returns the similarity score. It can be used to determine whether the two faces are the same person.

Application scenarios:

Human face similarity comparison, face based user authentication by comparison of an input face with the existing face in database.



API end point : http://www.visualsearchapi.com:7080/wztimgsvr/faceapi/faceCompare

Image format requirement: JPG format, image width and length each for 300 – 1200 pix

Http method : POST

Request Parameters(body) :

Parameter Name Type Required Parameter Location Description Default Value
apikey string Yes header API Key None
imageid1 string Yes body Unique ID for uploading image file 1; Example 1001 None
imageid2 string Yes body Unique ID for uploading image file 2; Example 1000 None
imagetype string No body Upload image type
URL Upload by image URL;
FILE Upload with local image file
FILE (Upload with local image file)
fmt string No header Response format: json or xml json
imagefile1 file When the image type is FILE, this is required. body Image file
imagefile2 file When the image type is FILE, this is required. body Image file None


Detailed use of tutorials



API end point : http://www.visualsearchapi.com:7080/wztimgsvr/faceapi/faceCompare

Image format requirement: JPG format, image width and length each for 300 – 1200 pix

Http method : POST

Request Parameters(body) :

Parameter Name Type Required Parameter Location Description Default Value
apikey string Yes header API Key None
imagetype string No body Upload image type
URL Upload by image URL;
FILE Upload with local image file
FILE (Upload with local image file)
imgurl1 string When the image type is URL, this is required. body Image URL1 None
imgurl2 string When the image type is URL, this is required. body Image URL2 None


Download Java resources
Download Python resources
Download Php resources

Error Code Reference:


Error Codes Related to Access Control:
API_CODE_ERROR_exceeded_access_total Exceeded API access limit in total
API_CODE_ERROR_exceeded_access_frequency Exceeded API access frequency limit
API_CODE_ERROR_exceeded_access_frequency_min Exceeded API access limit per minute
API_CODE_ERROR_exceeded_access_frequency_hr Exceeded API access limit per hour
API_CODE_ERROR_exceeded_access_frequency_day Exceeded API access limit per day
API_CODE_ERROR_exceeded_access_frequency_month xceeded API access limit per month
API_CODE_ERROR_two_API_calls_time_too_close Two API calls are too close in time
IMAGE_INDEX_CODE_ERROR_IMAGE_EXCEED_MAX_DOCS_PER_UID Exceeded max number of images in index per user
API_CODE_ERROR_not_allow_write_index Pause in adding image to index (server might be in maintain service, please wait )

Error Codes Related to Wrong Parameters:
API_CODE_ERROR_invalid_apikey Invalid apikey
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_imgName Invalid image name
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_imgUrl Invalid image URL
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_catid_must_be_1_to_3000 Invalid image category (Must be 1-3000 Integer)
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_labels_must_be_positive_integer Invalid label(Must be positive integer)
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_FIELDS_any_field_must_not_have_double_quote Invalid image data, must not have double quote
IMAGE_INDEX_ITEM_CODE_ERROR_INVALID_LANG Invalid language parameter(must be zh for Chinese or en for English)
IMAGE_INDEX_CODE_ERROR_DOWNLOAD_IMAGE Error in downloading image, please check provided image URL
IMAGE_INDEX_CODE_ERROR_IMAGE_SIZE_TOO_BIG Image size is too big(image must be 400 – 800PIX JPG format)
IMAGE_INDEX_DELETE_IMG_CODE_ERROR_NOT_FOUND_ITEM Error in deleting, image not found