How do I show exercise videos in an app when only some exercises have one?
Check the videos array from exerciseapi.dev. Play the first clip if there is one. Otherwise, show the exercise name and keep the steps and form tips in view.
Choose what goes above the steps
We have clips for 333 of 2,200 exercises.
When the clip array is empty, show a plain block with the exercise name. Keep instructions and exerciseTips below it so someone can still follow the steps and check their form.
When there's a clip, use the first entry's url as the player source. The array is ordered. Filled arrays hold one entry today, and later entries may offer other angles. The MP4 links on cdn.exerciseapi.dev are public and play without a key.
Refresh the stored exercise record after 24 hours to pick up new clips. A replaced clip often keeps the same URL. Use the current link in the exercise record. When the entry's generatedAt changes, fetch the file again on the user's device if the device or browser has a temporary playback copy.
Size the player from aspectRatio
Several exercises can share one clip file. On December 2, 2026, we opened 288 distinct files with ffprobe. Of those, 278 were wide and 10 were tall. We found 229 at 16:9, 9 at 9:16 and 50 at other ratios, including 47:35 and 3:2. The aspectRatio field matched the file within 3% each time.
Set the player's CSS aspect-ratio to the result of aspectRatio.replace(":", " / "). This gives a tall clip room on a phone. Use the ratio directly because resolution can be either a label like 480p or dimensions like 854x480.
Keep playback quiet
We found an audio track in 106 files, and some had audible sound. Set muted and loop along with autoPlay and playsInline. The last setting keeps playback on the page on phones. Most loops run 4 to 5 seconds. Two ran longer, one about 7 seconds and the other about 10. Use durationSeconds for the rounded length.
Use hasVideo for a Watch screen
Leave hasVideo out when people browse. When we checked yoga that day, the total was 201. Adding hasVideo=true brought it down to 24. That's a useful list for a Watch screen.
GET https://api.exerciseapi.dev/v1/exercises?hasVideo=true&category=yoga
The default page returns the first 20 of 24. Add &offset=20 to the same request for the remaining four.
GET https://api.exerciseapi.dev/v1/exercises?hasVideo=true&category=yoga&offset=20
With a free key, offset plus limit must be 500 or less. Switch to hasVideo=false for the other 177. The total counts matches across pages, so show it only when it's a number. A text search with q always returns null for total.
Try it with a free key
Run the yoga request from your own server with a free key from exerciseapi.dev in the X-API-Key header. That keeps the key out of the browser. No card required.