Developer Reference

SnapMeasure API

AI-powered body measurement from photos. Post front + side images, receive 9 precise measurements in JSON.

Get API Key → Buy Credits
Overview

SnapMeasure accepts a front-facing full-body photo (plus a side photo) and returns 9 body measurements in centimetres. Before returning results, Agent 2 (our Gemini Vision quality auditor) inspects the photo and rejects poor-quality images with specific, actionable advice.

9
Body measurements returned
< 3s
Typical response time
£0.15
Per call after free trial
Authentication

All requests must include an X-API-Key header. Generate your key at /api-portal.

X-API-Key: sk_live_your_api_key_here
Trial policy: Every new API key receives 2 free calls (admin-configurable, max 5). Subsequent calls require purchased credits. Credits never expire.
POST /measure/upload

Submit body photos. Returns measurements or a photo quality error. Use multipart/form-data encoding.

Request Parameters
FieldTypeRequiredDescription
front File Required Front-facing full-body photo. JPG or PNG. Person must be fully visible head to ankle, fitted clothing, plain background, even lighting.
left_side File full shot Side-profile photo (same conditions). Improves circumference accuracy by providing depth information.
height_cm Float full shot Subject's height in centimetres (e.g. 178.5). Strongly recommended — significantly improves measurement accuracy.
curl -X POST https://snap2wear.xyz/measure/upload \ -H "X-API-Key: YOUR_API_KEY" \ -F "front=@/path/to/front_photo.jpg" \ -F "left_side=@/path/to/side_photo.jpg" \ -F "height_cm=178"
import requests response = requests.post( "https://snap2wear.xyz/measure/upload", headers={"X-API-Key": "YOUR_API_KEY"}, files={ "front": open("front_photo.jpg", "rb"), "left_side": open("side_photo.jpg", "rb"), }, data={"height_cm": 178}, ) data = response.json() if response.ok: print(data["measurements"]) else: print(data["error"], data.get("advice", ""))
const form = new FormData(); form.append("front", frontFileInput.files[0]); form.append("left_side", sideFileInput.files[0]); form.append("height_cm", 178); const res = await fetch("https://snap2wear.xyz/measure/upload", { method: "POST", headers: { "X-API-Key": "YOUR_API_KEY" }, body: form, }); const data = await res.json(); if (res.ok) { console.log(data.measurements); } else { console.error(data.error, data.advice); }
$ch = curl_init("https://snap2wear.xyz/measure/upload"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: YOUR_API_KEY"]); curl_setopt($ch, CURLOPT_POSTFIELDS, [ "front" => new CURLFile("/path/to/front.jpg"), "left_side" => new CURLFile("/path/to/side.jpg"), "height_cm" => 178, ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = json_decode(curl_exec($ch), true); print_r($response["measurements"]);
Response Schema
200 OK — Success
{ "measurements": { "shoulder_width": 44.3, // cm — shoulder point to shoulder point "chest_circumference": 98.2, // cm — around fullest part of chest "waist_circumference": 81.5, // cm — natural waist "hip_circumference": 95.0, // cm — fullest part of hips "neck_circumference": 38.6, // cm — base of neck "arm_length": 62.1, // cm — shoulder to wrist "shirt_length": 71.4, // cm — shoulder to hem "trouser_length": 103.2, // cm — waist to floor "thigh_circumference": 57.8 // cm — fullest part of upper thigh }, "scale_factor": 0.042, "user_height_cm": 178.0, "side_depth_used": true, // true if left_side was provided and improved accuracy "audit": { "pass": true, "issues": [], "advice": "" }, "api_usage": { "trial_calls_used": 1, "trial_calls_remaining": 1, "paid_credits": 0 } }
Error Responses
HTTPerror fieldWhenAction
401invalid_keyKey missing, wrong, or revokedCheck your API key
400front image requiredNo front photo in requestAdd front field
400no_person_detectedPose not detected in photoShow full body, head to ankle
402payment_requiredTrial exhausted, no creditsBuy credits at /api-portal
422photo_qualityAgent 2 flagged photo issuesRead issues + advice fields; re-upload
500libraries_unavailableAI libs not installed on serverContact support
422 Photo Quality Error
{ "error": "photo_quality", "issues": ["heavy shadow on left side", "baggy clothing hiding waist"], "advice": "Please re-upload in fitted clothing under bright, even lighting.", "measurements": { ... } // still returned for reference, but may be inaccurate }
Photo Guidelines
✓ Front Photo
  • ✓ Full body visible — head to ankle
  • ✓ Facing camera directly
  • ✓ Fitted clothing (not baggy)
  • ✓ Arms slightly away from body
  • ✓ Plain background
  • ✓ Bright, even lighting
  • ✓ JPG or PNG, max 10MB
◈ Side Photo
  • ◈ Left or right profile view
  • ◈ Full body visible
  • ◈ Same lighting conditions as front
  • ◈ Improves chest, waist & hip accuracy
  • ◈ Especially useful for larger sizes
  • ◈ Same file format restrictions
Pricing
TierCallsCostNotes
Free Trial2 per key£0.00Automatically applied to every new key
Starter10 credits£1.50£0.150/call
Growth50 credits£6.00£0.120/call — 20% off
Scale200 credits£20.00£0.100/call — 33% off
Enterprise500 credits£40.00£0.080/call — 47% off

Credits never expire. Failed calls (400/422 errors) are not charged if the failure was caused by photo quality — only successful 200 responses consume a credit.

Ready to integrate?
Get your API key and start with 2 free calls.
Get Your API Key →
✦ Snap2Wear Support & AI Agent
Hi! I'm your Snap2Wear AI Agent. I can take your measurements from body photos (📷), look up orders, reset passwords, build bespoke garment orders, and execute USDC payments. How can I help? ✦