POST /BPImages/PassPic_API

Photo Analyzer API

Ever wondered when you ask to upload their photo for your online form, and the user uploads a scenery or a group photo? You needed a blue-backgound photo and the uploaded photo has a shopping mall in the background? Or the photo has no face at all or a very big face covering all the photo area? This API checks the image at the spot and rejects any photo that does not meet your criterea. You can also adjust your preferred defaults for rejecting such photos, or you can just send the image to get JSON response telling the detailed info about the photo, which you can analyze at your end to suit your criteria.

Submit visual assets to automatically parse, classify, and isolate metadata structures. This endpoint accepts multi-part form payloads containing an authenticated key context alongside raw photo data.


Request Parameters

Send parameters as multipart form data (`multipart/form-data`).

Parameter Type Required Description
key string Yes Your unique API access key credential.
photo file Yes The image file buffer to inspect (JPEG, PNG, WebP up to 10MB).

JSON Response Reference

There are mainly 3 parths of the response. First is the final output, that tells if all the set checks have been passed by the photo. The Second part also returns boolean for each criterea check. And the third part sends values, which tell the properties of the photo, which can further be analyzed at your end.

The schema payload returned when the operation resolves successfully.

Key Path Type Description
FINAL_APPROVAL Boolean Indicates the final success or failure state (e.g., "True").
APPROVAL_BLUE_BACKGOUND Boolean Indicates whether the check for blue back ground has been passed (e.g., "True").
APPROVAL_FACE_BLUR Boolean Indicates whether the check for face blur value has been passed (e.g., "True).
APPROVAL_FACE_SIZE Boolean Indicates whether the check for face size has been passed (e.g., "True").
APPROVAL_IMAGE_BYTE_SIZE Boolean Indicates whether the check for image byte size has been passed (e.g., "True"). The default maximum file byte size is 500KB
APPROVAL_IMAGE_ORIENTATION Boolean Indicates whether the check for image orientation has been passed (e.g., "True").
APPROVAL_NUMBER_OF_CHANNELS Boolean Indicates whether the check for number of channels has been passed (e.g., "True").
APPROVAL_NUMBER_OF_FACES Boolean Indicates whether the check for number of faces in the photo has been passed (e.g., "True").
GIVEN_IMAGE_FACE_AREA integer Indicates the area (px) of the human face covering the photo (e.g., "42025").
GIVEN_IMAGE_AREA integer Indicates the total area (px) of the photo (e.g., "199644").
GIVEN_IMAGE_FACE_BLUR_VALUE float Indicates the blur value of the photo (e.g., "372.9719730011822"). Default acceptable area is set to "50"
GIVEN_IMAGE_FACE_SIZE_PERCENTAGE float Indicates the percentage of face size in the photo (e.g., "21.049968944721602"). The default face size percentage is Minimum: 15 and Maximum: 60
GIVEN_IMAGE_FACE_HEIGHT int Indicates the height of face in the photo (e.g., "205").
GiVEN_IMAGE_HEIGHT int Indicates the height of the photo (e.g., "524").
GIVEN_IMAGE_ORIENTATION string Indicates the orientation of the provided photo (e.g., "Portrait").
GIVEN_IMAGE_CHANNELS int Indicates the number of channels of the provided photo (e.g., "3"), where 1 is Grayscale and 3 is Coloured. Default acceptable channels value is "3"
GIVEN_IMAGE_NUMBER_OF_FACES int Indicates the number of faces found in the provided photo (e.g., "1").
GIVEN_IMAGE_FACE_WIDTH int Indicates the width of face in the provided photo (e.g., "205").
GIVEN_IMAGE_WIDTH int Indicates the width of the provided photo (e.g., "381").

Try It Live

import requests

url = "https://apis.shopist.store/BPImages/PassPic_API"
payload = {"key": "your_api_key_here"}

# Using a context manager ('with') so the file closes automatically
with open("image.jpg", "rb") as image_file:
    files = {"image": image_file}
    response = requests.post(url, data=payload, files=files)

response.raise_for_status()  # Throws an error if the API returned 4xx or 5xx
print(response.json())