You have an exercise ID in your sports app and need to pull concrete training data right now: alternative movements, today’s sets and reps for a program, or a quick body-part index to drive your UI. By the end of this guide, you’ll be able to fetch exercise alternatives by ID, start a tailored program, and get today’s workout using the Exercise Database API on Zyla API Hub.
What this API gives you (and where it fits in a sports app)
The Exercise Database API provides:
- Exercise alternatives by ID, filtered to equipment when needed (great for substitution logic when certain gear isn’t available).
- Program creation that returns today’s session: exercises, sets, reps, rest, and suggested weight fields.
- Fetching today’s workout for an existing program.
- A simple list of body parts to scaffold filters or in-app navigation.
These endpoints enable quickly building substitution workflows (e.g., “show me movements like this one”), generating or refreshing daily training sessions, and presenting logical catalog groupings (by body part) — core flows in sports training apps, coaching dashboards, and fitness ecommerce experiences tied to equipment availability.
Getting started on Zyla API Hub
Open the API page, click Subscribe (or Start Free Trial if available), and get your key. Auth is via header Authorization: Bearer YOUR_API_KEY. Billing is subscription + quota (not pay-per-call). For this API, you can start with a 7-day trial from the listing page. Keep your key secure; do not commit it to source control.
You can explore thousands of production-ready sports and health integrations on Zyla API Hub, all under one account, one API key, and a consistent subscription model across categories. When you’re ready for this integration, use the direct listing link below to create an account and get your API key.
Start 7-day trial on Exercise Database API
Endpoints you’ll use
1) Exercise Alternatives (GET)
Up to 10 exercises with the same movement as the provided exercise ID. If that exercise has no movement, the API falls back to the same target muscle. You can optionally constrain results to a piece of equipment.
- Method: GET
- URL: https://zylalabs.com/api/392/exercise-database-api/34184/exercise-alternatives
- Required query param: id (number)
- Optional query param: equipment (string)
Copy-pasteable curl (Authorization header required):
curl -s -X GET "https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts" \
-H "Authorization: Bearer YOUR_API_KEY"
Official example response (verbatim):
[{"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…
What to use:
- id: the related exercise’s ID (use it to deep-link or fetch details in your app).
- name, bodyPart, target: labels for UI cards or filtering chips.
- equipment: gate alternatives to available gear in the gym or at home.
- gifUrl and videos: media to guide form and technique.
2) Create Program (POST)
Start a program and immediately get today’s session. You can set a predefined routine (e.g., muscle_gain_4 or weight_loss_3). Provide your client’s identifier in client_id to map sessions to your user object.
- Method: POST
- URL: https://zylalabs.com/api/392/exercise-database-api/34185/create-program
- Required body field: request_body (stringified JSON)
Copy-pasteable curl (note the JSON is passed as a string inside request_body):
Official example response (verbatim):
[
"waist",
"upper legs",
"back",
"lower legs",
"chest",
"upper arms",
"cardio",
"shoulders",
"lower arms",
"neck"
]
What to use:
- program_id and program_key: persist these to fetch future sessions.
- session.exercises[] fields: render today’s plan, including sets, reps_min/reps_max, rest_seconds, and weight_kg (kilograms; may be null initially).
- progression and why: show coaching prompts (e.g., what to adjust or log next).
3) Today’s Workout (GET)
Fetch today’s session for a stored program. Use the program_id and program_key you got from Create Program.
- Method: GET
- URL: https://zylalabs.com/api/392/exercise-database-api/34186/today-s-workout
- Required query params: program (number), program_key (string)
Copy-pasteable curl:
Official example response (verbatim):
What to use:
- week, deload, comeback: display training context (e.g., reduced volume weeks).
- exercises[] with sets/reps/rest: drive your session UI and tracking.
- weight_kg and estimated_1rm_kg: support load recommendations or charts when available.
4) List of Body Parts (GET)
A small utility endpoint to seed filters and navigation in your sports training UI.
- Method: GET
- URL: https://zylalabs.com/api/392/exercise-database-api/309/list-of-body-parts
OFFICIAL SAMPLE (verbatim):
Use case: render a facet menu or dropdown that matches how the API categorizes exercises, so users can filter quickly to relevant sports training content.
One working code sample (Python) for “exercise by ID” alternatives
This script calls Exercise Alternatives using an exercise ID and optional equipment filter, then prints a compact list your UI can consume. It uses the exact endpoint and fields shown above.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
BASE_URL = "https://zylalabs.com/api/392/exercise-database-api/34184/exercise-alternatives"
def get_alternatives(exercise_id, equipment=None):
params = {"id": exercise_id}
if equipment:
params["equipment"] = equipment
headers = {"Authorization": f"Bearer {API_KEY}"}
r = requests.get(BASE_URL, headers=headers, params=params, timeout=20)
r.raise_for_status()
return r.json()
if __name__ == "__main__":
# Example: alternatives for exercise id=1, filtered to barbell
data = get_alternatives(1, equipment="barbell")
# Render a minimal card summary per exercise
for ex in data:
print(f"[{ex.get('id')}] {ex.get('name')} - {ex.get('target')} ({ex.get('equipment')})")
vids = ex.get("videos", [])[:2]
for v in vids:
print(f" - {v.get('title')}: {v.get('link')}")
print()
Notes:
- Authorization is via header only: Authorization: Bearer YOUR_API_KEY.
- No paging is specified for this endpoint; it returns up to 10 items.
- gifUrl and videos are optional media fields to surface in your coaching UI.
Practical integration details that save time
- Authentication: All calls require Authorization: Bearer YOUR_API_KEY. Keep it out of client-side code if possible.
- Units: weight_kg fields are in kilograms; rest_seconds is in seconds; reps are integers with min/max fields.
- Caching: Static lists (like body parts) are good candidates for daily caching. Alternatives depend on the seed exercise and equipment; cache per (id, equipment) pair for a short TTL if your app loads this frequently during a workout session.
- Media: gifUrl and videos[].link are suitable for client display. Handle the possibility that weight_kg and estimated_1rm_kg can be null early in a new program.
- Programs: Persist both program_id and program_key. You’ll need both to fetch today’s workout reliably.
- Quotas: The hub runs on subscription + quota (not pay-per-call). For the first API, you can use a 7-day trial or 50 requests to evaluate. Check the listing for current access options and pricing.
Real-world sports app use cases
- On-the-fly substitutions: If a rack is taken, call Exercise Alternatives with the original exercise’s id and the available equipment to show 3–5 viable swaps with the same movement or target muscle.
- Programmed sessions: Kick off a new athlete’s plan with Create Program and render the returned session immediately, including sets, reps, and rest.
- Daily plan screen: Each day, fetch Today’s Workout to display the next session, respecting deload or comeback flags for context.
- Catalog filters: Use the body parts list to implement browsing filters that match the API’s taxonomy, keeping search in sync with the underlying data.
Calling the Exercise Database API from an AI agent (MCP)
You can run these endpoints from any MCP-compatible client (e.g., Claude Code, Cursor, Windsurf) by pointing the client to the MCP endpoint and providing your key.
- MCP endpoint: MCP
- Key: apikey=YOUR_API_KEY
From your agent, you can instruct it to perform a GET on the Exercise Alternatives URL with id=1 and equipment=barbell, or to POST to Create Program with the stringified request_body payload. This is useful for semi-automating coaching workflows, such as “build today’s push day and replace any barbell-only lifts with dumbbell alternatives.”
Workflow example: build a substitution-aware session
- Create a program via Create Program and store program_id and program_key in your user table.
- Call Today’s Workout each day to list exercises with sets/reps/rest.
- When the user taps “Find alternative,” call Exercise Alternatives with the source exercise’s id and the user’s current equipment (e.g., “barbell” or “body weight”).
- Swap the card in the session UI, preserving prescribed sets/reps/rest, and surface gifUrl or videos to guide the athlete.
Another quick reference: Body part taxonomy
You likely need a simple, stable taxonomy for sports training filters. Use the official “List of Body Parts” endpoint to drive your UI, as shown above. Keeping your filter options identical to the API’s list helps avoid mismatches between search inputs and exercise metadata.
Official example: curl and JSON for body parts
For completeness, here’s the official sample again in one place to copy fast during setup:
FAQ
How do I authenticate?
Send Authorization: Bearer YOUR_API_KEY on every request.
Can I get exercises similar to a specific ID?
Yes. Use Exercise Alternatives with the id query parameter, and optionally equipment to constrain results.
How do I fetch today’s workout for a user?
Create a program with Create Program to get program_id and program_key. Then call Today’s Workout with both parameters to retrieve the current session.
What units are used for weights and rest?
Weights are in kilograms (weight_kg). Rest is in seconds (rest_seconds).
Is there a free plan?
This API runs on subscription + quota with a 7-day trial available from the listing. Check the API page for current access options and pricing.
Ready to wire “exercise by ID” flows into your sports app? Create your account and start the 7-day trial on the listing page: Exercise Database API. You’ll be up and running with substitutions, programs, and daily sessions in minutes.