1:1 face matching
Face comparison API, two photos in, one score out.
SightRadar's face comparison API takes two photos and tells you how alike the two faces are: a similarity score from 0 to 1 and a match verdict. It is one REST call, POST /v1/compare, the equivalent of AWS Rekognition CompareFaces, and it costs $0.00093 for each image it processes.
Updated
What a compare call takes and returns
One endpoint, POST /v1/compare, with a Bearer API key. Give each side as an image URL or as a faceprint you already hold.
| Request field | What it is |
|---|---|
| sourceUrl | HTTPS URL of the first image. SightRadar fetches it. |
| targetUrl | HTTPS URL of the second image. |
| source_embedding | A stored faceprint (512 numbers) in place of the first image, such as the one returned when you register a selfie. |
| target_embedding | A stored faceprint in place of the second image. |
| Response field | What it is |
|---|---|
| face_foundboolean | False when a usable face could not be found. The similarity is then null. |
| similaritynumber or null | Cosine similarity between the two faceprints, from 0 to 1. Higher means more alike. |
| matchboolean | Whether the similarity reached the threshold below. |
| thresholdnumber | The default threshold that match was judged at. |
One face from each image
When a photo holds several faces, the largest, most confident one is compared.
A faceprint for each face
Each face becomes a faceprint, a list of 512 numbers that summarises it. The two faceprints are compared with cosine similarity.
A score and a verdict
You get the similarity from 0 to 1, and a match flag judged at the default threshold. For decisions that matter, apply your own threshold to the score.
One call to a match verdict
Send two image URLs and read the score. The same call in curl, Python and Node.
curl -X POST "https://api.sightradar.com/v1/compare" \
-H "Authorization: Bearer $SIGHTRADAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourceUrl": "https://example.com/id-photo.jpg",
"targetUrl": "https://example.com/selfie.jpg"
}'{
"face_found": true,
"similarity": 0.66,
"match": true,
"threshold": 0.42
}from sightradar import SightRadar
sr = SightRadar() # reads SIGHTRADAR_API_KEY
cmp = sr.compare(
source_url="https://example.com/id-photo.jpg",
target_url="https://example.com/selfie.jpg",
)
print(cmp.match, cmp.similarity)import { SightRadar } from "sightradar";
const sr = new SightRadar(); // reads SIGHTRADAR_API_KEY
const cmp = await sr.compare({
sourceUrl: "https://example.com/id-photo.jpg",
targetUrl: "https://example.com/selfie.jpg",
});
console.log(cmp.match, cmp.similarity);Every field and status code is in the compare endpoint reference. Already calling AWS Rekognition CompareFaces? The Python shim keeps your boto3 method names.
Try it without a key
The free face compare tool runs the same comparison in your browser. Scripts and AI agents can post two photos to the free API with no key. Both are for testing, under a fair-use limit.
curl -X POST https://sightradar.com/api/free/compare \
-F "source=@a.jpg" -F "target=@b.jpg"The free API guide has the response and the limits.
Face comparison API pricing
You pay for each image processed. A side sent as a stored faceprint is not a processed photo.
| What you send | Billed as | Price |
|---|---|---|
| Two new images | 2 photos | $0.00186 |
| One new image against a stored faceprint | 1 photo | $0.00093 |
| Two stored faceprints | 1 operation | $0.00093 |
AWS Rekognition CompareFaces bills one image for each call, $0.00100 at its list price for the first million images a month in us-east-1. So a compare of two new images costs less on AWS. When one side is a stored faceprint, a compare here is $0.00093, 7% lower. See full pricing or price a whole workload with the cost calculator.
Choosing the threshold
The match flag uses a default threshold. The right cut-off depends on your photos and on what each kind of mistake costs you.
- Collect a few hundred same-person pairs and a few hundred different-person pairs from your own photos, run them through compare, and look at where the two sets of scores overlap.
- Use two cut-offs where you can: accept above the higher one, reject below the lower one, and send the scores in between to a confirmation step or a person.
- Identity checks belong on the strict side. Photo discovery can be looser, because a wrong suggestion is cheap and the user confirms it.
- Do not carry a number over from another vendor. AWS Rekognition reports similarity from 0 to 100 and SightRadar from 0 to 1, and dividing by 100 does not give the same operating point.
The threshold guide walks through it, and choosing a face-match threshold explains false match and false non-match rates.
Access and limits
- Sign-up
- Email and an API key. No approval form and no cloud account.
- Rate limit
- 50 requests a second for each key, and 10 requests in flight for each account.
- Inputs
- An HTTPS URL for each image, or a stored faceprint on either side.
- Image formats
- JPEG, PNG, WebP, HEIC/HEIF, TIFF, GIF and BMP, up to 30 MB each.
- Storage
- Compare does not keep the images you send.
- Retries
- Send an Idempotency-Key header and a replayed call is answered with 409 and never charged twice.
- Billing
- Prepaid credits with no subscription. An engine error is refunded automatically.
- SDKs
- Python, Node, a CLI, an MCP server for AI agents, and a Python shim that keeps the AWS Rekognition compare_faces call.
When it is not the right fit
- You need liveness detection or ID document checks. A face match shows that two faces resemble each other, not that a person is present or a document is genuine. Pair it with an identity verification provider.
- You want to find one person among thousands of photos. That is 1:N search, on the face recognition API page.
- Most of your calls compare two brand-new images. AWS Rekognition bills one image for that and is likely cheaper.
- You need to compare faces on a phone with no network call. That calls for an on-device SDK, not a cloud API.
- Face data must stay on your own servers. Look at a self-hosted engine instead.
To search a collection for one person, see the face recognition API. To set SightRadar beside AWS Rekognition, Azure Face and others, see the comparison pages.
Questions about the face comparison API
What is a face comparison API?
It is a web service that takes two face images and returns how alike they are. It answers a 1:1 question: are these the same person? The same thing is called face matching or face verification. Face recognition in the 1:N sense is different: it searches a stored collection for a person.
How is the similarity score calculated?
Each face is turned into a faceprint, a list of 512 numbers that summarises its features. The two faceprints are compared with cosine similarity, which gives a score from 0 to 1. Scores near 1 mean the faces are very likely the same person, and low scores mean they are likely different people.
Does a match prove two photos show the same person?
No. A high score is strong evidence, not proof. Identical twins and close relatives can score high, and a poor photo can lower the score for the same person. For identity verification, combine the face match with document checks and liveness.
How much does one comparison cost?
$0.00093 for each image processed, so $0.00186 for two new images and $0.00093 when one side is a stored faceprint. There is no subscription. You buy credits in advance and each call draws them down.
Is it the same as AWS Rekognition CompareFaces?
It does the same job, and in Python the official shim keeps the boto3 compare_faces call. Three things differ. The score runs from 0 to 1, not 0 to 100. Images are passed as URLs, not raw bytes. And billing counts each image processed, where AWS counts one image for each call.
Are the photos stored?
No. A compare processes the two images and returns the result. It does not keep the images. Faceprints are stored only when you index a photo or register a selfie.
Can I try it before I create an account?
Yes. The free face compare tool runs the same comparison in your browser, and the free API accepts two uploaded photos with no key. Both are for testing, under a fair-use limit. For regular use, create a key.