Image Face Detection API - Complete Integration Guide
Overview
The Image Face Detection API provides powerful face detection and analysis capabilities for image content. Identify faces, extract facial features, and gather metadata to power face recognition systems, content moderation tools, or analytics platforms.
Key Features
- Multi-Face Detection: Identify multiple faces in a single frame
- Facial Landmarks: Extract detailed facial feature coordinates
- Batch Processing: Analyze multiple images frames simultaneously
- Cost-Effective: Only 1 credit per image analyzed
Authentication
All API requests require authentication using an API key. Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
API Host: https://us-center.deep-api.com
🔑 Getting Your API Key
Contact customer support to obtain your API key and start detecting faces in your image content.
Pricing
| Service Type | Credits Required |
|---|---|
| Face Detection (per image/frame) | 1 credit |
Cost-Effective Analysis: At just 1 credit per image, our face detection API is ideal for high-volume applications requiring facial analysis at scale.
Face Detection API
Endpoint
POST /api/aigc/task/submit
Request Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
aigc_type | string | ✅ | Must be "face_detect" for face detection |
callback_url | string | ✅ | URL endpoint to receive detection results via POST |
task_list | array | ✅ | Array of face detection tasks (supports batch processing) |
task_list[].additional_params | object | ✅ | Task-specific parameters |
task_list[].additional_params.target_image_url | string | ✅ | URL of the image to analyze |
task_list[].callback_params | object | ❌ | Custom parameters returned in webhook callback |
Response Format
{
"code": 100000,
"message": "Request Success",
"data": {
"credits_consumed": 1,
"creation_id": "3fe766593eed425e83bf7a36b7321c31",
"task_id_list": [16222903]
}
}
Response Fields:
code: Status code (100000 = success)message: Human-readable response messagecredits_consumed: Total credits used for this requestcreation_id: Unique identifier grouping all tasks in the requesttask_id_list: Array of task IDs in submission order
Code Example
curl --location --request POST \
'https://us-center.deep-api.com/api/aigc/task/submit' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"aigc_type": "face_detect",
"callback_url": "https://your-domain.com/callback/url",
"task_list": [
{
"additional_params": {
"target_image_url": "https://your-storage.com/test.jpg"
},
"callback_params": {
"user_id": 1,
"timestamp": "00:00:01"
}
}
]
}'
Webhook Callbacks
Face detection results are sent to your callback_url via POST request upon completion.
⚠️ Important:
Each task triggers two separate callbacks:
- Process Start Callback (
process_status = 1) – Sent immediately when the AI starts processing your task.- Process Complete Callback (
process_status = 2) – Sent when the task finishes (successfully or failed).You should handle both callbacks properly:
- Use the start callback to update UI or mark task as “in progress”
- Use the complete callback to retrieve results and finalize the task
- Avoid treating “start” callback as a completion event
Webhook Request Structure
| Field | Type | Description |
|---|---|---|
task_id | string | Unique task identifier |
creation_id | string | Request batch identifier |
start_time | number | Processing start timestamp |
end_time | number | Processing end timestamp (when process_status = 2) |
cost_time | number | Total processing duration in seconds |
result_code | number | inference result codes. success: 1, failure: -1 (This field value is valid only when process_status=2) |
error_info | string | Error description (if failed) |
error_code | string | Error code (if failed) |
process_status | number | 1 = processing started, 2 = processing completed |
result_list | array | The list of rectangular coordinates of the face regions. |
request_context | object | Your callback_params echoed back |
Webhook Retry Logic
- Your endpoint must return HTTP
200to confirm receipt - Non-200 responses trigger up to 4 retries at intervals: 5s, 30s, 120s, 300s
- Implement idempotency using
task_idto handle potential duplicate callbacks
Status Codes
| Code | Description |
|---|---|
| 100000 | Success - Face detection completed |
| 100010 | Invalid parameters (check image URL and request format) |
| 100030 | Access denied (authentication failed) |
| 100040 | Insufficient credits balance |
| 100099 | Unknown error (contact support if persistent) |
Use Cases
Security & Surveillance
Content Moderation
Photo Organization
Access Control
Retail Analytics
FAQ
How accurate is the face detection?
What's the maximum number of faces that can be detected?
Can I detect faces in video files directly?
Support
Need help integrating the Face Swap API? Contact our technical support team for:
- API key provisioning
- Integration assistance
- Credit balance inquiries
- Technical troubleshooting
API Version: v1
Last Updated: October 2025