Face Detection API
This endpoint analyzes video input to detect, locate, and count human faces. It provides timestamps and bounding box coordinates for each detected face, making it ideal for video analysis, security, and content moderation workflows.
Endpoint
POST https://api.zapifyapi.com/v1/{api_token}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| api_token | string | Required. Your unique API access token for the Face Detection service. |
Request Body
The request expects a JSON object.
| Key | Type | Description |
|---|---|---|
| video_url | string | Required. The publicly accessible URL of the video file to analyze. |
Example Request
cURL
curl -X POST "https://api.zapifyapi.com/v1/YOUR_API_TOKEN"
-H "Content-Type: application/json"
-d '{
"video_url": "http://example.com/video.mp4"
}'
Node.js
const axios = require("axios");
const payload = {
video_url: "http://example.com/video.mp4"
};
axios.post("https://api.zapifyapi.com/v1/YOUR_API_TOKEN", payload)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
Response
Returns a JSON object with detection results, including timestamps and coordinates.
{
"status": "success",
"video_url": "http://example.com/video.mp4",
"faces_detected": 3,
"timestamps": [
{
"time": "00:05",
"confidence": 0.98,
"box": { "x": 100, "y": 50, "w": 80, "h": 80 }
},
{
"time": "00:12",
"confidence": 0.92,
"box": { "x": 200, "y": 150, "w": 70, "h": 70 }
}
]
}