API - Age

REQUEST

Analyze an image and return the coordinates of any detected faces, for each face include an estimate of age. This is a beta feature, improvement of the model is on the roadmap. Use for experimentation only.

        https://www.moderatecontent.com/api/v2?
        face=true&
        age=true&
        moderate_off=true&
        key=your_api_key&
        url=https://www.moderatecontent.com/img/sample_faces.jpg
    
ARGUMENTS

face
boolean
A flag to turn on the detect faces feature (true | false). Faces are returned as an array of coordinates for the detected face.
true

age
boolean
A flag to turn on the detect age feature (true | false). The age object is grouped with each detected face.
true

moderate_off
boolean
To improve the speed of face detection set this flag to true, the content moderation feature will be disabled. Set this flag to false to combine both moderation and face detection.
true

key
string
The api key used to reference your account within the system.
f96f44847704d2291b2967536afe8898

url
string
The url pointing at an image accessible over the internet, no larger than 10mb and with a format of either .jpg .png .bmp .gif.
https://www.moderatecontent.com/img/sample_faces.jpg
RESPONSE

        {
            "url_classified": "https://www.moderatecontent.com/img/sample_faces.jpg",
            "error_code": 0,
            "faces": [
                {
                    "age": 44,
                    "face": {
                        "width": 62,
                        "right": 197,
                        "score": 1.7932303939959,
                        "bottom": 163,
                        "y": 101,
                        "x": 135,
                        "top": 101,
                        "left": 135,
                        "height": 62
                    }
                }
            ]
        }
    

url_classified
string
The url pointing at an image accessible over the internet, no larger than 10mb and with a format of either .jpg .png .bmp .gif.
https://www.moderatecontent.com/img/sample.jpg

faces
array
List of face objects (coordinates and score)
[ { "age": 44, "face": { "width": 62, "right": 197, "score": 1.7932303939959433, "bottom": 163, "y": 101, "x": 135, "top": 101, "left": 135, "height": 62 } }, { "age": 52, "face": { "width": 62, "right": 363, "score": 1.0381803666420404, "bottom": 170, "y": 108, "x": 301, "top": 108, "left": 301, "height": 62 } } ]

age
integer
Object containing the age prediction. Range 0 to 100. Returns -1 on low confidence.
Parent: faces
44

face
object
Object containing the location within the image of the face and the confidence that it is a face.
Parent: faces
{ "width": 62, "right": 197, "score": 1.7932303939959, "bottom": 163, "y": 101, "x": 135, "top": 101, "left": 135, "height": 62 }

width
integer
The width in pixels of a single face's detected region.
Parent: face
62

right
integer
The distance from the left side of the image to the right side of the detected face in pixels.
Parent: face
62

score
double
The likelyhood that the region detected is actually a face, greater than 1.0 is a high probability.
Parent: face
1.7932303939959

bottom
integer
The distance from the top of the image to the bottom of the detected face in pixels.
Parent: face
163

y
integer
The distance from the left side of the image to the left side of the detected face in pixels.
Parent: face
101

x
integer
The distance from the top of the image to the top of the detected face in pixels.
Parent: face
135

top
integer
The distance from the top of the image to the top of the detected face in pixels.
Parent: face
101

left
integer
The distance from the left side of the image to the left side of the detected face in pixels.
Parent: face
101

height
integer
The height in pixels of a single face's detected region.
Parent: face
62

error_code
integer
A code representing the type of error returned. The value 0 means no error was found.
1024

error
integer
Optional
A message representing the type of error returned. This occurs when the error_code is not 0.
No url specified in querystring

frame
integer
The index of the frame where the rating originated. Animated gifs have 1..n frames, the API returns the frame with the highest prediction for adult.
1

Need some support?


Send us an email and we will get back to you as soon as possible!

info@moderatecontent.com

Terms of Service and Privacy Policy