POST/api/v1/liveness/check

Real-Time Liveness Detection API

Protect your platform from spoofing attacks. Our multi-model liveness engine detects paper photos, screen replays, 3D masks, and deepfakes with sub-second response times.

POST /api/v1/liveness/check

REQUEST

200 OK
{
  "is_live": true,
  "confidence": 0.97,
  "spoof_type": null,
  "models": {
    "onnx": { "is_live": true, "score": 0.96 },
    "deepface": { "is_live": true, "score": 0.98 }
  },
  "processing_time_ms": 420
}

Key Features

Everything you need from a production-ready Liveness Detection API.

Multi-Model Fusion

Combines ONNX MiniFASNet and DeepFace models with majority voting for maximum accuracy.

Sub-Second Response

Optimised for real-time use cases — average response under 800ms on standard images.

Spoof Type Detection

Identifies whether a spoof is a photo, screen replay, or 3D mask.

Confidence Scoring

Every result includes a confidence score so you can tune your own acceptance threshold.

How it works

Integrate in minutes with our developer-friendly REST API.

01

Send a face image

POST a face image (JPG, PNG) to the liveness endpoint with your API key.

02

AI analysis

Two independent models analyse the image for texture, depth, and reflection cues.

03

Get a verdict

Receive a live/spoof verdict with a confidence score in under a second.

Data Output

Fields You Can Extract

All data returned as structured JSON — map directly to your database schema.

is_live
confidence
spoof_type
models.onnx
models.deepface
processing_time_ms
response.json
{
  "is_live": true,
  "confidence": 0.97,
  "spoof_type": null,
  "models": {
    "onnx": { "is_live": true, "score": 0.96 },
    "deepface": { "is_live": true, "score": 0.98 }
  },
  "processing_time_ms": 420
}

Mobile SDK

API KEY REQUIRED

Liveness SDK

On-device liveness detection (MTCNN + TFLite). Detect live vs spoof entirely on-device — no image leaves the phone during detection.

Add to build.gradle.kts — Kotlin 2.0+:

Kotlin
dependencies {
    implementation("com.codelyticalhub:liveness:1.0.0")
}
// settings.gradle.kts
repositories { mavenCentral() }

Manifest permissions:

XML
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

Quick start:

Kotlin
LivenessSdk.register(this)  // in onCreate

LivenessSdk.init(activity, "fg_live_your_key") { ok, err ->
    if (!ok) showError(err)
}

LivenessSdk.start(activity) { result ->
    when (result) {
        is LivenessResult.Real -> {
            val bitmap = LivenessSdk.uriToBitmap(context, result.imageUri)
            val base64 = LivenessSdk.uriToBase64(context, result.imageUri)
        }
        LivenessResult.Spoof     -> showMessage("Spoof")
        LivenessResult.Cancelled -> { }
        is LivenessResult.Error  -> showError(result.message)
    }
}

Mobile SDK

NO API KEY

Face Capture SDK

Capture a face image natively in your app and pass it to this endpoint. No API key needed for the capture itself.

Add to build.gradle.kts — Kotlin 2.0+:

Kotlin
dependencies {
    implementation("com.codelyticalhub:face-capture:1.0.0")
}
// settings.gradle.kts
repositories { mavenCentral() }

Manifest permission (runtime request handled by the SDK):

XML
<uses-permission android:name="android.permission.CAMERA" />

Quick start:

Kotlin
FaceCaptureSDK.register(this)  // in onCreate

FaceCaptureSDK.start(activity) { result ->
    when (result) {
        is FaceCaptureResult.Success -> {
            val file   = ImageUtils.bitmapToFile(context, result.bitmap)
            val base64 = ImageUtils.bitmapToBase64(result.bitmap)
            myBackend.callFaceGuardApi(file)  // never put API key in the app
        }
        FaceCaptureResult.Cancelled -> { }
        is FaceCaptureResult.Error  -> showError(result.message)
    }
}

⚠ Note

Never embed your FaceGuard API key in the app. Always proxy through your backend.

Ready to integrate Liveness Detection?

Create a free account. Get 50 test API requests instantly — no credit card required.