Quick Start
We suggest you read through the step by step integration guide to understand the integration in detail. Please see below for example code snippets, examples projects and a demo.
Please ensure you have a verified organisation and generate Age estimation keys.
Face capture example
Example code
Age Estimation v2
This is our current API with the latest features. If starting a new integration, please use this API.
To use it, first you need to install the SDK:
npm install -S -E yoti
There are three endpoints which can be used with this API:
Endpoint | Description |
---|---|
https://api.yoti.com/ai/v1/age | Use Yoti's age estimation service. |
https://api.yoti.com/ai/v1/age-antispoofing | Use Yoti's age estimation service and the Anti-spoofing check. |
https://api.yoti.com/ai/v1/antispoofing | Use Yoti's anti-spoofing check as a standalone product. |
const PATHS = {
AGE: '/age',
LIVENESS: '/antispoofing',
AGE_LIVENESS: '/age-antispoofing',
};
const data = {
img: 'base64img',
};
const request = new RequestBuilder()
.withBaseUrl('https://api.yoti.com/ai/v1')
.withPemFilePath('<YOTI_KEY_FILE_PATH>')
.withEndpoint(PATHS.AGE_LIVENESS) // optionally PATHS.AGE or PATHS.LIVENESS
.withPayload(new Payload(data))
.withMethod('POST')
.withHeader('X-Yoti-Auth-Id', '<YOTI_CLIENT_SDK_ID>')
.build();
Age Estimation v1 (legacy)
This is our older API, that is relevant for legacy integrations.
First you need to install the SDK:
npm install -S -E yoti
There is one endpoint which can be used with this API:
Endpoint | Description |
---|---|
https://api.yoti.com/api/v1/age-verification | Use Age estimation only with a lower quality image. |
const { RequestBuilder, Payload } = require('yoti');
const request = new RequestBuilder()
.withBaseUrl('https://api.yoti.com/api/v1/age-verification')
.withPemFilePath('<YOTI_KEY_FILE_PATH>')
.withEndpoint('/checks')
.withPayload(new Payload(data))
.withMethod('POST')
.withHeader('X-Yoti-Auth-Id', '<YOTI_CLIENT_SDK_ID>')
.build();
//get Yoti response
const response = request.execute();
If you wanna just dive in to hacking this together, click below to see the examples.
Demos
We've created a suite of live demos in Yoti World to show you how Yoti can best serve your business with an age estimation integration: