Age estimation v1

This documentation is for our legacy Age Estimation API. For new integrations, we recommend you follow these docs.

Once you've set up your organisation account on the Yoti Hub, you’re ready to start integrating.

Help Please contact us though our support form for any advice on integrating this product.

Image requirements

The image requirements to use our services are:

ConditionAge estimation
QuantityOnly one single face in the image.
Image typeYoti only accepts JPEG’s encoded as a base64 image
Image resolutionThe minimum face dimensions we accept is 96 x 96 pixels
ColourThe image must be colour (RGB). Yoti does not accept black and white or filtered images.
SizeBase64 body must be below 100KB (~70KB JPEG)

There’s a tradeoff between estimation accuracy and camera quality / light conditions, false-negative errors such as face not detected or spoofing attempt detected may be higher than expected due to one or more of the following factors:

ConditionDescription
LightingProvide UX and guidance to the user. Jump to User experience for more information.
Face positioningGuide the users to place their face in the middle of the photo you are capturing. A near frontal pose with no obstruction to the facial features. The minimum inter ocular distance is 120 pixels.
Camera anglePlease try to get a face-on photo of the user to get the best result. The camera’s field of view is too small to provide suitable context around the facial image captured.
Camera typeThe API does not work on infrared cameras. To ensure the best performance we are happy to support your testing when evaluating camera options.
Image croppingFurther image cropping can also reduce the context around the facial image captured. This can negatively impact the ability of the algorithm to compare to other ‘normal’ images in its learned model.
Glare / BlurInsufficient anti-glare capabilities of either the lens or the glass will make it harder for the anti-spoofing to accurately detect edges around faces. This can negatively impact the ability of the algorithm to compare to other ‘normal’ images in its learned model.
ZoomOptical zoom effects can reduce the context around the facial image captured. This can negatively impact the ability of the algorithm to compare to other ‘normal’ images in its learned model. A distorted lens structure, such as a ‘fish-eye’ lens which is not how the AI model has been trained.
Image compressionToo much image compression is applied to the captured image which creates ‘artefacts’ and inaccuracies in the image (ideally no more than 90% compression). This can negatively impact the ability of the algorithm to compare to other ‘normal’ images in its learned model.

Create a request

After completing the Yoti onboarding, you will need to complete authentication for the API by using the Yoti SDK to simplify the process for requesting to Yoti. The Yoti SDKs are available via popular dependency management systems. Further details can be found on the pages of the specific projects.

Javascript
Java
PHP
Python
C#
Go
Ruby
Copy

Once you have added the Yoti SDK dependency to your project, you can use it to build and send your request. See the code snippets below for examples.

EndpointDescription
https://api.yoti.com/api/v1/age-verificationUse Age estimation only.
Javascript
Java
PHP
Python
C#
Go
Ruby
Copy

This JSON string will be the data parameter in the withPayload above code snippet.

JSON
Copy

If integrating into a non-browser client, we recommend contacting clientsupport@yoti.com for additional support.

Terminal integrations

Optionally, additional headers may be provided to the request to allow Yoti to track error responses coming from a particular machine. This would typically be used in a non-browser client scenario, such as an ePOS terminal where each individual machine must be registered by the business.

In order to do this, the following headers should be applied:

HeaderDescription
Terminal-IdUnique ID per machine. Mandatory for non-browser integrations.
Session-IdMay be provided to demonstrate multiple attempts are from a single user transaction.

Example responses

The response received from the API will be below:

The uncertainty value is a confidence score. Yoti recommends rejecting any response with an uncertainty greater than 6.0. Typically this indicates a problem with image capture. This should only be treated as a quality score.

JSON
Copy

Error codes

Error codeDescription
1Image too big
2Unable to decode image (not a jpeg or wrong base64 string)
4No face detected
6Image not present
7Generic bad request
8No image detected
9Internal server error
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard