Comece a construir seu projeto usando a API MuscleLib

URL Base

Todos os endpoints utilizam a URL base. A URL base da API MuscleLib é:

https://libapi.vercel.app/api

Primeiros Passos

Todos os Exercícios

Retorna uma lista de todos os exercícios disponíveis no banco de dados. Este endpoint suporta vários parâmetros de consulta para filtros e paginação.

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: array
    • items: object
      • _id: string
      • name: string
      • force: string
      • level: string
      • mechanic: string
      • equipment: string
      • primaryMuscles: array (items: string)
      • secondaryMuscles: array (items: object) - details not specified)
      • instructions: array (items: string)
      • category: string
      • images: array (items: string)
      • id: string

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string
      • error: string

  {
    "_id": "677471831533c77a3a55b2e0",
    "name": "3/4 Sit-Up",
    "force": "pull",
    "level": "beginner",
    "mechanic": "compound",
    "equipment": "body only",
    "primaryMuscles": [
      "abdominals"
    ],
    "secondaryMuscles": [],
    "instructions": [
      "Lie down on the floor and secure your feet"
    ],
    "category": "strength",
    "images": [
      "3_4_Sit-Up/0.jpg",
      "3_4_Sit-Up/1.jpg"
    ],
    "id": "3_4_Sit-Up"
  }              
                

  {
    "message": "Error fetching exercises.",
    "error": "Operation `exercises.distinct()` buffering timed out after 10000ms"
  }
                
Idioma

Idioma da resposta. O padrão é en. Valores suportados: en, pt.

Exemplo de Requisição:

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: array
    • items: object
      • _id: string
      • name: string
      • force: string
      • level: string
      • mechanic: string
      • equipment: string
      • primaryMuscles: array (items: string)
      • secondaryMuscles: array (items: object) - details not specified)
      • instructions: array (items: string)
      • category: string
      • images: array (items: string)
      • id: string

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string

  [
    {
      "_id": "677471841533c77a3a55b2e6",
      "name": "Advanced Kettlebell Windmill",
      "force": "push",
      "level": "intermediate",
      "mechanic": "isolation",
      "equipment": "kettlebells",
      "primaryMuscles": [
        "abdominals"
      ],
      "secondaryMuscles": [
        "glutes",
        "hamstrings",
        "shoulders"
      ],
      "instructions": [
        "Clean and press a kettlebell overhead with one arm."
      ],
      "category": "strength",
      "images": [
        "Advanced_Kettlebell_Windmill/0.jpg",
        "Advanced_Kettlebell_Windmill/1.jpg"
      ],
      "id": "Advanced_Kettlebell_Windmill"
    }             
              

  {
    "message": "Invalid language. Use 'en' or 'pt'."
  }
              
Campos

Lista de campos separados por vírgula a serem retornados. Ex.: (name,instructions).

Exemplo de Requisição:

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: object
    • items: object
      • _id: string
      • name: string
      • instructions: array (items: string)

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string

  {
    "_id": "677471841533c77a3a55b2e9",
    "name": "Alternate Hammer Curl",
    "instructions": [
      "Stand up with your torso upright and a dumbbell in each hand being held at arms length. The elbows should be close to the torso.",
      "The palms of the hands should be facing your torso. This will be your starting position."
    ]
  }         
              

  {
    "message": "The field(s) parameter(s) cannot be empty. Valid fields are: force, level, mechanic, equipment, primaryMuscles, secondaryMuscles, instructions, category, images, name."
  }
              
Página

Número da página para paginação deve ser um inteiro ≥ 1. O padrão é 1.

Exemplo de Requisição:

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: array
    • items: object
      • _id: string
      • name: string
      • force: string
      • level: string
      • mechanic: string
      • equipment: string
      • primaryMuscles: array (items: sstring)
      • secondaryMuscles: array (items: object - details not specified)
      • instructions: array (items: string)
      • category: string
      • images: array (items: string)
      • id: string

RESPONSE SCHEMA: application/json


  • type: obeject
    • properties:
      • message: string

  {
    "_id": "677471841533c77a3a55b4d4",
    "name": "One-Arm Open Palm Kettlebell Clean",
    "force": "pull",
    "level": "intermediate",
    "mechanic": "compound",
    "equipment": "kettlebells",
    "primaryMuscles": [
      "hamstrings"
    ],
    "secondaryMuscles": [
      "forearms",
      "glutes",
      "lower back",
      "quadriceps",
      "shoulders"
    ],
    "instructions": [
      "Place one kettlebell between your feet."
    ],
    "category": "strength",
    "images": [
      "One-Arm_Open_Palm_Kettlebell_Clean/0.jpg",
      "One-Arm_Open_Palm_Kettlebell_Clean/1.jpg"
    ],
    "id": "One-Arm_Open_Palm_Kettlebell_Clean",
    "__v": 0
  }           
              

  {
    "message": "parameter 'page' is invalid. use a value greater than or equal to 0."
  }
              
Limite

Número de itens por página. Deve ser um inteiro ≥ 1. O padrão é 10.

Exemplo de Requisição:

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: array
    • items: object
      • _id: string
      • name: string
      • force: string
      • level: string
      • mechanic: string
      • equipment: string
      • primaryMuscles: array
      • secondaryMuscles: array
      • instructions: array
      • category: string
      • images: array
      • id: string

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string

[
  {
    "_id": "677471841533c77a3a55b4c1",
    "name": "Bent-Over Two-Arm Long Bar Row",
    "force": "pull"
  }
]
              

{
  "message": "parameter 'limit' must be greater than 0"
}
              
Filtros Dinâmicos

Aplique filtros com base nos atributos dos exercícios. Exemplo: (level=expert&force=push&primaryMuscles=chest).

Exemplo de Requisição:

Exemplos de Resposta

RESPONSE SCHEMA: application/json


  • type: array
    • items: object
      • _id: string
      • name: string
      • force: string
      • level: string
      • mechanic: string
      • equipment: string
      • primaryMuscles: array (items: string)
      • secondaryMuscles: array (items: object - details not specified)
      • instructions: array (items: string)
      • category: string
      • images: array (items: string)
      • id: string

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string
[
  {
    "_id": "677471841533c77a3a55b4ff",
    "name": "Plyo Kettlebell Pushups",
    "force": "push",
    "level": "expert",
    "mechanic": "compound",
    "equipment": "kettlebells",
    "primaryMuscles": [
      "chest"
    ],
    "secondaryMuscles": [
      "shoulders",
      "triceps"
    ],
    "instructions": [
      "Place a kettlebell on the floor. Place yourself in a pushup position, on your toes with one hand on the ground and one hand holding the kettlebell, with your elbows extended. This will be your starting position."
    ],
    "category": "strength",
    "images": [
      "Plyo_Kettlebell_Pushups/0.jpg",
      "Plyo_Kettlebell_Pushups/1.jpg"
    ],
    "id": "Plyo_Kettlebell_Pushups",
    "__v": 0
  }
]
{
  "message": "No exercises found."
}
Buscar Imagens dos Exercícios

Este endpoint permite recuperar imagens associadas aos exercícios da API MuscleLib. Cada exercício possui suas imagens armazenadas em um diretório específico.

Exemplos de Resposta

RESPONSE SCHEMA: image/jpeg

Exercise Image Example

RESPONSE SCHEMA: application/json


  • type: object
    • properties:
      • message: string
      • availableOptions: array
        • items: string
{
  "message": "The $exerciseName provided is incorrect or does not exist in the database. Try:",
  "availableOptions": [
    "Stiff-Legged_Barbell_Deadlift"
  ]
}
Estrutura das Imagens

As imagens dos exercícios são organizadas em pastas, onde cada pasta corresponde a um exercício. Dentro de cada pasta existem duas imagens chamadas 0.jpg e 1.jpg.
Por exemplo:

  • Caminhos das imagens para o exercício "3/4 Sit-Up":
  • First Image
    0.jpg
    Second Image
    1.jpg
    https://libapi.vercel.app/api/exercises/3_4_Sit-Up/0.jpg
    https://libapi.vercel.app/api/exercises/3_4_Sit-Up/1.jpg
  • Caminhos das imagens para o exercício "Stiff-Legged_Barbell_Deadlift":
  • First Image
    0.jpg
    Second Image
    1.jpg
    https://libapi.vercel.app/api/exercises/Stiff-Legged_Barbell_Deadlift/0.jpg
    https://libapi.vercel.app/api/exercises/Stiff-Legged_Barbell_Deadlift/1.jpg