Face recognition with the SightRadar API. Use when the user wants to recognise, match, search, compare, verify or detect faces in photos, build a "find my photos from a selfie" feature, tag people across a photo library, add face search to an app, or pick the right face recognition call and estimate what it costs. Covers setup, API key, pricing, image input, thresholds and errors, and points to the task skills (face-search, face-compare, face-detect, face-batch-indexing, face-data-deletion, r...
0 votes
0 copies
0 views
Added December 5, 2026
ai-agentspythonbashnodeawsapi
Works with
api
mcp
Security analysis
B80/100
mediumUses curl or wget to download content
mediumInstalls packages at runtime which could introduce malicious dependencies
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of face-recognition?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sightradar-hq-face-recognition)
---
name: face-recognition
description: Face recognition with the SightRadar API. Use when the user wants to recognise, match, search, compare, verify or detect faces in photos, build a "find my photos from a selfie" feature, tag people across a photo library, add face search to an app, or pick the right face recognition call and estimate what it costs. Covers setup, API key, pricing, image input, thresholds and errors, and points to the task skills (face-search, face-compare, face-detect, face-batch-indexing, face-data-deletion, rekognition-migration).
license: MIT
compatibility: Needs network access to api.sightradar.com, a SightRadar API key in SIGHTRADAR_API_KEY, and curl (Python 3.8+ for the helper scripts in the task skills).
metadata:
author: SightRadar team
version: "1.0.0"
homepage: https://sightradar.com
---
# Face recognition with SightRadar
SightRadar is a hosted face recognition REST API at `https://api.sightradar.com`. Faces are stored as faceprints in **collections** that you name. Photos are not stored: you keep the image and refer to it by the `photoId` you pass when indexing.
Docs for agents: https://sightradar.com/llms.txt (add `.md` to any docs URL). OpenAPI spec: https://api.sightradar.com/openapi.json
## Pick the task
| The user wants to | Call | Skill |
| --- | --- | --- |
| Find every photo of a person from one selfie | index, then search | `face-search` |
| Check whether two photos show the same person | compare | `face-compare` |
| Count faces, get face boxes, check photo quality | detect | `face-detect` |
| Load thousands of photos | batch + webhooks | `face-batch-indexing` |
| Remove a person's or an event's face data | deletes | `face-data-deletion` |
| Move off AWS Rekognition | route mapping | `rekognition-migration` |
If the task skill is not installed, the sections below are enough to make any call with `curl`.
## Rules for the agent
- **Billable calls spend the user's money.** Say what a run will cost before a loop or a batch, check the balance first, and send an `Idempotency-Key` on any call you might retry.
- Refer to the key only as `$SIGHTRADAR_API_KEY`. Never print it, commit it, or put it in browser or mobile code.
- Deletes are soft (restorable) by default. Use `?immediate=true` or `?compliance=true` only when the user asks for permanent erasure.
- Face data is sensitive personal data. Index or register a person's face only when the user has that person's consent and a clear purpose, and never use face search to identify strangers.
- A face match shows resemblance, not identity. For identity checks it is one signal next to document and liveness checks.
## Setup
1. Create an account and an API key at https://sightradar.com/dashboard/keys. The key is shown once and looks like `frs_<prefix>_<secret>`.
2. Export it and test it with a free call:
```bash
export SIGHTRADAR_API_KEY="frs_..."
curl -s https://api.sightradar.com/v1/wallet -H "Authorization: Bearer $SIGHTRADAR_API_KEY"
# {"balance_credits": 500000}
```
If the key is missing, ask the user to create one and set the variable themselves. Do not ask them to paste it into the chat.
SDKs wrap the same routes: `pip install sightradar` (Python 3.8+, no dependencies) and `npm install sightradar` (Node 18+). Both read `SIGHTRADAR_API_KEY`. For chat assistants there is also an MCP server: `npx -y sightradar-mcp`, or the hosted one at `https://mcp.sightradar.com/mcp`.
## Cost
Prepaid credits. 1 credit = $0.00001, so 93 credits is about $0.00093 and 1,000 photos indexed in real time cost about $0.93. Current prices: https://sightradar.com/pricing
| Operation | Credits |
| --- | --- |
| Index a photo, search by image, register a selfie, detect | 93 per photo |
| Compare | 93 per image (two images = 186) |
| Search by a stored id, batch (per photo) | 62 |
| Collections, deletes, batch status, balance, usage | free |
The charge is per photo, never per face. A photo with no face is still charged. Requests that fail with 4xx or 5xx are not charged. Billable responses carry an `X-Credits-Remaining` header.
## Images
Index, search, detect and register-selfie take exactly one image per call, sent as one of:
- JSON `{"url": "https://..."}`: a public URL the API can fetch
- multipart form with a `file` part: a local file
- raw bytes with `Content-Type: application/octet-stream` (index and detect only)
Limit 30 MB. JPEG, PNG, WebP, HEIC, TIFF, GIF and BMP are accepted. Compare and batch take **URLs only**.
## The five calls
```bash
B="https://api.sightradar.com"; AUTH="Authorization: Bearer $SIGHTRADAR_API_KEY"; J="Content-Type: application/json"
# 1. Index: store the faces of a photo in a collection (93). The collection is created on first use.
curl -s -X POST "$B/v1/collections/event-2026/index" -H "$AUTH" -F "file=@./photos/001.jpg" -F "photoId=001"
# 2. Search: which indexed photos contain the person in this selfie? (93)
curl -s -X POST "$B/v1/collections/event-2026/search" -H "$AUTH" -F "file=@./selfie.jpg" -F "limit=50"
# {"matches":[{"photo_id":"001","score":0.91}],"photo_ids":["001"]}
# 3. Compare: same person in two images? (186)
curl -s -X POST "$B/v1/compare" -H "$AUTH" -H "$J" \
-d '{"sourceUrl":"https://example.com/a.jpg","targetUrl":"https://example.com/b.jpg"}'
# {"face_found":true,"similarity":0.83,"match":true,"threshold":...}
# 4. Detect: faces, boxes and quality, nothing stored (93)
curl -s -X POST "$B/v1/detect" -H "$AUTH" -F "file=@./photo.jpg"
# 5. Balance and usage (free)
curl -s "$B/v1/wallet" -H "$AUTH"
curl -s "$B/v1/usage?days=30" -H "$AUTH"
```
## Thresholds
Scores are **cosine similarity from 0 to 1**. No single cut-off is right for every use, so do not invent one:
- Calibrate on the user's own photos: score a few hundred same-person pairs and different-person pairs, and put the cut-off where the two groups separate.
- Use two bands. Above the high one accept automatically, between the two ask the user ("Is this you?") or send to review, below the low one reject.
- Photo discovery in galleries can be looser. Identity checks should be strict.
- `threshold` and `limit` only cap what the API returns. Keep the accept, review and reject logic in the user's code.
Guide: https://sightradar.com/docs/guides/thresholds
## Errors
The body is `{"error": "...", "error_code": "...", "error_detail": {"code","message","docs_url"}}`. Branch on `error_code` when it is present.
| HTTP | Meaning | Next step |
| --- | --- | --- |
| 400 | Bad body, or the image cannot be fetched or decoded | Fix the request. Not charged. |
| 401 | Key missing, invalid or revoked | Check `$SIGHTRADAR_API_KEY` |
| 402 | Out of credits | Top up at https://sightradar.com/dashboard/billing. Free calls still work. |
| 403 | Account is read-only, or the key lacks the scope | Use a key that owns the resource |
| 404 | Collection, batch or photo not found | Check the id with `GET /v1/collections` |
| 409 | Idempotency-Key already used, or the collection is being deleted | The first call already ran. Do not retry with a new key. |
| 413 | Image over 30 MB | Downscale to about 4000 px on the long side |
| 429 | Rate or concurrency limit | Back off with jitter, retry. Use batch for bulk work. |
| 502, 503 | Temporary engine or service error (any charge is refunded) | Retry with the same Idempotency-Key |
A search that finds nothing returns 200 with empty `matches` and a `reason`: `no_face` (no face in the query image), `low_quality_selfie` (the face failed the quality gate) or `point_not_found`. These searches are charged.