Developer guide
How can I turn workout videos into step-by-step routines?
Send a workout video to mamitsu and get every exercise back in order, with the reps, hold times, rounds and form cues the coach gives. Your app shows it as a routine people can follow.
Start with a video
Ask for the workout the way your app will show it
Pick a public workout from YouTube, TikTok, Instagram or X and send its URL to mamitsu with a prompt. mamitsu watches the coach, listens to what they say and reads the caption, so it picks up exercises that are only demonstrated and counts that are only spoken.
Add a schema with the fields your routine screen needs: the exercise name, its place in the order, reps or a hold time, and the cues for good form. Use the same schema for every video and each workout lands in your app with the same shape.
: "${XTRAKT_USER_API_KEY:?Set XTRAKT_USER_API_KEY to your mamitsu API key}"
curl https://usemamitsu.com/api/v1/extract \
-H "Authorization: Bearer $XTRAKT_USER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=umhVkAIV46A",
"prompt": "Turn this workout into a routine my app can show step by step. List every exercise in the order the creator does it, with the reps or hold time they give, how many rounds, the rest they mention, and the form cues they say out loud.",
"schema": {
"type": "object",
"properties": {
"workout_name": {
"type": "string"
},
"rounds": {
"type": [
"integer",
"null"
]
},
"rest_between_rounds_seconds": {
"type": [
"integer",
"null"
]
},
"exercises": {
"type": "array",
"items": {
"type": "object",
"properties": {
"order": {
"type": "integer"
},
"name": {
"type": "string"
},
"reps": {
"type": [
"integer",
"null"
]
},
"hold_seconds": {
"type": [
"integer",
"null"
]
},
"form_cues": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"order",
"name",
"reps",
"hold_seconds",
"form_cues"
]
}
}
},
"required": [
"workout_name",
"rounds",
"rest_between_rounds_seconds",
"exercises"
]
}
}'A real example
A five-minute core workout, as data
This is the full response for a beginner core workout on YouTube. mamitsu returns four exercises in the order the coach does them: dead bugs, bicycle crunches and plank taps at 12 reps each, then a 20-second hollow hold. It also records two rounds with a 20-second rest between them.
The form cues come straight from the coach as they move, such as “try to stack your shoulders over your hands”. These are the details people need to do an exercise well, and they are usually spoken, never written in the caption.
{
"extraction_id": "ext_34f9cf92-312b-4bef-bd17-6ec17e1c5b9c",
"data": {
"workout_name": "Beginner Friendly Core Workout",
"rounds": 2,
"rest_between_rounds_seconds": 20,
"exercises": [
{
"order": 1,
"name": "Deadbugs",
"reps": 12,
"hold_seconds": null,
"form_cues": [
"make sure your back is pressed against the mat the entire time",
"it's all about control, not speed",
"raise your legs, raise your arms",
"opposite arm and leg extend",
"make sure that back stays against the floor"
]
},
{
"order": 2,
"name": "Bicycle Crunches",
"reps": 12,
"hold_seconds": null,
"form_cues": [
"opposite elbow touches opposite knee",
"do this slow and controlled",
"back pressed against the mat",
"legs up",
"slight pause when you get to the top"
]
},
{
"order": 3,
"name": "Plank Taps",
"reps": 12,
"hold_seconds": null,
"form_cues": [
"get up on your hands and toes",
"try to stack your shoulders over your hands",
"try to keep your hips as still as possible",
"make sure you're engaging your core"
]
},
{
"order": 4,
"name": "Hollow Hold",
"reps": null,
"hold_seconds": 20,
"form_cues": [
"back pressed into mat",
"legs up",
"arms up",
"if this feels too difficult, feel free to bend your legs"
]
}
]
},
"source": {
"provider": "youtube",
"url": "https://www.youtube.com/watch?v=umhVkAIV46A"
}
}Build the routine
Turn the JSON into a routine people can follow
Each item in exercises becomes one step. Show a rep counter when reps has a value and a timer when hold_seconds does, repeat the list for each of the rounds, and start a rest timer between them.
Show the form cues under each exercise and keep the video link on the routine. The workout stays the coach's own, and people can jump back to watch a move whenever they want to see it done.
From an AI client
Ask your agent for a routine
The same request works from an AI client through the mamitsu MCP server. Share a workout link and ask for a routine; the agent calls mamitsu and gets back the exercises, ready to put in a plan, a note or a calendar.
Related guides