Face Detect API

The Face Detect API uses state of the art computer vision algorithms to accurately and efficiently detect faces in images.

(4.7)

From 9,332 users

2,600+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
394ms440ms487ms650ms1223ms

Didn't find what you were looking for? Suggest an improvement


/v1/facedetect POST

https://api.api-ninjas.com/v1/facedetect

Given an input image, returns a list containing all detected faces in the form of bounding boxes.

Files

  • image  required

    Image file containing faces. Must be either JPEG or PNG format.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns an array of face detection objects, each containing the following fields:

  • x

    The x-coordinate of the top-left corner of the bounding box.

  • y

    The y-coordinate of the top-left corner of the bounding box.

  • width

    Width of the bounding box in pixels.

  • height

    Height of the bounding box in pixels.

Sample Request Live Demo!

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/facedetect

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 3 curl -X POST "https://api.api-ninjas.com/v1/facedetect" \ -H "X-Api-Key: YOUR_API_KEY" \ -F "image=@YOUR_IMAGE.jpeg"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.