Skip to main content

👥 Face Passive Liveness Detection (Face Spoofing Check)

👤 ระบบตรวจจับใบหน้าปลอม Face Anti-Spoofing Detection [iBeta Level 1 Certified]

Version Status Certification Production Production Legacy Legacy Legacy Legacy Legacy

Welcome to Face Passive Liveness Detection API, an AI product developed by iApp Technology Co., Ltd. Our API is designed to detect whether an input face image is genuine or fake, ensuring the authenticity of facial recognition processes. The API is certified by iBeta Level 1 and supports various techniques to identify face spoofing attempts.

Try Demo!

Example Images (Click to try)

Example 1

Getting Started

  1. Prerequisites

    • An API key from iApp Technology
    • Image files containing faces
    • Supported formats: JPEG, JPG, PNG
    • Maximum file size: 10MB
  2. Quick Start

    • Fast processing time
    • High accuracy face spoofing detection
    • Support for multiple file formats
    • iBeta Level 1 certified accuracy
  3. Key Features

    • Face spoofing detection using various techniques
    • Printed photos detection
    • Realistic face mask for impersonation detection
    • Detection of taken face photo from computer screen
    • Video replays detection
    • Detailed prediction scores and normalization
    • Darkness level measurement
    • Processing duration tracking
  4. Security & Compliance

    • GDPR and PDPA compliant
    • No data retention after processing
    • iBeta Level 1 certified security
How to get API Key?

Please visit API Key Management page to view your existing API key or request a new one.

Example

Face Passive Liveness Detection Request:

Image Preview

Face Detection Example

  curl --location 'https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness' \
--header 'apikey: {YOUR API KEY}' \
--form 'file=@"{YOUR UPLOADED FILE}"'

Face Passive Liveness Detection Response:

{
"filename": "S__5333002.jpg",
"predict": "SPOOF",
"score": 0.9999989633974822,
"darkness": 0.51,
"data": {
"SPOOF": 0.9999990463256836,
"REAL": 9.35794162160164e-7
},
"normalized": {
"SPOOF": 0.9999989633974822,
"REAL": 1.0366025178232263e-6
},
"status_code": 200,
"duration": 0.35393,
"message": "SUCCESS"
}

Features & Capabilities

Core Features

  • Detects various face spoofing methods such as printed photos, realistic masks, computer screen images, and video replays.
  • Utilizes advanced deep learning techniques to ensure high accuracy and reliability.
  • Achieves over 99.43% accuracy across 7,680 tests.
  • Certified at iBeta Level 1 for secure and trusted face recognition systems.
  • Seamlessly integrates via RESTful API for easy deployment in applications.

Supported Fields

  • Detection of face spoofing attempts (printed photos, masks, screen images, video replays).
  • Detection confidence score for genuine vs. fake face.
  • Compatibility with popular image formats such as PNG, JPG, JPEG, HEIC, and HEIF.

API Endpoints

EndpointMethodDescriptionCost
POST /v3/store/ekyc/face-passive-liveness
Legacy: /anti_face_spoofing, /api/v2/fas, /face-spoofing, /passive-face-liveness-detection
POSTFace Liveness detection - detects spoofing attempts0.3 IC per request
POST /v3/store/ekyc/face-passive-liveness/v1p10
Legacy: /v1p10/facial_anti_spoofing
POSTFace Liveness detection (v1p10)0.3 IC per request

API Reference

Face Passive Liveness Endpoints

1. Face Passive Liveness Detection (Base)

POST /v3/store/ekyc/face-passive-liveness

Detects whether a face image is genuine or a spoofing attempt. Supports detection of printed photos, realistic masks, screen captures, and video replays. iBeta Level 1 certified.


2. Face Passive Liveness Detection (v1p10)

POST /v3/store/ekyc/face-passive-liveness/v1p10

Alternative version of face passive liveness detection with enhanced algorithms for specific use cases.


Request & Response Format

Headers

NameTypeDescription
apikeyStringYour API Key to call this API

Request Body

NameTypeDescription
fileFileThe binary data of the image

Response

{
"filename": "Image.jpeg",
"predict": "SPOOF",
"score": 0.9999590674225165,
"darkness": 0.29,
"data": {
"SPOOF": 0.9999197721481323,
"REAL": 8.024471753742546e-5
},
"normalized": {
"SPOOF": 0.9999590674225165,
"REAL": 4.093257748349899e-5
},
"status_code": 200,
"duration": 0.38198,
"message": "SUCCESS"
}

Parameter in Response

NameTypeDescription
filenameStringFile name
predictStringPrediction result, either REAL or SPOOF, based on the normalized score
scoreFloatPrediction score after normalization
darknessFloatDarkness level as a percentage
dataDictionaryPrediction scores for both REAL and SPOOF categories before normalization
normalizedDictionaryPrediction scores for both REAL and SPOOF categories after normalization
status_codeIntegerStatus code indicating success or error in processing
durationFloatProcessing time duration
messageStringResult or error message from processing

Code Examples

Curl

curl -X POST https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness \
-H "apikey: YOUR_API_KEY" \
-F "file=@/path/to/file.jpg"

Python

import requests

def detect_face_spoofing(image_path, api_key):
url = "https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness"
headers = {'apikey': {YOUR API KEY}}
files = {'file': open(image_path, 'rb')}
response = requests.post(url, headers=headers, files=files)
return response.json()

JavaScript

const axios = require('axios');

async function detectFaceSpoofing(imagePath, apiKey) {
const url = "https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness";
const headers = { 'apikey': {YOUR API KEY} };
const formData = new FormData();
formData.append('file', fs.createReadStream(imagePath));

try {
const response = await axios.post(url, formData, { headers });
return response.data;
} catch (error) {
console.error('Error:', error);
}
}

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('{YOUR UPLOADED FILE}')),
CURLOPT_HTTPHEADER => array(
'apikey: {YOUR API KEY}'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Swift

let parameters = [
[
"key": "file",
"src": "{YOUR UPLOADED FILE}",
"type": "file"
]] as [[String: Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = Data()
var error: Error? = nil
for param in parameters {
if param["disabled"] != nil { continue }
let paramName = param["key"]!
body += Data("--\(boundary)\r\n".utf8)
body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8)
if param["contentType"] != nil {
body += Data("\r\nContent-Type: \(param["contentType"] as! String)".utf8)
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += Data("\r\n\r\n\(paramValue)\r\n".utf8)
} else {
let paramSrc = param["src"] as! String
let fileURL = URL(fileURLWithPath: paramSrc)
if let fileContent = try? Data(contentsOf: fileURL) {
body += Data("; filename=\"\(paramSrc)\"\r\n".utf8)
body += Data("Content-Type: \"content-type header\"\r\n".utf8)
body += Data("\r\n".utf8)
body += fileContent
body += Data("\r\n".utf8)
}
}
}
body += Data("--\(boundary)--\r\n".utf8);
let postData = body


var request = URLRequest(url: URL(string: "https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness")!,timeoutInterval: Double.infinity)
request.addValue("{YOUR API KEY}", forHTTPHeaderField: "apikey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}

task.resume()

Kotlin

val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE}",
File("{YOUR UPLOADED FILE}").asRequestBody("application/octet-stream".toMediaType()))
.build()
val request = Request.Builder()
.url("https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness")
.post(body)
.addHeader("apikey", "{YOUR API KEY}")
.build()
val response = client.newCall(request).execute()

Java

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE}",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("{YOUR UPLOADED FILE}")))
.build();
Request request = new Request.Builder()
.url("https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness")
.method("POST", body)
.addHeader("apikey", "{YOUR API KEY}")
.build();
Response response = client.newCall(request).execute();

Dart

var headers = {
'apikey': '{YOUR API KEY}'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.iapp.co.th/v3/store/ekyc/face-passive-liveness'));
request.files.add(await http.MultipartFile.fromPath('file', '{YOUR UPLOADED FILE}'));
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}

Accuracy and Performances

  • Achieves over 99.43% accuracy across 7,680 tests.
  • Certified at iBeta Level 1 for secure and trusted face recognition systems.

iBeta Certificate [iBeta Level 1]

This system is certified by iBeta Level 1 and is capable of detecting face spoofing attempts through various techniques, including printed photos, realistic face masks for impersonation, photos captured from computer screens, and video replays.

View iBeta Certificate Here

Pricing

OperationProduction PathLegacy PathIC CostUnitOn-Premise
Face Passive Liveness Detection/v3/store/ekyc/face-passive-liveness/anti_face_spoofing0.3 ICper 1 requestContact us
Face Passive Liveness Detection (v1p10)/v3/store/ekyc/face-passive-liveness/v1p10/v1p10/facial_anti_spoofing0.3 ICper 1 request