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.
| Field | Type | Default | Description |
|---|---|---|---|
| imagerequired | file | — | JPEG, PNG or WebP. One person only. |
| preset | string | — | 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
}| Field | Type | Description |
|---|---|---|
| success | boolean | Always true on a 200. |
| verdict | string | pass | 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. |
| preset | string | The standard that was applied. |
| preset_label | string | Its name, for display. |
| checks | Check[] | One entry per rule measured. |
| checks[].check | string | Which rule: resolution, aspect_ratio, head_height, eye_height, horizontal_centring, head_yaw, head_roll, head_pitch, sharpness, exposure, background. |
| checks[].status | string | pass | fail | warn | unknown. Only rules with a published figure behind them can `fail`; the quality signals can only `warn`. |
| checks[].measured | string | What was measured, in the units you can act on. |
| checks[].required | string | What the rule is, and whether a figure was published for it. |
| checks[].value | float | null | The raw number, for callers that want to draw it. |
| suggested_crop | object | null | Null when facial landmarks were unavailable. |
| suggested_crop.x1,y1,x2,y2 | integer | The crop rectangle, in pixels on the image you uploaded. |
| suggested_crop.fits | boolean | False when no crop of this image can satisfy the standard — the photo has to be taken again. |
| suggested_crop.note | string | Either confirmation that the crop works, or what the photo is short of and by how much. |
| not_checked | string[] | Published requirements this endpoint does not verify. Returned every time, deliberately. |
| source | string | The government page the figures came from. |
| verified_on | string | When that page was last read, YYYY-MM-DD. |
| face_bbox | int[4] | [x1, y1, x2, y2] of the face, in pixels. |
| image_width | integer | Decoded width in pixels. |
| image_height | integer | Decoded height in pixels. |
| landmarks_available | boolean | False means the head-size, eye-line and centring checks came back `unknown` rather than measured. |
| processing_time_ms | float | Model 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.