What exercise data should an AI workout generator use?
Give your model exercise ids, muscles, equipment and level from exerciseapi.dev. Use one request and a prompt to get back ids your app can check and display.
Give the model a list to choose from
Give the model each record's id, equipment and level so it can choose by id from a list that fits the workout. Include primaryMuscles and secondaryMuscles, along with mechanic and force, to help it vary its picks. A name the model writes on its own might sound right but match nothing in your app. Once you've checked an id against the list, your app can show that record's instructions and safety notes.
Get a shortlist for this workout
Say a beginner wants to train their chest and has dumbbells and a bench. This request looks for strength exercises that list dumbbell as the main piece of equipment and chest as a primary muscle group.
GET https://api.exerciseapi.dev/v1/exercises?category=strength&level=beginner&equipment=dumbbell&muscle=chest&random=true&limit=10
When we ran it, the data array held 10 records, including Dumbbell_Bench_Press and Dumbbell_Chest_Fly. All 10 also need a bench. Check each record's instructions for anything else the person needs. More than 10 exercises match, so random=true can give you a different shortlist on the next call. A narrower search may return fewer than you asked for.
GET /v1/equipment lists the equipment names the API knows. Some have no exercises yet. The filter expects the exact stored value. For someone training without equipment, send equipment=body%20only. An unknown value gives you an empty list. If data is empty, loosen a filter and try again before calling the model.
Ask for ids you can check
Pass the records to the model with this prompt. It can use the muscle fields to tell the exercises apart, even when they all match chest.
Choose up to three different exercises from the supplied list. Use primaryMuscles and secondaryMuscles to vary which muscles the picks work. Use mechanic and force to vary the picks where possible. If mechanic or force is null, skip that field for that exercise. Return only a JSON array of ids copied exactly from the list.
Check that the answer is a JSON array of at most three different ids, all from the list you sent. If that check fails, ask the model to pick again from the same list.
Open the record when someone taps
Show the name in the workout. On tap, show instructions in order, with exerciseTips beside the steps and safetyInfo where the person can read it. Your model or your own rules supply the sets, reps, rest times and weights.
Try it with a free key
Get a free key from exerciseapi.dev and run the request above with your key in the X-API-Key header. For a web app, make the call from your server so the key stays there. The free tier includes 100 requests a day and up to 20 results per request. No card required.