Index or match thousands of photos in bulk with the SightRadar face recognition batch API and signed webhooks. Use when the user wants to load a large gallery, event or photo archive for face search, process photo URLs asynchronously, receive per-photo results on a webhook, verify webhook signatures, poll batch status, or retry failed photos.
Capabilities
Submit
Keep every batch_id that comes back
Get the results
The batch is finished when status is completed (pending is 0)
Verify the webhook signature
Compute the HMAC over the raw request body, before any JSON parsing
Errors
Getting started
Full instructionsExample command
Register a webhook (optional, free, once)
curl -s -X POST "$B/v1/webhooks" -H "$AUTH" -H "$J" -d '{"url":"https://api.example.com/sightradar/webhook"}'Instructions: SKILL.mdv1.0.0
Batch indexing: load a large gallery
One POST /v1/batches call takes up to 1,000 photo URLs and processes them in the background. It costs 62 credits per photo instead of 93, and photos that fail are not charged. Results come per photo on a webhook, or by polling.
Use batch when there are more than a few hundred photos and they are reachable by URL. For local files or a handful of photos, use the real-time index call (see the face-search skill).
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: 62 credits per photo, 1 credit = $0.00001, so 10,000 photos cost about $6.20. Tell the user the total and get a yes before submitting. Check the balance with
GET /v1/wallet(free). - URLs only. Base64 and file uploads are rejected. Private buckets work with signed URLs that stay valid for a few hours.
B="https://api.sightradar.com"; AUTH="Authorization: Bearer $SIGHTRADAR_API_KEY"; J="Content-Type: application/json"
1. Register a webhook (optional, free, once)
curl -s -X POST "$B/v1/webhooks" -H "$AUTH" -H "$J" -d '{"url":"https://api.example.com/sightradar/webhook"}'
# {"webhook_endpoint_id":"whe_...","secret":"whsec_...","status":"active"}
The URL must be public HTTPS. The secret is returned once: have the user store it as a server secret. Do not print it again.
2. Submit
curl -s -X POST "$B/v1/batches" -H "$AUTH" -H "$J" -d '{
"collection_id": "event-2026",
"op": "index",
"webhook_endpoint_id": "whe_...",
"photos": [
{"url": "https://cdn.example.com/1.jpg", "external_id": "1"},
{"url": "https://cdn.example.com/2.jpg", "external_id": "2"}
]
}'
# 202 {"batch_id":"...","total_photos":2,"status":"processing"}
op:indexstores the faces of each photo.matchsearches each photo against the collection.external_id: the user's own photo key. It comes back on every result and is thephoto_idthat searches return. Avoid/in it: a photo id with a slash cannot be addressed by the per-photo delete route.- More than 1,000 photos: split into several batches. Build the JSON with a script, not by hand:
# urls.txt: one "url,external_id" per line
split -l 1000 urls.txt chunk_
for f in chunk_*; do
jq -Rn --arg c "event-2026" '{collection_id:$c, op:"index",
photos:[inputs | select(length>0) | split(",") | {url:.[0], external_id:(.[1] // .[0])}]}' "$f" \
| curl -s -X POST "$B/v1/batches" -H "$AUTH" -H "$J" -d @-
echo
done
Keep every batch_id that comes back.
3. Get the results
Polling (works with or without a webhook):
curl -s "$B/v1/batches/<batch_id>" -H "$AUTH"
# {"status":"processing","total_photos":1000,"succeeded":990,"failed":3,"pending":7}
curl -s "$B/v1/batches/<batch_id>/photos?limit=500" -H "$AUTH"
# {"photos":[{"external_id":"1","photo_index":0,"status":"succeeded","face_count":2}],"has_more":true,"next_after_index":499}
curl -s "$B/v1/batches/<batch_id>/photos?limit=500&after_index=499" -H "$AUTH"
The batch is finished when status is completed (pending is 0). Poll every 10 to 30 seconds, not in a tight loop. The photos list is the authoritative per-photo record; use it to reconcile after a webhook outage.
Webhook: each photo produces one signed POST to the registered URL.
{ "batch_id": "...", "external_id": "1", "photo_index": 0, "status": "succeeded", "charged": true,
"processed_at": "2026-07-01T10:00:00Z", "result": { "face_count": 2 } }
A failed photo has status: "failed", charged: false and an error.code such as image_fetch_failed, image_access_denied, image_corrupt or image_too_large (the polling route shows the same value as reason_code). Treat unknown codes as a generic failure. face_count: 0 with succeeded means a valid photo with no usable face.
Verify the webhook signature
| Header | Value |
|---|---|
X-SightRadar-Timestamp |
Unix seconds |
X-SightRadar-Signature |
hex(HMAC-SHA256(secret, "<timestamp>.<raw body>")) |
X-SightRadar-Idempotency-Key |
Stable per result. Delivery is at least once, so skip keys already seen. |
import hashlib, hmac, time
def verify(secret: str, timestamp: str, raw_body: bytes, signature: str) -> bool:
if abs(time.time() - int(timestamp)) > 300: # reject old deliveries
return False
expected = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)
Compute the HMAC over the raw request body, before any JSON parsing. Return 2xx only after the result is saved. The Node SDK exports verifyWebhookSignature.
Recover from failures
- Photos that failed because of the image (
image_fetch_failed,image_access_denied,image_corrupt,image_too_large): fix the URL or the file and submit them in a new batch. - Photos that failed for a temporary reason (
insufficient_credits,internal_error,retry_exhausted):POST /v1/batches/failed/requeuewith{"reason_code":"insufficient_credits","limit":500,"execute":false}returns a preview. Send{"preview_id":"...","execute":true}to run it. - Deliveries that ran out of retries:
GET /v1/webhooks/dead-letterslists them,POST /v1/webhooks/dead-letters/replayqueues them again.
Errors
400 bad body, more than 1,000 photos, or base64 in a batch. 401 bad key. 402 out of credits: top up, then requeue. 429: wait and retry. Guide: https://sightradar.com/docs/guides/batch-and-webhooks and full docs at https://sightradar.com/llms.txt
Examples
Prompt
I have 800 photo URLs from our recent event to index for face recognition. How do I start a batch indexing job and what will it cost?Output
You can submit a batch indexing job with up to 1,000 photos. For 800 photos, it will cost 800 × 62 credits = 49,600 credits, which equals $0.496. Confirm if you want to proceed. Once confirmed, make a POST request to /v1/batches with your collection ID, operation 'index', and the list of photo URLs and external IDs. Optionally, register a webhook beforehand to receive per-photo results asynchronously. After submission, you'll receive a batch_id to poll the batch status or track results via webhook.Prompt
I want to process 1500 photos for face matching against my existing collection asynchronously and receive results via webhook. How should I proceed?Output
Since 1500 photos exceed the 1000-photo limit per batch, split them into two batches (e.g., 1000 and 500 photos). Register a webhook endpoint first to receive signed callbacks for each photo result. Then, submit two POST requests to /v1/batches with 'op':'match', your collection ID, webhook_endpoint_id, and the respective photo URLs and external IDs. Each batch will return a batch_id. Monitor batch progress by polling /v1/batches/<batch_id> or rely on webhook notifications for per-photo match results. Failed photos are not charged and can be retried if needed.Explore more skills
Browse all- Senior FrontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle…
- UI Design SystemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens…
- Founder ConsumerThe consumer panel. Spins up a swarm of buyer sub-agents (default 100, --quick for 20) trained on the user's target…
- Frontend DesignGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with…
- Senior BackendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load…
- Self Improving AgentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its…
Security
Reviews (0)
Frequently asked questions about face-batch-indexing
What does the face-batch-indexing skill do?
Index or match thousands of photos in bulk with the SightRadar face recognition batch API and signed webhooks. Use when the user wants to load a large gallery, event or photo archive for face search, process photo URLs asynchronously, receive per-photo results on a webhook, verify webhook signatures, poll batch status, or retry failed photos. 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-batch-indexing skill?
Run `npx @skills-hub-ai/cli install face-batch-indexing` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/face-batch-indexing/ 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-batch-indexing work with?
face-batch-indexing 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-batch-indexing 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-batch-indexing after installing it?
In Claude Code, type `/face-batch-indexing` (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-batch-indexing 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.
[](https://skills-hub.ai/skills/face-batch-indexing)<a href="https://skills-hub.ai/skills/face-batch-indexing"><img src="https://skills-hub.ai/api/badges/skill/face-batch-indexing" alt="Install on Skills Hub"></a>More options in the badge docs.