You need an API to list the body parts your app supports so users can browse exercises by region (chest, back, shoulders, etc.). By the end of this guide, you’ll fetch that list in one call, wire it into your UI, and see how to pull related exercises and full workout sessions from the same source.
What this API gives you
The Exercise Database API on Zyla API Hub returns structured fitness data you can ship with quickly. It includes:
- A canonical list of body parts to power filters and navigation.
- Exercise alternatives with the same movement or target muscle.
- Program creation that yields a ready-to-run session (sets, reps, rest, target muscles, and media links).
- Today’s workout lookup for an existing program.
It’s commonly used for workout builders, fitness onboarding flows, coaching dashboards, and exercise discovery UIs.
Getting started on Zyla API Hub
Zyla API Hub centralizes more than 10,000 public APIs with one account, one API key, and a subscription + quota model (not pay-per-call). For the Exercise Database API, you can start a 7-day trial or a limited request quota to evaluate. There is no Free Plan; check the API page for current access options and pricing.
To begin:
- Open the Exercise Database API page and subscribe: Start 7-day trial on Exercise Database API.
- Copy your API key.
- Call endpoints using Authorization: Bearer YOUR_API_KEY.
Endpoint: List of Body Parts
Fetch the canonical set of body parts to populate dropdowns, tabs, or navigation. No parameters required.
HTTP method: GET
Request URL: https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts
curl example
curl -s -X GET "https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts" \
-H "Authorization: Bearer YOUR_API_KEY"
Real response
[
"waist",
"upper legs",
"back",
"lower legs",
"chest",
"upper arms",
"cardio",
"shoulders",
"lower arms",
"neck"
]
You’ll typically map these strings to localized labels in your app and use them as keys for filtering exercise search or routing to detail views.
Python example
This snippet fetches the list and prepares it for UI display. Replace YOUR_API_KEY before running.
import requests
API_KEY = "YOUR_API_KEY"
URL = "https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts"
resp = requests.get(URL, headers={"Authorization": f"Bearer {API_KEY}"}, timeout=20)
resp.raise_for_status()
body_parts = resp.json() # list[str]
# Example: normalize and sort for display
ui_items = [{"key": bp, "label": bp.title()} for bp in body_parts]
ui_items.sort(key=lambda x: x["label"])
print("Available body parts:")
for item in ui_items:
print(f"- {item['label']}")
Endpoint: Exercise Alternatives
Return up to 10 exercises that match the same movement; if none, they share the same target muscle. Useful for swap suggestions in a workout builder.
HTTP method: GET
Request URL: https://zylalabs.com/api/392/exercise-database-api/34184/exercise-alternatives
Parameters:
- id (number, required): 1
- equipment (string, optional): barbell
curl example
Example response
[{"bodyPart":"waist","equipment":"body weight","gifUrl":" https://zyla-marketplace.s3.amazonaws.com/api-exercise/exercise_2.gif","id":2,"name":"45\u00b0 side bend","target":"abs","videos":[{"title":"45 degree side bends","link":"https://youtu.be/pUXu_7H0y_o"},{"title":"Side Bend on 45-degree Hyper Extension - Bodyweight or Weighted","link":"https://youtu.be/IyCX-a9Lm_U"},{"title":"Dumbbell Side Bend - Core / Abs - Bodybuilding.com","link":"https://youtu.be/UUQHeBRE_Wo"}]},{"bodyPart":"waist","equipment":"body weight","gifUrl":" https://zyla-marketplace.s3.amazonaws.com/api-exercise/exercise_3.gif","id":3,"name":"air bike","target":"abs","videos":[{"title":"Air Bike - Ab Exercises - Bodybuilding.com","link":"https://youtu.be/i6mPCVUrtNk"},{"title":"Air Bike Crunches","link":"https://youtu.be/3K9hMlalr60"},{"title":"Air cycling","link":"https://youtu.be/oyXoWU8j310"}]},{"bodyPart":"waist","equipment":"body weight","gifUrl":" https://zyla-marketplace.s3.amazonaws.com/api-exercise/exercise_5.gif","id":5,"name":"alternate heel touchers","target":"abs","videos":[{"title":"Alternating Heel Touch | Bodyweight Home Workout Exercise","link":"https://youtu.be/5JyOU0smtMo"},{"title":"How To Do…
Key fields you’ll use:
- id, name: primary identifiers for your DB or UI.
- bodyPart, target: drive categorization and muscle tagging.
- equipment: gate substitutions based on available gear.
- gifUrl, videos: enhance UX with visual guidance.
Endpoint: Create Program
Start a program and get today’s session immediately. Provide a predefined routine or a goal. The response includes session metadata and exercises with sets/reps/rest.
HTTP method: POST
Request URL: https://zylalabs.com/api/392/exercise-database-api/34185/create-program
Parameters:
- request_body (string, required): {"client_id":"member-1","routine":"muscle_gain_4"}
curl example
Example response
Persist program_id and program_key for the member. Use the embedded session to render today’s plan without another request.
Endpoint: Today’s Workout
Retrieve today’s session for an existing program. Returns exercises with sets, rep ranges, and rest guidance. Use this to resume training on web or mobile after initial program creation.
HTTP method: GET
Request URL: https://zylalabs.com/api/392/exercise-database-api/34186/today-s-workout
Parameters:
- program (number, required): 1
- program_key (string, required): aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
curl example
Example response
Important fields:
- week, day_name: display context for the session.
- exercises[].sets, reps_min, reps_max, rest_seconds: core prescription for training volume and pacing.
- exercises[].weight_kg may be null initially; set after user logging.
Real-world patterns that ship fast
- Onboarding: call List of Body Parts to render selectable chips. Persist the user’s focus areas to personalize exercise suggestions.
- Swap UI: when a user taps “Swap,” call Exercise Alternatives with the current exercise id and optionally the available equipment to ensure viable replacements.
- Instant program: POST Create Program after onboarding, then show the returned session immediately. Cache program_id/program_key in the user profile.
- Daily return: on app open, call Today’s Workout with program and program_key to continue where they left off.
- Visual help: surface gifUrl or the first video link next to each exercise to reduce confusion and support proper form.
Practical implementation notes
- Authentication: send Authorization: Bearer YOUR_API_KEY on every request.
- Caching: List of Body Parts is stable. Cache for hours or days to cut latency and avoid extra calls.
- Null weights: Many strength fields start as null until a user logs load; handle gracefully and show guidance strings like “Pick a weight that lands in the rep range.”
- Media: gifUrl and videos provide quick visual references; preload the GIFs on Wi‑Fi for smoother UX.
- Subscriptions: billing is subscription + quota. First API access typically includes a 7-day trial or 50 requests for evaluation; verify specifics on the listing page before load testing.
Calling from an AI agent via MCP
If you’re orchestrating tasks with an AI coding agent, you can expose this API through Zyla’s MCP endpoint. The MCP server is available at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and works with MCP-compatible clients like Claude Code, Cursor, and Windsurf. See the docs at MCP. Once connected, your agent can invoke the same Exercise Database API endpoints with your API key securely managed by the MCP layer.
Error handling and resilience
- Input validation: for Exercise Alternatives, ensure id is a valid numeric identifier and pass equipment only when you actually intend to filter by it.
- Timeouts: use client-side timeouts (e.g., 10–20s) and retries for transient network errors.
- Graceful fallbacks: if Today’s Workout isn’t available (missing program/program_key), route users to Create Program and then proceed with the returned session.
End-to-end wiring example
Flow
- Fetch body parts once and render as tabs: waist, upper legs, back, lower legs, chest, upper arms, cardio, shoulders, lower arms, neck.
- On user selection, let them create a program (e.g., muscle_gain_4). Store program_id and program_key.
- Load today’s session and display prescriptions: sets, rep ranges, and rest.
- Offer “Swap exercise.” When tapped, call Exercise Alternatives to show compatible options, filtering by available equipment if applicable.
Security, keys, and environments
- Never hardcode YOUR_API_KEY in client apps; proxy calls through your backend or use secure environment injection in mobile builds.
- Scope configuration by environment (dev/staging/prod) so your team can test against a separate subscription quota if needed.
FAQs
-
Can I get a list of body parts without any filters?
Yes. Call GET https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts with your Authorization header. It returns an array of strings.
-
How do I find substitutes for a given exercise?
Use GET https://zylalabs.com/api/392/exercise-database-api/34184/exercise-alternatives with the required id parameter and optionally equipment to refine results.
-
How do I generate a workout plan for a user?
POST to https://zylalabs.com/api/392/exercise-database-api/34185/create-program with a request_body string containing at least client_id and routine. Persist the returned program_id and program_key.
-
How do I load the current day’s workout for an existing program?
Call GET https://zylalabs.com/api/392/exercise-database-api/34186/today-s-workout with program and program_key. You’ll receive exercises, sets, rep ranges, rest, and media.
-
What are the pricing and trial terms?
The Exercise Database API uses a subscription + quota model. The first API typically includes a 7-day trial or 50 requests to evaluate. Check the API page for current access options and pricing.
Ready to wire your UI to a reliable list of body parts and ship exercise-rich features this week? Subscribe now and get your key on the marketplace listing: Start 7-day trial on Exercise Database API.