Skip to main content
GET
/
routines
Get 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>"
        }
      }
    }
  ]
}

Endpoint

GET /api/routines
Retrieve a paginated list of workout routines from the BodyWorks database. Each routine includes a complete workout plan with daily schedules and workout summaries.

Query Parameters

limit
number
required
The number of routines to return per page. Controls pagination size.
page
number
required
The page number to retrieve. Used for pagination through the routine list.

Response

totalRoutines
number
The total number of routines available in the database.
totalPages
number
The total number of pages available based on the limit parameter.
data
IRoutine[]
An array of routine objects.

Example Request

curl -X GET "https://api.bodyworks.com/api/routines?limit=10&page=1"

Example Response

{
  "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 Responses

400 Bad Request
{
  "error": "Invalid pagination parameters",
  "message": "Limit and page must be positive integers"
}
500 Internal Server Error
{
  "error": "Internal server error",
  "message": "Failed to fetch routines from database"
}

Build docs developers (and LLMs) love