---
title: "Face Detect (Legacy)"
method: POST
path: "/detect"
tags: ["Face Detection (Legacy)"]
---

# Face Detect (Legacy)

`POST /detect`

**Note**: This endpoint will be deprecated in a future release. We recommend using the new [Detect Faces API](https://openapi.akool.com/interface/detect-api/detect_faces) for all new integrations.

The new endpoint provides:
- Support for both images and videos
- Base64 image input support
- Cropped face image URLs
- Single face mode
- Better face tracking for videos

---

Legacy endpoint to detect faces in images and get landmark information.

## Request body

- FaceDetectRequest
  - `single_face` boolean, required — Set to true to return only the largest face data, or false to return all detected faces.
  - `image_url` string — Image link. You can choose to enter this parameter or the img parameter.
  - `img` string — Image base64 information. You can choose to enter this parameter or the image_url parameter.

## Response `200`

Face detection completed

- FaceDetectResponse
  - `error_code` integer — Interface returns business status code (0: success)
  - `error_msg` string — Error message of this API
  - `landmarks` array[] — Key point data of face
    - array[]
      - number[]
  - `landmarks_str` string[] — Landmark string representation
  - `region` array[] — Face region coordinates
    - number[]
  - `seconds` number — API time-consuming
  - `trx_id` string — Transaction ID

---

[API](https://skmtc.dev/akool/apis/face-detection-api.md) · [All operations](https://skmtc.dev/akool/apis/face-detection-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/akool/face-detection-api/revisions/ce2ff5679949/schema)
