The Face Detect API uses state of the art computer vision algorithms to accurately and efficiently detect faces in images.
https://api.api-ninjas.com/v1/facedetect
Given an input image, returns a list containing all detected faces in the form of bounding boxes.
image
requiredImage file containing faces. Must be either JPEG or PNG format.
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/facedetect
Headers
X-Api-Key
Log in or sign up to get your API Key
1
1
2
3
4
5
6
7
import requests
api_url = 'https://api.api-ninjas.com/v1/facedetect'
image_file_descriptor = open('YOUR_IMAGE.jpeg', 'rb')
files = {'image': image_file_descriptor}
r = requests.post(api_url, files=files, headers={'X-Api-Key': 'YOUR_API_KEY'})
print(r.json())
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.