Body Scan API
Reference
The WorkoutX Body Scan API provides photo-based body composition analysis for fitness apps, telehealth platforms, and health tools. Send a single photo and receive body fat percentage, muscle score, body type, posture analysis, and estimated measurements — all as structured JSON.
amused-mercy-production-aeaa.up.railway.app
v1
JSON
X-BodyScan-Key
# Analyze a body photo curl -X POST 'https://amused-mercy-production-aeaa.up.railway.app/v1/analyze' \ -H "X-BodyScan-Key: bsk_your_key_here" \ -F "front_photo=@/path/to/photo.jpg" \ -F "height_cm=178" \ -F "weight_kg=80" \ -F "age=28" \ -F "gender=male"
Authentication
All Body Scan API requests require a X-BodyScan-Key header.
Get your key from the Developer Portal after purchasing a credit pack.
curl -X POST 'https://amused-mercy-production-aeaa.up.railway.app/v1/analyze' \ -H "X-BodyScan-Key: bsk_your_key_here" \ ...
bsk_ — different from WorkoutX Exercise API keys (wx_). Each key belongs to a separate account.
/v1/analyze
Analyze Body Photo
The core endpoint. Send a photo with biometric data, receive full body composition analysis as JSON. Consumes 1 credit per successful call.
Always send a side photo when you can
A single front photo is a 2D estimate, so the underlying analysis methods can disagree with each other — that's why front-only scans return a body_fat_range (e.g. 13.1–16.1%, medium confidence) instead of one number. Adding side_photo gives the engine real depth/circumference data — the methods converge tightly, the margin narrows to ~±2%, and you get back a single precise body_fat_percentage instead. We'd rather show you an honest range than fake precision — but a 10-second second photo gets you the precise number.
Request
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
front_photo |
file | required | Front-facing full-body photo. JPEG, PNG, or WebP. Max 15MB. |
height_cm |
number | required | Height in centimetres. Range: 100–250. |
weight_kg |
number | required | Weight in kilograms. Range: 30–300. |
age |
integer | required | Age in years. Range: 13–100. |
gender |
string | required | male or female |
side_photo |
file | optional | Side-facing photo. Enables 3D circumference calculation, narrows the body fat margin to ~±2%, and returns a single precise body_fat_percentage instead of a body_fat_range — we strongly recommend including it. |
goal |
string | optional | fat_loss · muscle_gain · maintenance · general. Personalises AI insights. |
external_user_id |
string | optional | Your app's user ID. Stored with the scan for history and progress tracking. |
Response
{ "scan_id": "bscan_7xK9mP", "body_composition": { "body_fat_percentage": 14.6, "body_fat_category": "Fitness", "body_fat_mass_kg": 9.9, "lean_mass_kg": 58.1, "body_type": "Ecto-Mesomorph", "bmi": 21.0, "bmi_category": "Normal", "body_fat_range": { // front-photo-only scans — omitted when you also send side_photo "low": 13.1, "high": 16.1, "confidence": "medium", // "high" | "medium" | "low" "note": "Single-photo estimates vary by analysis method — this range reflects that. Add a side photo for a single precise number." } }, "scores": { "muscle_score": 53, "symmetry_score": 99.0, "fitness_score": 80 }, "estimated_measurements": { "shoulder_width_cm": 44.2, "waist_circumference_cm": 78.5, "hip_circumference_cm": 91.2, "waist_to_hip_ratio": 0.86 }, "ai_insights": { "body_type_detail": "Athletic frame with good muscle-building potential.", "posture_notes": "Neutral posture, shoulders level.", "fat_distribution": "balanced", "muscle_definition_score": 7 }, "photo_guidance": null, // non-null if clothing/pose issues detected "credits": { "used": 1, "remaining": 499 }, "meta": { "formula_version": "v1.0", "overall_confidence": 0.87, "processing_ms": 2731, "disclaimer": "Estimates only. ±3-5% margin for body fat." }, "created_at": "2025-06-03T10:00:00Z" }
Code Examples
const form = new FormData(); form.append('front_photo', photoFile); form.append('height_cm', '178'); form.append('weight_kg', '80'); form.append('age', '28'); form.append('gender', 'male'); const res = await fetch('https://amused-mercy-production-aeaa.up.railway.app/v1/analyze', { method: 'POST', headers: { 'X-BodyScan-Key': 'bsk_your_key_here' }, body: form }); const data = await res.json(); console.log(data.body_composition.body_fat_percentage); // 14.6
import requests files = {'front_photo': open('photo.jpg', 'rb')} data = { 'height_cm': '178', 'weight_kg': '80', 'age': '28', 'gender': 'male' } r = requests.post( 'https://amused-mercy-production-aeaa.up.railway.app/v1/analyze', headers={'X-BodyScan-Key': 'bsk_your_key_here'}, files=files, data=data ) print(r.json()['body_composition']['body_fat_percentage'])
/v1/:scanId/feedback
Submit Feedback
Submit your actual measured body fat percentage to help calibrate the AI model. High-quality feedback (DEXA, hydrostatic, caliper) earns +3 bonus scan credits.
| Field | Type | Description |
|---|---|---|
actual_body_fat | number | Actual body fat %. Used to calibrate formula weights. |
actual_weight_kg | number | Optional weight verification. |
feedback_type | string | dexa · hydrostatic · caliper → +3 credits · scale · self_estimate → no bonus |
curl -X POST 'https://amused-mercy-production-aeaa.up.railway.app/v1/bscan_7xK9mP/feedback' \ -H "X-BodyScan-Key: bsk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"actual_body_fat": 13.8, "feedback_type": "dexa"}' // Response { "status": "accepted", "bonus_credits": 3, "new_balance": 502 }
/v1/history
Scan History
Returns past scans for your account. Filter by external_user_id to get history for a specific end-user in your app.
curl 'https://amused-mercy-production-aeaa.up.railway.app/v1/history?external_user_id=usr_123&limit=10' \ -H "X-BodyScan-Key: bsk_your_key_here" // Response { "scans": [ { "id": "bscan_7xK9mP", "body_fat_pct": 14.6, "muscle_score": 53, "body_type": "Ecto-Mesomorph", "created_at": "2025-06-03T10:00:00Z" } ] }
/v1/progress
Progress Comparison
Compare two scans to show a user's progress. Returns body fat change, muscle score change, weight change, and a trend summary.
curl 'https://amused-mercy-production-aeaa.up.railway.app/v1/progress?from_scan_id=bscan_abc&to_scan_id=bscan_xyz' \ -H "X-BodyScan-Key: bsk_your_key_here" // Response { "period_days": 30, "changes": { "body_fat_change": -2.1, "muscle_score_change": +4, "weight_change_kg": -1.5 }, "trend": "positive", "summary": "In 30 days: Lost 2.1% body fat, muscle score improved by 4 points." }
Credits & Billing
Body Scan API uses a one-time credit pack system. No subscriptions. Credits never expire.
Each successful POST /analyze call consumes 1 credit.
/v1/billing/packs
— List all available credit packs
{ "packs": [ { "id": "trial", "scans": 10, "price_usd": 19, "price_per_scan": 1.90 }, { "id": "starter", "scans": 100, "price_usd": 199, "price_per_scan": 1.99 }, { "id": "growth", "scans": 500, "price_usd": 899, "price_per_scan": 1.80 }, { "id": "scale", "scans": 1000, "price_usd": 1499, "price_per_scan": 1.499 } ] }
/v1/billing/checkout
— Create Stripe checkout session (requires JWT)
curl -X POST 'https://amused-mercy-production-aeaa.up.railway.app/v1/billing/checkout' \ -H "Authorization: Bearer jwt_token" \ -H "Content-Type: application/json" \ -d '{"pack_id": "growth"}' // Response { "checkout_url": "https://checkout.stripe.com/..." }
/v1/billing/enterprise
— Enterprise inquiry (10,000+ scans)
curl -X POST 'https://amused-mercy-production-aeaa.up.railway.app/v1/billing/enterprise' \ -H "Content-Type: application/json" \ -d '{"email":"dev@company.com","company":"FitApp","volume":"50000"}'
Photo Guidelines
Follow these guidelines to maximise accuracy. Poor photos reduce confidence score and may disable some features.
check_circle Do
- • Stand facing directly toward the camera
- • Full body visible — head to ankles
- • Wear underwear, fitted sports gear, or swimwear
- • Arms slightly away from body
- • Good, even lighting
- • Plain or simple background
cancel Avoid
- • Loose, baggy clothing (inflates waist measurement)
- • Side angles or tilted body
- • Cropped photos (head or feet cut off)
- • Dark or very bright lighting
- • Blurry or low-resolution photos
- • Multiple people in frame
photo_guidance object with improvement tips. Body fat is still estimated via AI vision + BMI formulas.
Credits & Pricing
One-time credit packs. No subscriptions. Credits never expire. All packs include the full feature set.
| Pack | Scans | Price | Per Scan |
|---|---|---|---|
| trial | 10 | $19 | $1.90 |
| starter | 100 | $199 | $1.99 |
| growth ★ Popular | 500 | $899 | $1.80 |
| scale | 1,000 | $1,499 | $1.499 |
| enterprise | 10,000+ | Custom | Contact Us |
Error Codes
All errors return JSON with error and message fields.
| Status | Error | Cause |
|---|---|---|
400 | Bad Request | Missing required field or invalid value (e.g. gender not "male"/"female") |
401 | Unauthorized | Missing or invalid X-BodyScan-Key header |
402 | No Credits | Credit balance is 0. Purchase a pack to continue. |
409 | Trial Already Used | Trial pack can only be purchased once per account |
422 | Unprocessable | No person detected in photo, or body landmarks not visible enough |
503 | Service Unavailable | Scan engine temporarily unavailable. Retry after a few seconds. |
WorkoutX API
Reference
The WorkoutX API provides programmatic access to 1,400+ exercises complete with GIF animations, body part filters, target muscle data, equipment types, step-by-step instructions, and secondary muscle information.
health_and_safety
Joint & Rehab Metadata is here — every exercise now ships with derived joint_focus, intensity_level, and movement_tags fields, and Ultra plan keys can filter /v1/exercises/search directly by joint, intensity, and movement tag. Built for physical therapy, rehab, mobility, and senior-fitness apps.
api.workoutxapp.com
v1
JSON
API Key
# Fetch 5 exercises using your API key curl 'https://api.workoutxapp.com/v1/exercises?limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Authentication
All API requests require authentication via an API key. You can pass your key in one of two ways.
HTTP Header (Recommended)
Send the key as a request header. This is the preferred method as it keeps the key out of server logs.
curl 'https://api.workoutxapp.com/v1/exercises' \ -H "X-WorkoutX-Key: wx_your_key_here"
Query Parameter
Append the key as a query string parameter. Convenient for quick tests.
curl 'https://api.workoutxapp.com/v1/exercises?api-key=wx_your_key_here'
Don't have an API key?
Register for a free account on the Developer Portal to get your key instantly. Free tier includes 500 requests per month.
Endpoints
All endpoints are prefixed with https://api.workoutxapp.com/v1. All responses are JSON.
/v1/exercises
List all exercises with pagination. Returns an array of exercise objects based on your plan's limit.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Default: 10. Max depends on plan. |
offset |
integer | No | Default: 0. Number of results to skip. |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises?limit=2&offset=0' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[
{
"id": "0001",
"name": "3/4 sit-up",
"bodyPart": "waist",
"target": "abs",
"equipment": "body weight",
"gifUrl": "https://[supabase-url]/storage/v1/object/public/exercise-gifs/0001.gif",
"instructions": ["Lie down on your back..."],
"secondaryMuscles": ["hip flexors", "lower back"]
},
// ...
]
/v1/exercises/exercise/:id
Get a single exercise by its unique ID. Returns a single exercise object or a 404 if the ID does not exist.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Exercise ID string, e.g. "0001" |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/exercise/0001' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
{
"id": "0001",
"name": "3/4 sit-up",
"bodyPart": "waist",
"target": "abs",
"equipment": "body weight",
"gifUrl": "https://[supabase-url]/storage/v1/object/public/exercise-gifs/0001.gif",
"instructions": [
"Lie down on your back with your knees bent and feet flat on the floor.",
"Place your hands behind your head or across your chest.",
"Slowly lift your upper body until you are about three-quarters of the way up.",
"Lower yourself back down with control."
],
"secondaryMuscles": ["hip flexors", "lower back"]
}
/v1/exercises/bodyPart/:bodyPart
Filter exercises by body part. Returns a paginated array of matching exercises.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bodyPart |
string (path) | Yes | One of: back, cardio, chest, lower arms, lower legs, neck, shoulders, upper arms, upper legs, waist |
limit |
integer (query) | No | Default: 10. Max depends on plan. |
offset |
integer (query) | No | Default: 0. |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/bodyPart/chest?limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[
{
"id": "0009",
"name": "barbell bench press",
"bodyPart": "chest",
"target": "pectorals",
"equipment": "barbell",
"gifUrl": "https://[supabase-url]/storage/v1/object/public/exercise-gifs/0009.gif",
"secondaryMuscles": ["triceps", "delts"]
},
// ...
]
/v1/exercises/target/:target
Filter exercises by target muscle group. Returns a paginated array of matching exercises.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
target |
string (path) | Yes | e.g. abs, biceps, calves, cardiovascular system, delts, forearms, glutes, hamstrings, lats, pectorals, quads, traps, triceps, upper back |
limit |
integer (query) | No | Default: 10. Max depends on plan. |
offset |
integer (query) | No | Default: 0. |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/target/biceps?limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[
{
"id": "0023",
"name": "barbell curl",
"bodyPart": "upper arms",
"target": "biceps",
"equipment": "barbell",
"secondaryMuscles": ["forearms"]
},
// ...
]
/v1/exercises/equipment/:equipment
Filter exercises by the equipment required. Returns a paginated array of matching exercises.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
equipment |
string (path) | Yes | e.g. barbell, body weight, cable, dumbbell, kettlebell, resistance band, smith machine, and more |
limit |
integer (query) | No | Default: 10. Max depends on plan. |
offset |
integer (query) | No | Default: 0. |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/equipment/dumbbell?limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[
{
"id": "0042",
"name": "dumbbell bicep curl",
"bodyPart": "upper arms",
"target": "biceps",
"equipment": "dumbbell",
"secondaryMuscles": ["forearms"]
},
// ...
]
/v1/exercises/name/:name
Search exercises by name using partial string matching. Useful for autocomplete or free-text search features.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name |
string (path) | Yes | Partial name string. Case-insensitive match. |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/name/squat' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[
{
"id": "0201",
"name": "barbell squat",
"bodyPart": "upper legs",
"target": "quads",
"equipment": "barbell"
},
{
"id": "0202",
"name": "goblet squat",
"bodyPart": "upper legs",
"target": "quads",
"equipment": "kettlebell"
},
// ...
]
/v1/exercises/search
Basic+
Multi-filter search allowing you to combine body part, target muscle, equipment type, and name in a single query. Available on Basic plan and above.
This endpoint requires a Basic plan or higher. Free plan users will receive a 403 error.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bodyPart |
string | No | Filter by body part. |
target |
string | No | Filter by target muscle. |
equipment |
string | No | Filter by equipment. |
name |
string | No | Partial name search. |
jointFocus
Ultra
|
string | No | Filter by the derived primary joint a movement acts through (e.g. knee, shoulder, lumbar_spine). Part of Joint & Rehab Metadata — Ultra plan. |
intensityLevel
Ultra
|
string | No | Filter by derived overall-exertion band: gentle, moderate, or vigorous (computed from MET). Joint & Rehab Metadata — Ultra plan. |
movementTag
Ultra
|
string | No | Filter by a derived descriptive tag — e.g. joint-friendly, beginner-friendly, controlled-movement, low-intensity, minimal-equipment. Joint & Rehab Metadata — Ultra plan. |
limit |
integer | No | Default: 10. Max depends on plan. |
offset |
integer | No | Default: 0. |
Joint & Rehab Metadata (Ultra): every exercise record also ships with derived joint_focus, intensity_level, and movement_tags fields — computed from existing attributes (target muscle, difficulty, mechanic, MET). Ultra plan keys can filter directly on these via jointFocus, intensityLevel, and movementTag — handy for physical therapy, mobility, and senior-fitness style "gentle movement" shortlists. These are descriptive, anatomical/biomechanical fields, not medical or clinical recommendations — see our guide for details and examples.
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/search?bodyPart=chest&equipment=barbell&limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example: Joint & Rehab Metadata Query Ultra
A "gentle movements" shortlist for the knee — beginner-level, single-joint, joint-friendly:
curl 'https://api.workoutxapp.com/v1/exercises/search?jointFocus=knee&effortLevel=beginner&movementTag=joint-friendly&limit=5' \ -H "X-WorkoutX-Key: wx_your_ultra_key_here"
Example Response
[
{
"id": "0009",
"name": "barbell bench press",
"bodyPart": "chest",
"target": "pectorals",
"equipment": "barbell",
"secondaryMuscles": ["triceps", "delts"]
},
// ...
]
/v1/exercises/bodyPartList
Get the complete list of all available body parts. Useful for populating filter dropdowns in your UI.
No parameters required. Returns a simple array of strings.
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/bodyPartList' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[ "back", "cardio", "chest", "lower arms", "lower legs", "neck", "shoulders", "upper arms", "upper legs", "waist" ]
/v1/exercises/targetList
Get the complete list of all target muscles in the database. Use these values with the /target/:target endpoint.
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/targetList' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[ "abs", "biceps", "calves", "cardiovascular system", "delts", "forearms", "glutes", "hamstrings", "lats", "pectorals", "quads", "serratus anterior", "spine", "traps", "triceps", "upper back" ]
/v1/exercises/equipmentList
Get the complete list of all equipment types in the database. Use these values with the /equipment/:equipment endpoint.
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/equipmentList' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
[ "barbell", "body weight", "cable", "dumbbell", "ez barbell", "kettlebell", "leverage machine", "medicine ball", "olympic barbell", "resistance band", "roller", "rope", "skierg machine", "sled machine", "smith machine", "stability ball", "stationary bike", "stepmill machine", "tire", "trap bar", "upper body ergometer", "weighted", "wheel roller" ]
/v1/exercises/:id/similar
Smart ✨
Returns exercises similar to the given one, ranked by shared target muscle, body part, mechanics, force type, secondary muscles, and effort level. Each result includes a similarityScore (higher = more similar). Perfect for "you might also like" recommendations.
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Number of similar exercises to return |
offset | integer | 0 | Pagination offset |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/0025/similar?limit=5' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
{
"total": 312,
"count": 5,
"data": [
{
"id": "3294",
"name": "Archer Push Up",
"target": "Pectorals",
"equipment": "Body Weight",
"similarityScore": 115
}
]
}
/v1/exercises/:id/alternatives
Smart ✨
Find exercises that hit the same target muscle but use different equipment. Perfect for "I don't have a barbell at home" or "what can I do at the gym instead?" scenarios. Each result includes an alternativeScore.
Query Parameters
| Name | Type | Description |
|---|---|---|
equipment | string | Prefer alternatives using this equipment (e.g. dumbbell) |
excludeEquipment | string | Exclude alternatives with this equipment (defaults to source exercise's equipment) |
limit | integer | Results per page (default 10) |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/0025/alternatives?equipment=dumbbell' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
{
"total": 48,
"count": 3,
"data": [
{
"id": "0289",
"name": "Dumbbell Bench Press",
"target": "Pectorals",
"equipment": "Dumbbell",
"alternativeScore": 115
}
]
}
/v1/exercises/:id/calories
Smart ✨
Estimate how many calories a user burns performing this exercise, scaled to their body weight. Uses MET-based formula: kcal = baseKcalPerMin × (weightKg / 70) × minutes. Every exercise in the database has a per-minute calorie value.
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
weightKg | number | 70 | User's body weight in kilograms |
minutes | number | 10 | Duration of the activity in minutes |
Example Request
curl 'https://api.workoutxapp.com/v1/exercises/0025/calories?weightKg=80&minutes=15' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
{
"id": "0025",
"name": "Barbell Bench Press",
"bodyPart": "Chest",
"target": "Pectorals",
"weightKg": 80,
"minutes": 15,
"baseKcalPerMin": 5,
"kcalPerMin": 5.71,
"totalKcal": 85.7
}
/v1/workout/generate
AI Generator
Pro & Ultra
Generate a fully structured, ready-to-use workout plan with a single API call. Pass your user's goal, available time, fitness level, and equipment — the API returns a complete session with ordered exercises, sets, reps, and rest periods. Perfect for building AI-powered fitness apps, personalized training programs, or a "Today's Workout" feature without managing any exercise logic yourself.
How the generator works
The engine filters exercises by your equipment and fitness level, then distributes them across the target muscle groups using the selected split. Compound movements are prioritized for strength/muscle gain goals; isolation movements are mixed in as accessories. Exercise count is automatically calculated to fit within your requested duration. Every call returns a freshly randomised selection — no two workouts are the same.
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
goal |
string | muscle_gain | muscle_gain · strength · fat_loss · endurance · mobility |
duration |
integer | 45 | Target workout length in minutes (20–120). Exercise count is auto-calculated to fit. |
level |
string | intermediate | beginner · intermediate · advanced |
split |
string | full_body |
Which muscle groups to train in this session.full_body · upper · lower · push · pull · legs · push_pull_legs · upper_lower · core.Ignored if bodyFocus is provided.
|
equipment |
string | — | Comma-separated list of available equipment (e.g. barbell,dumbbell). Omit to allow any equipment. |
bodyFocus |
string | — | Comma-separated body parts for full custom control (e.g. chest,back). Overrides split. |
exclude |
string | — | Comma-separated exercise IDs to exclude (e.g. exercises the user dislikes or already did today). |
Example Requests
1 — Quick full-body workout (defaults)
curl 'https://api.workoutxapp.com/v1/workout/generate' \ -H "X-WorkoutX-Key: wx_your_key_here"
2 — 30-minute beginner fat-loss session, bodyweight only
curl 'https://api.workoutxapp.com/v1/workout/generate?goal=fat_loss&duration=30&level=beginner&equipment=body+weight&split=full_body' \ -H "X-WorkoutX-Key: wx_your_key_here"
3 — Advanced push day, barbell + dumbbell, exclude specific exercises
curl 'https://api.workoutxapp.com/v1/workout/generate?goal=muscle_gain&duration=60&level=advanced&split=push&equipment=barbell,dumbbell&exclude=0025,0034' \ -H "X-WorkoutX-Key: wx_your_key_here"
Example Response
{
"goal": "muscle_gain",
"level": "intermediate",
"split": "push",
"bodyFocus": ["chest", "shoulders", "upper arms"],
"equipment": ["barbell", "dumbbell"],
"totalExercises": 5,
"estimatedDurationMinutes": 42,
"exercises": [
{
"order": 1,
"sets": 4,
"reps": "6-8",
"restSeconds": 90,
"note": "Primary compound movement",
"exercise": {
"id": "0025",
"name": "Barbell Bench Press",
"bodyPart": "Chest",
"target": "Pectorals",
"equipment": "Barbell",
"gifUrl": "https://api.workoutxapp.com/v1/gifs/0025.gif"
}
},
// ... more exercises
]
}
Split Reference
| split value | Muscle groups trained |
|---|---|
full_body | Chest, back, shoulders, legs, arms — balanced full session |
upper | Chest, back, shoulders, upper & lower arms |
lower | Quads, hamstrings, calves, lower back, core |
push | Chest, shoulders, triceps |
pull | Back, biceps, forearms |
legs | Quads, hamstrings, calves, lower back |
push_pull_legs | Full body PPL — all major groups in one session |
upper_lower | Upper body focus — chest, back, shoulders, arms |
core | Abs, lower back — targeted core session |
Use bodyFocus for fully custom muscle group selection — it overrides split.
Rate Limits
All plans are subject to both per-minute rate limits and monthly quotas. Exceeding either returns a 429 Too Many Requests response.
| Plan | Monthly Quota | Rate Limit | Max Results |
|---|---|---|---|
| Free | 500 / month | 30 / min | 10 per request |
| Basic | 3,000 / month | 150 / min | 100 per request |
| Pro | 10,000 / month | 300 / min | Unlimited |
| Ultra | 35,000 / month | 600 / min | Unlimited |
Response Headers
Every API response includes the following headers so you can monitor your usage programmatically:
| Header | Description |
|---|---|
X-WorkoutX-Plan |
Your current subscription plan name. |
X-RateLimit-Limit |
Maximum requests allowed per minute. |
X-RateLimit-Remaining |
Requests remaining in the current minute window. |
X-Quota-Limit |
Total monthly quota for your plan. |
X-Quota-Remaining |
Requests remaining in the current monthly period. |
X-Quota-Reset |
Unix timestamp of when the monthly quota resets. |
Reading Headers in Code
# Include -I to print response headers curl -sI 'https://api.workoutxapp.com/v1/exercises?limit=1' \ -H "X-WorkoutX-Key: wx_your_key_here" # Example response headers: X-WorkoutX-Plan: pro X-RateLimit-Limit: 300 X-RateLimit-Remaining: 298 X-Quota-Limit: 10000 X-Quota-Remaining: 9847 X-Quota-Reset: 1743379200
Error Codes
The API uses standard HTTP status codes. All error responses return a JSON body with a message field explaining what went wrong.
| Status Code | Error | Description |
|---|---|---|
401
|
Unauthorized | Missing or invalid API key. Verify your key is correct and included in the request. |
403
|
Forbidden | Your API key or account has been disabled, or you are accessing a feature not available on your plan. |
404
|
Not Found | The requested exercise ID does not exist in the database. |
429
|
Too Many Requests | You have exceeded your per-minute rate limit or monthly quota. Check rate limit headers for reset timing. |
Example Error Responses
// HTTP 401 Unauthorized { "error": "Unauthorized", "message": "Missing or invalid API key. Pass your key via X-WorkoutX-Key header.", "status": 401 } // HTTP 429 Too Many Requests { "error": "Too Many Requests", "message": "Monthly quota exceeded. Upgrade your plan or wait for reset.", "status": 429 } // HTTP 404 Not Found { "error": "Not Found", "message": "Exercise with ID '9999' does not exist.", "status": 404 }
Plans & Quotas
Choose a plan that matches your usage. All plans include access to the full exercise database and GIF library.
- check_circle 500 req / month
- check_circle 30 req / min
- check_circle Max 10 results
- remove_circle Multi-filter search
- check_circle 3,000 req / month
- check_circle 150 req / min
- check_circle Max 100 results
- check_circle Multi-filter search
- check_circle 10,000 req / month
- check_circle 300 req / min
- check_circle Unlimited results
- check_circle Multi-filter search
- check_circle 35,000 req / month
- check_circle 600 req / min
- check_circle Unlimited results
- check_circle Multi-filter search
- health_and_safety Joint & Rehab Metadata New
Ready to get started?
Create your account and get an API key in under a minute. Free plan, no credit card required.