Passport Photo API
Compliant passport, visa & ID photos in a single API call.
198 countries · 375 document types · AI validation against 41 official government sources · SHA-256 key auth · Redis rate limiting. The only passport-photo API with deterministic, government-compliant AI.
Why integrate the HaaFoto API?
🎯 Deterministic compliance
Our proprietary AI pipeline produces the same government-compliant result every time — no hallucinatory generative AI, no guesswork. Every photo is validated against the official specs for the target country.
🌍 198 countries, one endpoint
No need to maintain a database of 375 document specifications across 198 countries. We handle the specs, the background colours, the crop ratios and the file-size limits — sourced from 41 government agencies.
⚡ Under 2 minutes
Upload to compliant JPEG in under 2 minutes. Background removal, face detection, dimension cropping and file-size optimisation all happen server-side.
🔒 Secure by design
SHA-256 hashed API keys, Redis sliding-window rate limiting, strict CSP, HSTS preload. Photos are processed and returned — not stored.
How it works
Upload a photo
POST /api/b2b/photo with the image file and target country.
AI validates + processes
AI face detection, background processing, exact-dimension crop, file-size optimisation.
Receive compliant JPEG
A government-compliant photo matching the country's official specifications.
Quick start
curl -X POST https://haafoto.com/api/b2b/photo \
-H "x-api-key: YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "country=us"Returns a compliance-validated, background-removed, correctly-cropped JPEG.
Who uses it
Visa & Immigration Services
Let applicants upload a photo and get a compliant result instantly — no manual editing.
Pharmacies & Photo Studios
Offer passport photos in-store via a kiosk or tablet without a photo booth.
Travel Agents
Bundle compliant passport/visa photos into your booking flow.
Universities
International student offices can process visa photos during enrollment.
Pricing tiers
Free
$0
10 req/min · Testing & small projects
- ✓ All endpoints
- ✓ 198 countries
- ✓ 375 document types
- ✓ Community support
Pro
Custom
100 req/min · Production apps
- ✓ Everything in Free
- ✓ Priority processing
- ✓ Email support
- ✓ Higher rate limits
Enterprise
Custom
1,000 req/min · High-volume, SLA
- ✓ Everything in Pro
- ✓ Dedicated support
- ✓ Custom SLA
- ✓ On-premise option
API endpoints
/api/b2b/photoUpload + AI-process a photo to compliant specs. Returns a compliance-validated, background-removed, correctly-cropped JPEG.
/api/b2b/specsList supported document types, sizes, background colours and requirements per market (198 countries, 375 docs).
/api/b2b/usageView your API key quota, current usage and tier limits.
Frequently asked questions
Everything you need to know.
The short answers to the questions we hear most often. Can't find what you're looking for? Our support team replies in under an hour.
We accept all major credit and debit cards (Visa, Mastercard, American Express) processed securely through Stripe, with Apple Pay and Google Pay where available. All payments are encrypted and PCI DSS compliant.