Detect Face
curl --request POST \
--url https://api.deepidv.com/v1/face/detectimport requests
url = "https://api.deepidv.com/v1/face/detect"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/face/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/face/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/face/detect"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/face/detect")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/face/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"faceDetected": true,
"confidence": 0.99,
"boundingBox": {
"top": 0.18,
"left": 0.31,
"width": 0.41,
"height": 0.52
},
"landmarks": [
{ "type": "eyeLeft", "x": 0.44, "y": 0.38 },
{ "type": "eyeRight", "x": 0.58, "y": 0.38 },
{ "type": "nose", "x": 0.51, "y": 0.47 },
{ "type": "mouthLeft", "x": 0.46, "y": 0.59 },
{ "type": "mouthRight", "x": 0.57, "y": 0.59 }
]
}
{
"faceDetected": false,
"confidence": 0
}
Server-to-Server
Detect Face
Detect a face in an image and return bounding box and landmarks
POST
/
v1
/
face
/
detect
Detect Face
curl --request POST \
--url https://api.deepidv.com/v1/face/detectimport requests
url = "https://api.deepidv.com/v1/face/detect"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/face/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/face/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/face/detect"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/face/detect")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/face/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"faceDetected": true,
"confidence": 0.99,
"boundingBox": {
"top": 0.18,
"left": 0.31,
"width": 0.41,
"height": 0.52
},
"landmarks": [
{ "type": "eyeLeft", "x": 0.44, "y": 0.38 },
{ "type": "eyeRight", "x": 0.58, "y": 0.38 },
{ "type": "nose", "x": 0.51, "y": 0.47 },
{ "type": "mouthLeft", "x": 0.46, "y": 0.59 },
{ "type": "mouthRight", "x": 0.57, "y": 0.59 }
]
}
{
"faceDetected": false,
"confidence": 0
}
POST /v1/face/detect
/v1/face/compare or /v1/face/estimate-age — for example, to give the user immediate feedback that their selfie is too dark or off-frame.
Request
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Content-Type | Yes | multipart/form-data or application/json |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | binary | string | Yes | The image. For multipart, the file part. For JSON, a base64, base64url, or S3-key string. |
Example request
curl -X POST https://api.deepidv.com/v1/face/detect \
-H "x-api-key: YOUR_API_KEY" \
-F "image=@selfie.jpg"
curl -X POST https://api.deepidv.com/v1/face/detect \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "image": "uploads/selfie-abc123.jpg" }'
import fs from "node:fs";
const form = new FormData();
form.append(
"image",
new Blob([fs.readFileSync("selfie.jpg")]),
"selfie.jpg",
);
const response = await fetch("https://api.deepidv.com/v1/face/detect", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: form,
});
const data = await response.json();
import requests
with open("selfie.jpg", "rb") as f:
response = requests.post(
"https://api.deepidv.com/v1/face/detect",
headers={"x-api-key": "YOUR_API_KEY"},
files={"image": f},
)
Response
200 — Success
| Field | Type | Description |
|---|---|---|
faceDetected | boolean | True when a face was detected |
confidence | number (0–1) | Detection confidence for the top face. 0 when no face was detected |
boundingBox | object | Normalized bounding-box coordinates (omitted when no face detected) |
landmarks | object[] | Facial landmark points (omitted when no face detected) |
boundingBox shape: { top, left, width, height }, each normalized to 0–1 against the source image dimensions.
landmarks[] shape: { type, x, y }, where type is the landmark name (e.g. eyeLeft, nose, mouthRight) and x/y are normalized to the image dimensions.
Error responses
| Status | Description |
|---|---|
400 | Invalid body, unsupported image format, or image larger than 15 MB |
401 | Missing or invalid x-api-key |
402 | Insufficient token balance |
403 | The supplied image S3 key is not readable by this organization |
429 | Rate limit exceeded |
500 | Unexpected server error — safe to retry with backoff |
{
"faceDetected": true,
"confidence": 0.99,
"boundingBox": {
"top": 0.18,
"left": 0.31,
"width": 0.41,
"height": 0.52
},
"landmarks": [
{ "type": "eyeLeft", "x": 0.44, "y": 0.38 },
{ "type": "eyeRight", "x": 0.58, "y": 0.38 },
{ "type": "nose", "x": 0.51, "y": 0.47 },
{ "type": "mouthLeft", "x": 0.46, "y": 0.59 },
{ "type": "mouthRight", "x": 0.57, "y": 0.59 }
]
}
{
"faceDetected": false,
"confidence": 0
}
When no face is detected the endpoint still returns
200 OK with
faceDetected: false. Treat that as a UX-level failure (prompt the user
to retake) rather than an integration error. Only the highest-confidence
face is returned.