Face Recognition

FREEMIUM
By betaface
Updated 4 months ago
Visual Recognition
4.1/10
Popularity Score
2959ms
Latency
100%
Success Rate

Face Recognition API Documentation

Detect, analyze and recognize faces

View API Details
media
POSTupload media
POSTupload media file
GETget media info
GETget media info by hash
recognize
POSTrecognize faces
GETrecognize result
POSTset person
transform
POSTtransform faces
GETtransform result
face
GETface info
GETface info (cropped)
POSTupload media

upload and optionally directly process media file using file uri or file content as base64 encoded string

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
upload mediaJSON_STRING
REQUIREDParameters: file_uri - string publicly accessible media file uri. file_base64 - string base64 encoded media file content. file_uri parameter will be ignored if file_base64 parameter is specified and not empty. detection_flags - string (optional) comma separated list of detection flags: bestface - return only face with highest detection score, propoints - 101 pro points detection, classifiers - face classification and attributes, extended - extended color and geometric measurements, content - image content detection. detection_min_score - number($double) (optional) filter faces with detection score lower than min_score. detection_new_faces - array[] (optional) override automatic faces detection and manually specify faces locations, face points and person ids to assign. provide a list of new faces as an array of entries with following template: { "x": 0, "y": 0, "width": 0, "height": 0, "angle": 0, "points": [ { "x": 0, "y": 0, "type": 0 }, { "x": 0, "y": 0, "type": 0 }], "tags": [ { "name": "", "value": "", "confidence": 1.0 }, {"name": "", "value": "", "confidence": 1.0 } ], "set_person_id": ""} set_person_id - string (optional) set person id in format [email protected] to each detected face. recommended to use with detection_flags bestface and/or min_score minimum detection score parameter. recognize_targets - array[string] (optional) for each detected face run recognize against specified targets (face ids, person ids or namespaces). recognize_parameters - string (optional) comma separated list of recognition parameters, currently supported min_match_score (minimum recognition score), min_score (minimum detection score), gender and race filter. for example: “min_match_score:0.4,min_score:0.2,gender:male,race:white” original_filename - string (optional) original media filename, path, uri or your application specific id that you want to be stored in media metadata for reference.
Code Snippet
unirest.post("https://betaface-face-recognition-v1.p.rapidapi.com/media")
.header("X-RapidAPI-Host", "betaface-face-recognition-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"file_uri":"http://betafaceapi.com/api_examples/sample.png","detection_flags":"propoints,classifiers,content","recognize_targets":["[email protected]"],"original_filename":"sample.png"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://betaface-face-recognition-v1.p.rapidapi.com/media
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://betaface-face-recognition-v1.p.rapidapi.com/media")
.header("X-RapidAPI-Host", "betaface-face-recognition-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"file_uri":"http://betafaceapi.com/api_examples/sample.png","detection_flags":"propoints,classifiers,content","recognize_targets":["[email protected]"],"original_filename":"sample.png"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication