Skip to main content

Compare two face photos and get a similarity score, using the SightRadar face recognition API. Use when the user asks whether two photos show the same person, wants 1:1 face matching or face verification, needs to check a selfie against an ID or profile photo, wants to find duplicate people across two images, or is replacing AWS Rekognition CompareFaces.

  • New
  • v1.0.0
  • Reviewed Dec 5
  • No reviews yet

Capabilities

  • Compare

    URLs must be fetchable from the public internet without login or cookies

  • Reading the score

    Report the number together with the verdict, for example "similarity 0.83, above the 0.42 default, so likely…

  • One person against many photos

    Compare is 1:1

  • Errors

Getting started

Full instructions

Example command

Compare

curl -s -X POST "$B/v1/compare" -H "$AUTH" -F "source=@./a.jpg" -F "target=@./b.jpg"

Instructions: SKILL.mdv1.0.0

Face compare: are these two photos the same person?

POST https://api.sightradar.com/v1/compare takes the clearest face in each of two images and returns a cosine similarity from 0 to 1 and a match boolean. Nothing is stored.

Before you start

  • Key: export SIGHTRADAR_API_KEY="frs_..." (create one at https://sightradar.com/dashboard/keys). Never print or commit it. If it is missing, ask the user to set it; do not ask them to paste it in chat.
  • Cost: 93 credits per image processed, so one comparison of two images is 186 credits (about $0.0019). Say the total before comparing many pairs.
  • Compare photos only of people who agreed to it.

Compare

bash
B="https://api.sightradar.com"; AUTH="Authorization: Bearer $SIGHTRADAR_API_KEY"

# Two local files
curl -s -X POST "$B/v1/compare" -H "$AUTH" -F "source=@./a.jpg" -F "target=@./b.jpg"

# Two public URLs
curl -s -X POST "$B/v1/compare" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"sourceUrl":"https://example.com/a.jpg","targetUrl":"https://example.com/b.jpg"}'
json
{ "face_found": true, "similarity": 0.83, "match": true, "threshold": 0.42 }
  • similarity: cosine similarity, 0 to 1. Higher means more alike. null when a face is missing.
  • match: similarity is at or above threshold, the server's default cut-off, which is returned in the response.
  • face_found: false: one of the images has no usable face. Run detect on each image (see the face-detect skill) to find which one, then ask for a clearer photo.

URLs must be fetchable from the public internet without login or cookies. If a call with URLs fails with a 4xx or 5xx, open each URL with curl -I first: a URL the API cannot download is the usual cause. Images can be up to 30 MB.

In code

python
# pip install sightradar
from sightradar import SightRadar
sr = SightRadar()                                    # reads SIGHTRADAR_API_KEY
r = sr.compare(source_url="https://example.com/a.jpg", target_url="https://example.com/b.jpg")
print(r.match, r.similarity)
ts
// npm install sightradar
import { SightRadar } from "sightradar";
const sr = new SightRadar();
const r = await sr.compare({ sourceUrl: "https://example.com/a.jpg", targetUrl: "https://example.com/b.jpg" });
console.log(r.match, r.similarity);

Reading the score

Report the number together with the verdict, for example "similarity 0.83, above the 0.42 default, so likely the same person". Then apply the user's own rule:

  • The default threshold suits general matching. It is not a security setting. For anything where a wrong match is costly, the user should set a stricter cut-off tested on their own photos.
  • Use two bands when a person can review: accept above the high cut-off, review in between, reject below the low one.
  • A match shows that two faces look alike. It does not prove identity and it does not detect a photo of a photo. Identity verification also needs a document check and a liveness check.
  • Twins, heavy filters, masks, very small faces and big age gaps all lower reliability. Say so when the score is borderline.

Threshold guide: https://sightradar.com/docs/guides/thresholds

One person against many photos

Compare is 1:1. To check one face against hundreds of photos, index the photos into a collection once and search it (see the face-search skill): one search costs 93 credits no matter how large the collection is.

Errors

400 bad body or an image that cannot be decoded. 401 bad key. 402 out of credits. 413 image over 30 MB. 429, 502, 503: wait and retry. Failed requests are not charged. Full docs: https://sightradar.com/llms.txt

Examples

Prompt

Are these two photos of the same person? Here are the URLs: https://example.com/photo1.jpg and https://example.com/photo2.jpg

Output

Using the SightRadar API, the similarity score between the two faces is 0.83, which is above the default threshold of 0.42, indicating they are likely the same person. Note that this match shows facial similarity but does not guarantee identity verification.

Prompt

Can you check if this selfie matches the ID photo? Selfie URL: https://example.com/selfie.jpg, ID photo URL: https://example.com/id.jpg

Output

The face comparison returned a similarity of 0.55, above the default threshold of 0.42, so the photos likely show the same person. However, due to the borderline score, consider reviewing manually or applying stricter thresholds for security-sensitive use cases.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Frequently asked questions about face-compare

What does the face-compare skill do?

Compare two face photos and get a similarity score, using the SightRadar face recognition API. Use when the user asks whether two photos show the same person, wants 1:1 face matching or face verification, needs to check a selfie against an ID or profile photo, wants to find duplicate people across two images, or is replacing AWS Rekognition CompareFaces. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the face-compare skill?

Run `npx @skills-hub-ai/cli install face-compare` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/face-compare/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does face-compare work with?

face-compare runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the face-compare skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use face-compare after installing it?

In Claude Code, type `/face-compare` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the face-compare skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/face-compare)](https://skills-hub.ai/skills/face-compare)
HTML
<a href="https://skills-hub.ai/skills/face-compare"><img src="https://skills-hub.ai/api/badges/skill/face-compare" alt="Install on Skills Hub"></a>

More options in the badge docs.