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 TypeCredits 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

ParameterTypeRequiredDescription
aigc_typestringMust be "face_detect" for face detection
callback_urlstringURL endpoint to receive detection results via POST
task_listarrayArray of face detection tasks (supports batch processing)
task_list[].additional_paramsobjectTask-specific parameters
task_list[].additional_params.target_image_urlstringURL of the image to analyze
task_list[].callback_paramsobjectCustom 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 message
  • credits_consumed: Total credits used for this request
  • creation_id: Unique identifier grouping all tasks in the request
  • task_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:

  1. Process Start Callback (process_status = 1) – Sent immediately when the AI starts processing your task.
  2. 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

FieldTypeDescription
task_idstringUnique task identifier
creation_idstringRequest batch identifier
start_timenumberProcessing start timestamp
end_timenumberProcessing end timestamp (when process_status = 2)
cost_timenumberTotal processing duration in seconds
result_codenumberinference result codes. success: 1, failure: -1 (This field value is valid only when process_status=2)
error_infostringError description (if failed)
error_codestringError code (if failed)
process_statusnumber1 = processing started, 2 = processing completed
result_listarrayThe list of rectangular coordinates of the face regions.
request_contextobjectYour callback_params echoed back

Webhook Retry Logic

  • Your endpoint must return HTTP 200 to confirm receipt
  • Non-200 responses trigger up to 4 retries at intervals: 5s, 30s, 120s, 300s
  • Implement idempotency using task_id to handle potential duplicate callbacks

Status Codes

CodeDescription
100000Success - Face detection completed
100010Invalid parameters (check image URL and request format)
100030Access denied (authentication failed)
100040Insufficient credits balance
100099Unknown error (contact support if persistent)

Use Cases

Security & Surveillance

Monitor video feeds for face detection, track individuals across camera systems, and trigger alerts based on facial recognition.

Content Moderation

Automatically detect faces in user-generated content to enforce privacy policies, blur faces for anonymization, or flag content for review.

Photo Organization

Build intelligent photo management systems that automatically group photos by detected individuals, create face-based albums, and suggest tags.

Access Control

Implement face-based authentication systems for secure access to physical locations or digital resources.

Retail Analytics

Track customer foot traffic, analyze demographics, measure dwell time, and optimize store layouts based on face detection data.

FAQ

How accurate is the face detection?
Our face detection API achieves 99%+ accuracy under optimal conditions (well-lit, forward-facing, high-resolution images). Accuracy may decrease with poor lighting, extreme angles, or low resolution.
What's the maximum number of faces that can be detected?
The API can detect up to 50 faces per image. For scenes with more faces, consider cropping or analyzing specific regions of interest.
Can I detect faces in video files directly?
Currently, you need to extract frames from videos and submit them as individual images. We recommend using FFmpeg or similar tools to extract frames at your desired interval.

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