FACE-ABCFACE-ABCOpen API Developer login / sign up

Personality Prediction API

Pass the URL of a frontal photo plus gender to get this person’s predicted answers on MBTI / 16PF questionnaires. Two ways to use it:Use our hosted service(billed per call), orintegrate it into your own system(a REST API you can wire up in minutes).

Endpoint

POST https://www.faceabc.com/api/v1/predict

Requests must include X-API-Key: <你的 Key>

Parameters

ParameterTypeRequiredDescription
photo_urlstringRequired* Publicly reachable URL of the photo, starting with http/https.
Or photo pick one of the two; this is recommended
photofileRequired* Upload the file directly, ≤ 10 MB, jpg/png/webp (auto-converted to JPG)
genderintRequired 0 = male,1 = female. Gender affects the prediction and is required
teststringOptional mbti(default) / 16pf / all
scopestringOptional preview(default, summary only) / full(includes every item and the reasoning)
Photo requirements (important)
· Format: JPG / JPEG / PNG / WebP / GIF / BMP all work — the system converts to JPG automatically(send JPG directly to skip the conversion)
· Size: ≤ 10 MB
· Content: frontal, clear features, no glare,forehead visible(the hairline must be detectable)
· Lighting: even light; avoid backlight and heavy shadows
· No hats, masks or sunglasses covering the face
· Images are resized below 3000 px and converted to JPG; a 1 MB PNG usually ends up around 200 KB

Example call

cURL

curl -X POST "https://www.faceabc.com/api/v1/predict" \
  -H "X-API-Key: fk_你的key" \
  -d "photo_url=https://你的域名/photo.jpg" \
  -d "gender=1" \
  -d "test=mbti" \
  -d "scope=preview"

Python

import requests

r = requests.post(
    "https://www.faceabc.com/api/v1/predict",
    headers={"X-API-Key": "fk_你的key"},
    data={
        "photo_url": "https://你的域名/photo.jpg",
        "gender": 1,          # 0=男 1=女
        "test": "mbti",
        "scope": "preview",
    },
    timeout=60,
)
print(r.json())

PHP

$ch = curl_init('https://www.faceabc.com/api/v1/predict');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['X-API-Key: fk_你的key'],
    CURLOPT_POSTFIELDS     => http_build_query([
        'photo_url' => 'https://你的域名/photo.jpg',
        'gender'    => 1,
        'test'      => 'mbti',
        'scope'     => 'preview',
    ]),
    CURLOPT_TIMEOUT        => 60,
]);
$res = json_decode(curl_exec($ch), true);

Response

{
  "success": true,
  "request_id": "req_2c68a4d955ee",
  "user_id": 1934364196,
  "gender": "female",
  "coverage": 1,


  "mbti": {
    "type": "ENTP",
    "dimensions": {
      "EI": { "letter": "E" },
      "SN": { "letter": "N" },
      "TF": { "letter": "T" },
      "JP": { "letter": "P" }
    }
  }
}
With scope=full you also get:the predicted answer, confidence and plain-language reasoning for every item (reason)。

Error codes

HTTPerrorDescription
401UNAUTHORIZEDInvalid or missing API Key
400NO_PHOTONeither photo_url nor photo was provided
400BAD_PHOTO_URLURL does not start with http/https
400BAD_GENDERgender is not 0 or 1
400BAD_TESTtest is outside the allowed values
400BAD_FILEImage could not be read or exceeds 10 MB
422FACE_REJECTEDPhoto failed validation (unclear face, not frontal, etc.)
422INSUFFICIENT_FEATURESNot enough features to make a prediction
500FACE_FAILEDRecognition service error
FACE-ABCFACE-ABC ACE-ABCLaboratory
© 2023-2026 FaceABC-Lab Support by JBTech All rights reserved. 冀ICP备2023042526号-1
中文