We’ve designed an absolutely developers-friendly face recognition API to detect and authenticate humans, running without AI's hallucinations.
Higher accuracy, GDPR compliance, security needs, hardware/network constraints - with all these Lystface API self-hosted or on-premises solutions, matching the pace where industries are moving.
And, passing the benefits to the consumer of every business vertical from start-ups to enterprises to mega brands, which are:
- Robust control on fulfilling security norms - Keep critical data in-house while managing two-factor authentication, following HTTPS encryption and adhering to GDPR and ISO 27001 standards for data privacy and security.
- Speed up face recognition enabled products - Running uptime matters and this API reduces average latency time to less than 500ms for single image processing, enabling authentication on your preferred devices.
- Grow in new markets with confidence - This scalable architecture can match accuracy as high as 98% and enforce rate limits to all API endpoints, preventing abuse and strengthening confident decisions.
Now, this is a win-win - right? So, if you want to say "Yes" more to this Lystface API, know how to initiate the perfect setup.
How to Integrate the Lystface API to Recognize Faces?
Face match, compare, and verify are the key ingredients in Lystface API to bypass bottlenecks of aging, gender, or masking biases. And, to make them work, you need to follow the steps given:
The steps to initiate the first API call for developers
Step 1: Register as a developer
- If you’re an existing Lystface API user, you can directly login to your dashboard.
- If you’re not, you can sign up for an account while preferring a pricing segment that suits your requirements to get successfully registered and log in to the developer dashboard.
Step 2: Obtain your API credentials
- Once you’ve registered and passed two-factor authentication with confirming your email, create a new project to receive your API ID and API Key. Don’t forget to make a note of these and keep it securely, as it needs for further authentication.
Step 3: Make your first API call
- Now, to make a test request to the API, you need to use an HTTP client (Postman or a code snippet) in your preferred programming language such as PHP, Python, cURL, Ruby, Java, JavaScript, NodeJS, etc.
Here’s an example for you (in Postman):
- Set the request type to POST.
- Use the provided endpoint and include the API ID and key in the headers or request body as per the documentation.
- Upload an image for verification or recognition.
Some coding examples to process the API request
From enrolling images to comparing images and verifying faces to removing them when they are no longer in utilization, there are many processes and different code based examples are available for them. So, before dive into the discussion, open your Terminal (Mac) or Command Prompt (Windows) to type:
- “app_id (text)”: The ID of the application.
- “app_key (text)”: The key of the application.
- “Image (file)”: The image of the subject for verification.
- “gallery_name (text)”: The name of the gallery.
- “subject_id (text)”: The ID of the subject.
Note: At the time of face enrollment, you can use only 5 images per “subject_id”.
Use cURL
Now, let’s talk about the most simple method to retrieve JSON response upon successful verification by using cURL while getting the URL of a hosted image in “https://api.lystface.com/verify”:
json
{
"showMessage": true,
"responseCode": 0,
"responseStatus": "",
"responseMessage": "",
"response": ""
}
Here the response includes details like,
- showMessage (boolean): Indicates whether a message should be displayed.
- responseCode (integer): The code indicating the status of the response.
- responseStatus (string): The status of the response.
- responseMessage (string): Any message associated with the response.
- response (object): The detailed response data.
From this response, you’ll get the actual information about if the images belong to the same person or not while finding attributes of the faces. Well, let’s get into different API request examples to make your first API call and retrieve the same aforementioned JSON response.
Use JavaScript
var form = new FormData();
form.append("app_id", "•••••••");
form.append("app_key", "•••••••");
form.append("image", fileInput.files[0], "file");
form.append("gallery_name", "cricketers");
form.append("subject_id", "dhoni");
var settings = {
"url": "https://api.lystface.com/verify",
"method": "POST",
"timeout": 0,
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Use Node.js
var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.lystface.com/verify',
'headers': {
},
formData: {
'app_id': '•••••••',
'app_key': '•••••••',
'image': {
'value': fs.createReadStream('/path/to/file'),
'options': {
'filename': 'filename'
'contentType': null
}
},
'gallery_name': 'cricketers',
'subject_id': 'dhoni'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Use Python
import requests
url = "https://api.lystface.com/verify"
payload={'app_id': '•••••••',
'app_key': '•••••••',
'gallery_name': 'cricketers',
'subject_id': 'dhoni'}
files=[
('image',('file',open('/path/to/file','rb'),'application/octet-stream'))
]
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
equest)
puts response.read_body
Use Ruby
require "uri"
require "net/http"
url = URI("https://api.lystface.com/verify")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
form_data = [['app_id', '•••••••'],['app_key', '•••••••'],['image', File.open('/path/to/file')],['gallery_name', 'cricketers'],['subject_id', 'dhoni']]
request.set_form form_data, 'multipart/form-data'
response = https.request(r
Lystface API is the One of the Best Ways to Face Recognition that You Want
Now, you’ve got a handful of programming languages to make yourself comfortable in running API calls. But if you prefer other coding programs rather than the mentioned ones, you can check our API reference documentation.
Remember, now, with face recognition we all are at a tipping point to adopt scalability. Though here we didn’t mention the myriad use cases, we know you’re well aware of its potential benefits.
And, with Lysface, we’re here for you to ensure the ethical utilization of face recognition. So why not use it?