curl --request GET \
--url https://api.example.com/routines{
"totalRoutines": 123,
"totalPages": 123,
"data": [
{
"id": 123,
"id_": 123,
"category": [
"<string>"
],
"routine": {
"routine_title": "<string>",
"routine_description": "<string>",
"routine_imageUrl": "<string>",
"workout_plan": [
{
"heading": "<string>",
"day_plan": "<string>"
}
],
"workout_summary": {
"MainGoal": "<string>",
"WorkoutType": "<string>",
"TrainingLevel": "<string>",
"ProgramDuration": "<string>",
"DaysPerWeek": 123,
"TimePerWorkout": "<string>",
"EquipmentRequired": "<string>",
"TargetGender": "<string>"
}
}
}
]
}Retrieve a paginated list of workout routines
curl --request GET \
--url https://api.example.com/routines{
"totalRoutines": 123,
"totalPages": 123,
"data": [
{
"id": 123,
"id_": 123,
"category": [
"<string>"
],
"routine": {
"routine_title": "<string>",
"routine_description": "<string>",
"routine_imageUrl": "<string>",
"workout_plan": [
{
"heading": "<string>",
"day_plan": "<string>"
}
],
"workout_summary": {
"MainGoal": "<string>",
"WorkoutType": "<string>",
"TrainingLevel": "<string>",
"ProgramDuration": "<string>",
"DaysPerWeek": 123,
"TimePerWorkout": "<string>",
"EquipmentRequired": "<string>",
"TargetGender": "<string>"
}
}
}
]
}GET /api/routines
Show Routine Object
Show Routine Details
Show Workout Summary
curl -X GET "https://api.bodyworks.com/api/routines?limit=10&page=1"
import axios from 'axios';
const getRoutines = async (limit = 10, page = 1) => {
const response = await axios.get('/api/routines', {
params: {
limit,
page
}
});
return response.data;
};
// Usage
const routines = await getRoutines(10, 1);
const getRoutines = async (limit = 10, page = 1) => {
const response = await fetch(
`/api/routines?limit=${limit}&page=${page}`
);
const data = await response.json();
return data;
};
// Usage
const routines = await getRoutines(10, 1);
{
"totalRoutines": 156,
"totalPages": 16,
"data": [
{
"id": 1,
"id_": 1,
"category": ["strength", "mass-building"],
"routine": {
"routine_title": "5x5 Strength Training Program",
"routine_description": "A classic strength-building program focused on compound movements. This routine is designed to build maximum strength through progressive overload on the big three lifts: squat, bench press, and deadlift.",
"routine_imageUrl": "https://cdn.bodyworks.com/routines/5x5-program.jpg",
"workout_plan": [
{
"heading": "Day 1: Workout A",
"day_plan": "Squat 5x5, Bench Press 5x5, Barbell Row 5x5"
},
{
"heading": "Day 2: Workout B",
"day_plan": "Squat 5x5, Overhead Press 5x5, Deadlift 1x5"
},
{
"heading": "Day 3: Workout A",
"day_plan": "Squat 5x5, Bench Press 5x5, Barbell Row 5x5"
}
],
"workout_summary": {
"MainGoal": "Build Strength",
"WorkoutType": "Full Body",
"TrainingLevel": "Beginner",
"ProgramDuration": "12 weeks",
"DaysPerWeek": 3,
"TimePerWorkout": "45-60 minutes",
"EquipmentRequired": "Barbell, Squat Rack, Bench",
"TargetGender": "Unisex"
}
}
}
]
}
{
"error": "Invalid pagination parameters",
"message": "Limit and page must be positive integers"
}
{
"error": "Internal server error",
"message": "Failed to fetch routines from database"
}