API reference

Check a passport photo

Measure a portrait against a published passport or visa standard.

POST /v1/photo-check/check1 operation per photo

The programmatic form of Check a passport photo in the dashboard — same models, same allowance.

Request

multipart/form-data, with your key as a bearer token.

FieldTypeDefaultDescription
imagerequiredfile—JPEG, PNG or WebP. One person only.
presetstring—Which standard to measure against: us_passport (default), us_visa or uk_passport.

Example

curl -X POST https://api.quantilence.com/v1/photo-check/check \
  -H "Authorization: Bearer $QUANTILENCE_API_KEY" \
  -F "image=@photo.jpg" \
  -F "preset=value"

Response

200 OK with this shape. Values below are illustrative; the keys and types are not.

{
  "success": true,
  "verdict": "review",
  "preset": "uk_passport",
  "preset_label": "United Kingdom passport",
  "checks": [
    {
      "check": "head_height",
      "status": "pass",
      "measured": "68.9% of image height, chin to estimated crown",
      "required": "64.4%-75.6%",
      "value": 0.689
    },
    {
      "check": "background",
      "status": "warn",
      "measured": "variation 33.8 (across 33.8, within 1.0), brightness 218, 8 patches — uneven across the frame",
      "required": "variation under 12, brightness 110+ (published as \"plain and light\", with no figure)",
      "value": 33.8
    }
  ],
  "suggested_crop": {
    "x1": 121,
    "y1": 56,
    "x2": 580,
    "y2": 646,
    "fits": true,
    "note": "Crop to these pixels and the framing checks pass."
  },
  "not_checked": [
    "neutral expression and closed mouth",
    "eyes open, visible and unobscured",
    "glasses, tinted lenses and lens glare"
  ],
  "source": "https://www.gov.uk/photos-for-passports/photo-requirements",
  "verified_on": "2026-11-14",
  "face_bbox": [
    214,
    132,
    486,
    470
  ],
  "image_width": 700,
  "image_height": 900,
  "landmarks_available": true,
  "processing_time_ms": 311.4
}
FieldTypeDescription
successbooleanAlways true on a 200.
verdictstringpass | review | fail. `fail` means a published figure was missed. `review` means nothing missed a published figure but something could not be measured, or sits outside guidance that is ours rather than a government's. Treat anything other than `pass` as needing a human look.
presetstringThe standard that was applied.
preset_labelstringIts name, for display.
checksCheck[]One entry per rule measured.
checks[].checkstringWhich rule: resolution, aspect_ratio, head_height, eye_height, horizontal_centring, head_yaw, head_roll, head_pitch, sharpness, exposure, background.
checks[].statusstringpass | fail | warn | unknown. Only rules with a published figure behind them can `fail`; the quality signals can only `warn`.
checks[].measuredstringWhat was measured, in the units you can act on.
checks[].requiredstringWhat the rule is, and whether a figure was published for it.
checks[].valuefloat | nullThe raw number, for callers that want to draw it.
suggested_cropobject | nullNull when facial landmarks were unavailable.
suggested_crop.x1,y1,x2,y2integerThe crop rectangle, in pixels on the image you uploaded.
suggested_crop.fitsbooleanFalse when no crop of this image can satisfy the standard — the photo has to be taken again.
suggested_crop.notestringEither confirmation that the crop works, or what the photo is short of and by how much.
not_checkedstring[]Published requirements this endpoint does not verify. Returned every time, deliberately.
sourcestringThe government page the figures came from.
verified_onstringWhen that page was last read, YYYY-MM-DD.
face_bboxint[4][x1, y1, x2, y2] of the face, in pixels.
image_widthintegerDecoded width in pixels.
image_heightintegerDecoded height in pixels.
landmarks_availablebooleanFalse means the head-size, eye-line and centring checks came back `unknown` rather than measured.
processing_time_msfloatModel time.

Worth knowing

  • A `pass` is not a prediction that an application will be accepted. The response's `not_checked` list is the honest boundary — expression, glasses, head coverings, shadows and background objects are not measured here.
  • Only the checks with a published figure behind them can `fail`. Sharpness, exposure and background are measured against thresholds we chose, because no authority publishes a number for them, so they `warn` instead.
  • `head_pitch` is indicative only. Measured across frontal portraits the underlying figure carries a systematic offset, so it is reported corrected and can never fail a photo.
  • Two faces is a 400 (`multiple_faces`), not a best guess — a passport photo shows one person alone.
  • `suggested_crop.fits: false` is the useful answer, not a refusal: it means re-take the photo rather than crop it, and the note says what room was missing.