Face Detect (Legacy)
API Endpoints
Face Detect (Legacy)
Detect faces in images and get landmark information
POST
Face Detect (Legacy)
Documentation Index
Fetch the complete documentation index at: https://docs.akool.com/llms.txt
Use this file to discover all available pages before exploring further.
Migration Guide
Old Request (Legacy)
New Request (Recommended)
Parameter Mapping
| Legacy Parameter | New Parameter | Notes |
|---|---|---|
image_url | url | Renamed |
img | img | Same |
single_face | single_face | Same |
| - | num_frames | New: for video support |
| - | return_face_url | New: get cropped face URLs |
Response Changes
The new API returns a slightly different response format: Legacy Response:The new API wraps face data in a
faces_obj object keyed by frame index. For images, use faces_obj["0"] to access the face data.Legacy API Documentation
The following documentation is for the legacy endpoint. For new integrations, we recommend using the new Detect Faces API.
Important Notes
- single_face: Set to
trueto return only the largest face data, orfalseto return all detected faces. This parameter controls whether the API returns data for multiple faces or just the most prominent one. - image_url or img: You can choose to enter either the image URL or the base64 encoded image data
- The
landmarks_strvalue from the response should be used as theoptsparameter in Face Swap APIs
Response Fields
- landmarks: Array of face landmark coordinates
- landmarks_str: String representation of landmarks (use this for
optsparameter) - region: Face region bounding box coordinates
- seconds: API processing time
- trx_id: Transaction ID for tracking
Face Detect Response Code
| Error Code | Description |
|---|---|
| 0 | Success |
| Other | Check error_msg for details |
Authorizations
Your API Key used for request authorization.
Body
application/json
Set to true to return only the largest face data, or false to return all detected faces.
Image link. You can choose to enter this parameter or the img parameter.
Image base64 information. You can choose to enter this parameter or the image_url parameter.
Response
200 - application/json
Face detection completed
Interface returns business status code (0: success)
Error message of this API
Key point data of face
Landmark string representation
Face region coordinates
API time-consuming
Transaction ID