SightRadardocs
API referenceFaces

Compare two faces

Compare the best face in two images (Rekognition CompareFaces). (POST /v1/compare)

POST/v1/compare
Auth
Bearer API key
Billing
93 credits per image processed (real-time tier).

Compare the best face in two images (Rekognition CompareFaces). Returns cosine similarity (0-1) and a match boolean at the configured threshold. This is the ONLY endpoint that can process two photos in one request, and billing is per photo processed:

  • two images (source + target) → 186 credits
  • one image + one precomputed embedding → 93 credits
  • two precomputed embeddings → 93 credits (one billable operation; no image is fetched or run through the model) A side supplied as source_embedding / target_embedding is not a processed photo and is not charged as one.

Example request

curl -X POST "https://api.sightradar.com/v1/compare" \
  -H "Authorization: Bearer $SR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sourceUrl":"https://example.com/source.jpg","targetUrl":"https://example.com/target.jpg"}'

Parameters

NameInTypeDescription
Idempotency-KeyheaderstringOpt-in idempotency. A replay under the same key is never re-charged. For a selfie register it returns 200 with the stored result (Idempotent-Replay: true) when the registration identity matches; every other op returns 409.

Request body (application/json)

FieldTypeDescription
sourceUrlstring
sourceGcsKeystring
targetUrlstring
targetGcsKeystring
source_embeddingnumber[]
target_embeddingnumber[]

Response body

FieldTypeDescription
face_foundboolean
similaritynumber,nullCosine similarity (0-1).
matchboolean
thresholdnumber

Status codes

StatusMeaning
200Comparison result.
400Bad body or missing source/target.
401Missing or invalid API key.
402Wallet balance too low for this operation.
429Per-key RPS or per-customer concurrency limit exceeded.
502Engine error (the credit hold is refunded automatically).
Last updated

On this page