{
  "openapi": "3.0.3",
  "info": {
    "title": "WIMSTA Formula Registry & Calculation API",
    "version": "2026.08.11",
    "description": "A machine-readable registry of published body-composition and energy-expenditure formulas (body fat, BMI, waist-to-height ratio, maximum heart rate, basal metabolic rate). Each record gives the equation, coefficients, units, inputs, derivation sample, reported error, limitations and the primary source. Query it by URL parameter (/api/formulas?id=…, ?category=…) or download it whole (/api/registry.json). The Calculation API (/api/calc/{calculator}) returns the honest range for your own measurements, computed with the same functions as the wimsta.com calculators. No authentication, no API key, open CORS. Results are estimates for general information, not medical advice. Data licensed CC BY 4.0 - credit \"WIMSTA (wimsta.com)\" with a link.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "name": "WIMSTA",
      "url": "https://wimsta.com/registry/",
      "email": "hello@wimsta.com"
    },
    "x-logo": {
      "url": "https://wimsta.com/wimsta-icon-512.png"
    }
  },
  "externalDocs": {
    "description": "Registry documentation",
    "url": "https://wimsta.com/registry/"
  },
  "servers": [
    {
      "url": "https://wimsta.com"
    }
  ],
  "paths": {
    "/api/registry.json": {
      "get": {
        "operationId": "getRegistry",
        "summary": "Get the full formula registry",
        "description": "Returns every formula with its coefficients and primary source. Static and cacheable (Cache-Control: max-age=3600).",
        "responses": {
          "200": {
            "description": "The formula registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registry"
                }
              }
            }
          }
        },
        "tags": [
          "Registry"
        ]
      }
    },
    "/api/formulas.json": {
      "get": {
        "operationId": "listFormulas",
        "summary": "List formula ids",
        "description": "Every formula's id, name, category and the URL of its record.",
        "responses": {
          "200": {
            "description": "Formula index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registry_version": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "attribution_notice": {
                      "type": "string"
                    },
                    "formula_count": {
                      "type": "integer"
                    },
                    "formulas": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Registry"
        ]
      }
    },
    "/api/formulas/{id}.json": {
      "get": {
        "operationId": "getFormula",
        "summary": "Get one formula by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Formula id from /api/formulas.json",
            "schema": {
              "type": "string",
              "example": "cun-bae"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One formula",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registry_version": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "attribution_notice": {
                      "type": "string"
                    },
                    "formula": {
                      "$ref": "#/components/schemas/Formula"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown id"
          }
        },
        "tags": [
          "Registry"
        ]
      }
    },
    "/api/formulas": {
      "get": {
        "operationId": "queryFormulas",
        "summary": "Query the registry by id or category",
        "description": "With `id` — one formula (same body as /api/formulas/{id}.json). With `category` — all formulas of that category. Without parameters — the index of ids.",
        "tags": [
          "Registry"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Formula id",
            "schema": {
              "type": "string",
              "example": "cun-bae"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Category id",
            "schema": {
              "type": "string",
              "enum": [
                "body-fat",
                "body-fat-ranges",
                "bmi",
                "waist-to-height",
                "max-heart-rate",
                "bmr"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One formula, a category, or the index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registry_version": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "attribution_notice": {
                      "type": "string"
                    },
                    "formula": {
                      "$ref": "#/components/schemas/Formula"
                    },
                    "formulas": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc": {
      "get": {
        "operationId": "listCalculators",
        "summary": "List calculators and their parameters",
        "tags": [
          "Calculation"
        ],
        "responses": {
          "200": {
            "description": "Calculators",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/bmi": {
      "get": {
        "operationId": "calcBmi",
        "summary": "bmi",
        "description": "Body Mass Index as a range: classic (Quetelet) and Trefethen \"new BMI\", with the WHO band. Human-readable page: https://wimsta.com/bmi-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 80
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/body-fat": {
      "get": {
        "operationId": "calcBodyFat",
        "summary": "body-fat",
        "description": "Body-fat % as a range across every validated formula your measurements allow (Deurenberg, CUN-BAE, US Navy, RFM, Covert Bailey), with the Gallagher category. Human-readable page: https://wimsta.com/body-fat-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 165
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": false,
            "description": "optional, 20–350 (Deurenberg, CUN-BAE)",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 62
            }
          },
          {
            "name": "age",
            "in": "query",
            "required": false,
            "description": "optional, 18–100 (Deurenberg, CUN-BAE, Covert Bailey; age-aware category)",
            "schema": {
              "type": "number",
              "minimum": 18,
              "maximum": 100,
              "example": 35
            }
          },
          {
            "name": "waist_cm",
            "in": "query",
            "required": false,
            "description": "optional, 45–160 — natural waist (RFM; US Navy women; Covert Bailey men)",
            "schema": {
              "type": "number",
              "minimum": 45,
              "maximum": 160,
              "example": 72
            }
          },
          {
            "name": "abdomen_cm",
            "in": "query",
            "required": false,
            "description": "optional, 50–170 — at the navel (US Navy men; if absent, waist_cm is used, as on the site)",
            "schema": {
              "type": "number",
              "minimum": 50,
              "maximum": 170
            }
          },
          {
            "name": "neck_cm",
            "in": "query",
            "required": false,
            "description": "optional, 20–60 (US Navy)",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 60,
              "example": 32
            }
          },
          {
            "name": "hip_cm",
            "in": "query",
            "required": false,
            "description": "optional, 60–180 (US Navy women; Covert Bailey)",
            "schema": {
              "type": "number",
              "minimum": 60,
              "maximum": 180,
              "example": 98
            }
          },
          {
            "name": "wrist_cm",
            "in": "query",
            "required": false,
            "description": "optional, 10–25 (Covert Bailey)",
            "schema": {
              "type": "number",
              "minimum": 10,
              "maximum": 25
            }
          },
          {
            "name": "forearm_cm",
            "in": "query",
            "required": false,
            "description": "optional, 15–45 (Covert Bailey men)",
            "schema": {
              "type": "number",
              "minimum": 15,
              "maximum": 45
            }
          },
          {
            "name": "thigh_cm",
            "in": "query",
            "required": false,
            "description": "optional, 30–90 (Covert Bailey women)",
            "schema": {
              "type": "number",
              "minimum": 30,
              "maximum": 90
            }
          },
          {
            "name": "calf_cm",
            "in": "query",
            "required": false,
            "description": "optional, 20–60 (Covert Bailey women)",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/bmr": {
      "get": {
        "operationId": "calcBmr",
        "summary": "bmr",
        "description": "Basal metabolic rate (kcal/day) as a range: Mifflin–St Jeor, Harris–Benedict 1984 and 1919, WHO/FAO, plus Katch–McArdle when body_fat_pct is given. Human-readable page: https://wimsta.com/bmr-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "male"
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 80
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 180
            }
          },
          {
            "name": "age",
            "in": "query",
            "required": true,
            "description": "required, 18–100",
            "schema": {
              "type": "number",
              "minimum": 18,
              "maximum": 100,
              "example": 40
            }
          },
          {
            "name": "body_fat_pct",
            "in": "query",
            "required": false,
            "description": "optional, 3–65 (adds Katch–McArdle)",
            "schema": {
              "type": "number",
              "minimum": 3,
              "maximum": 65
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/tdee": {
      "get": {
        "operationId": "calcTdee",
        "summary": "tdee",
        "description": "Total daily energy expenditure (kcal/day) = the BMR range × an activity multiplier — a range, never one number. Human-readable page: https://wimsta.com/tdee-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 65
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 168
            }
          },
          {
            "name": "age",
            "in": "query",
            "required": true,
            "description": "required, 18–100",
            "schema": {
              "type": "number",
              "minimum": 18,
              "maximum": 100,
              "example": 35
            }
          },
          {
            "name": "activity",
            "in": "query",
            "required": true,
            "description": "required, sedentary | light | moderate | extra | extreme",
            "schema": {
              "type": "string",
              "enum": [
                "sedentary",
                "light",
                "moderate",
                "extra",
                "extreme"
              ],
              "example": "moderate"
            }
          },
          {
            "name": "body_fat_pct",
            "in": "query",
            "required": false,
            "description": "optional, 3–65 (adds Katch–McArdle)",
            "schema": {
              "type": "number",
              "minimum": 3,
              "maximum": 65
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/max-heart-rate": {
      "get": {
        "operationId": "calcMaxHeartRate",
        "summary": "max-heart-rate",
        "description": "Maximum heart rate (bpm) as a range across nine published formulas, plus five training zones (% of HRmax) from the population anchor (Gulati for women, Tanaka otherwise). Human-readable page: https://wimsta.com/target-heart-rate-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "age",
            "in": "query",
            "required": true,
            "description": "required, 18–100",
            "schema": {
              "type": "number",
              "minimum": 18,
              "maximum": 100,
              "example": 40
            }
          },
          {
            "name": "sex",
            "in": "query",
            "required": false,
            "description": "optional, female | male (default female; Gulati is women-only)",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/waist-to-height": {
      "get": {
        "operationId": "calcWaistToHeight",
        "summary": "waist-to-height",
        "description": "Waist-to-height ratio (a measurement, not an estimate) with the Ashwell zone and the healthy waist range for your height. Human-readable page: https://wimsta.com/waist-to-height-ratio-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "waist_cm",
            "in": "query",
            "required": true,
            "description": "required, 45–160",
            "schema": {
              "type": "number",
              "minimum": 45,
              "maximum": 160,
              "example": 80
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 170
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/ideal-weight": {
      "get": {
        "operationId": "calcIdealWeight",
        "summary": "ideal-weight",
        "description": "Ideal body weight as a range across seven classic formulas (Hamwi, Devine, Robinson, Miller, Broca, Lorentz, Peterson) — they disagree, and that spread is the honest answer — plus the WHO healthy-weight range (BMI 18.5–24.9). Human-readable page: https://wimsta.com/ideal-weight-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "male"
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 175
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/ffmi": {
      "get": {
        "operationId": "calcFfmi",
        "summary": "ffmi",
        "description": "Fat-Free Mass Index — lean mass for your height — raw and normalized to 1.8 m, with a neutral descriptive band (not a \"natural vs enhanced\" verdict). Needs body-fat %. Human-readable page: https://wimsta.com/ffmi-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male (band only)",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "male"
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 80
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 180
            }
          },
          {
            "name": "body_fat_pct",
            "in": "query",
            "required": true,
            "description": "required, 3–65",
            "schema": {
              "type": "number",
              "minimum": 3,
              "maximum": 65,
              "example": 15
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/bsa": {
      "get": {
        "operationId": "calcBsa",
        "summary": "bsa",
        "description": "Body surface area (m²) as a range across eight formulas (Mosteller, Du Bois, Haycock, Gehan–George, Boyd, Fujimoto, Takahira, Schlich). Human-readable page: https://wimsta.com/bsa-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male (Schlich only)",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 65
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 168
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/body-shape": {
      "get": {
        "operationId": "calcBodyShape",
        "summary": "body-shape",
        "description": "Body-shape type (hourglass, pear, inverted triangle, rectangle, apple) from bust/chest, waist and hip circumference ratios — a descriptive label, not a health verdict. Human-readable page: https://wimsta.com/body-shape-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "bust_cm",
            "in": "query",
            "required": true,
            "description": "required, 60–160 (chest for men)",
            "schema": {
              "type": "number",
              "minimum": 60,
              "maximum": 160,
              "example": 92
            }
          },
          {
            "name": "waist_cm",
            "in": "query",
            "required": true,
            "description": "required, 45–160",
            "schema": {
              "type": "number",
              "minimum": 45,
              "maximum": 160,
              "example": 70
            }
          },
          {
            "name": "hip_cm",
            "in": "query",
            "required": true,
            "description": "required, 60–180",
            "schema": {
              "type": "number",
              "minimum": 60,
              "maximum": 180,
              "example": 96
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/body-frame": {
      "get": {
        "operationId": "calcBodyFrame",
        "summary": "body-frame",
        "description": "Body-frame size (small / medium / large) from the height ÷ wrist-circumference ratio, using the widely circulated Grant cut points — a rule of thumb, not a clinical measure. Human-readable page: https://wimsta.com/body-frame-size-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          },
          {
            "name": "height_cm",
            "in": "query",
            "required": true,
            "description": "required, 100–250",
            "schema": {
              "type": "number",
              "minimum": 100,
              "maximum": 250,
              "example": 165
            }
          },
          {
            "name": "wrist_cm",
            "in": "query",
            "required": true,
            "description": "required, 10–25",
            "schema": {
              "type": "number",
              "minimum": 10,
              "maximum": 25,
              "example": 15.5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/protein": {
      "get": {
        "operationId": "calcProtein",
        "summary": "protein",
        "description": "Daily protein (g/day) as bands: RDA minimum, general active adults, deficit/muscle preservation, and — with body_fat_pct — g per kg of lean mass. The recommended range spans the preservation bands. Human-readable page: https://wimsta.com/protein-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 75
            }
          },
          {
            "name": "body_fat_pct",
            "in": "query",
            "required": false,
            "description": "optional, 3–65 (adds the lean-mass band)",
            "schema": {
              "type": "number",
              "minimum": 3,
              "maximum": 65,
              "example": 22
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/water": {
      "get": {
        "operationId": "calcWater",
        "summary": "water",
        "description": "Daily water need (ml and litres) as a range across five authorities (IOM, WHO, EFSA, FNB, sports medicine), with optional lifestyle add-ons. Includes water from food and drinks for the total-intake sources. Human-readable page: https://wimsta.com/water-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "required, female | male",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "female"
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 65
            }
          },
          {
            "name": "activity",
            "in": "query",
            "required": true,
            "description": "required, sedentary | light | active | moderate | very | extra | extreme",
            "schema": {
              "type": "string",
              "enum": [
                "sedentary",
                "light",
                "active",
                "moderate",
                "very",
                "extra",
                "extreme"
              ],
              "example": "moderate"
            }
          },
          {
            "name": "calorie_norm_kcal",
            "in": "query",
            "required": false,
            "description": "optional, 800–6000 (your daily calories; sharpens the FNB source)",
            "schema": {
              "type": "number",
              "minimum": 800,
              "maximum": 6000
            }
          },
          {
            "name": "coffee",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "alcohol",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "protein_diet",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "workouts",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean",
              "example": true
            }
          },
          {
            "name": "hot_climate",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pregnancy",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "breastfeeding",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "illness",
            "in": "query",
            "required": false,
            "description": "optional, true | false — each adds a fixed drinking-water bump",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/creatine": {
      "get": {
        "operationId": "calcCreatine",
        "summary": "creatine",
        "description": "Creatine monohydrate dose from body weight: the everyday maintenance range (g/day) and the optional loading route — a range from the ISSN position stand, not a prescription. Human-readable page: https://wimsta.com/creatine-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "weight_kg",
            "in": "query",
            "required": true,
            "description": "required, 20–350",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350,
              "example": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/one-rep-max": {
      "get": {
        "operationId": "calcOneRepMax",
        "summary": "one-rep-max",
        "description": "Estimated one-rep max as a range across four formulas (Epley, Brzycki, Lombardi, Lander), the median, and a percent-of-1RM training table. Above ~12 reps the formulas lose precision (flagged). Human-readable page: https://wimsta.com/one-rep-max-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "weight_lifted_kg",
            "in": "query",
            "required": true,
            "description": "required, 1–1000",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 1000,
              "example": 100
            }
          },
          {
            "name": "reps",
            "in": "query",
            "required": true,
            "description": "required, whole number 1–36",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 36,
              "example": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/vo2max": {
      "get": {
        "operationId": "calcVo2max",
        "summary": "vo2max",
        "description": "VO₂max (ml/kg/min) as a range across the field methods you give data for: Uth heart-rate ratio, Cooper 12-minute run, Rockport 1-mile walk. Typically ±10–15% of a lab value. Human-readable page: https://wimsta.com/vo2-max-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "hr_rest_bpm",
            "in": "query",
            "required": false,
            "description": "optional, 30–120 — Uth; needs hr_max_bpm, or age + sex (max HR then comes from the Tanaka/Gulati anchor, as on the page)",
            "schema": {
              "type": "number",
              "minimum": 30,
              "maximum": 120,
              "example": 60
            }
          },
          {
            "name": "hr_max_bpm",
            "in": "query",
            "required": false,
            "description": "optional, 120–230 — measured max HR for Uth",
            "schema": {
              "type": "number",
              "minimum": 120,
              "maximum": 230
            }
          },
          {
            "name": "cooper_m",
            "in": "query",
            "required": false,
            "description": "optional, 600–5000 — metres covered in a 12-minute run (Cooper)",
            "schema": {
              "type": "number",
              "minimum": 600,
              "maximum": 5000,
              "example": 2400
            }
          },
          {
            "name": "walk_min",
            "in": "query",
            "required": false,
            "description": "optional, 5–60 — minutes to walk 1 mile (Rockport; also needs finish_hr_bpm, weight_kg, age, sex)",
            "schema": {
              "type": "number",
              "minimum": 5,
              "maximum": 60
            }
          },
          {
            "name": "finish_hr_bpm",
            "in": "query",
            "required": false,
            "description": "optional, 50–230 — heart rate at the end of the walk (Rockport)",
            "schema": {
              "type": "number",
              "minimum": 50,
              "maximum": 230
            }
          },
          {
            "name": "weight_kg",
            "in": "query",
            "required": false,
            "description": "optional, 20–350 (Rockport)",
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 350
            }
          },
          {
            "name": "age",
            "in": "query",
            "required": false,
            "description": "optional, 18–100 (Rockport; Uth max-HR anchor)",
            "schema": {
              "type": "number",
              "minimum": 18,
              "maximum": 100,
              "example": 40
            }
          },
          {
            "name": "sex",
            "in": "query",
            "required": false,
            "description": "optional, female | male (Rockport; Uth max-HR anchor)",
            "schema": {
              "type": "string",
              "enum": [
                "female",
                "male"
              ],
              "example": "male"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/running-pace": {
      "get": {
        "operationId": "calcRunningPace",
        "summary": "running-pace",
        "description": "Running pace solver: give any two of distance, time and pace and get the third plus speed. Optionally predict a race time at another distance as a range across the Riegel 1.06–1.08 fatigue window. Human-readable page: https://wimsta.com/running-pace-calculator/",
        "tags": [
          "Calculation"
        ],
        "parameters": [
          {
            "name": "distance_km",
            "in": "query",
            "required": false,
            "description": "two of three, 0.1–1000",
            "schema": {
              "type": "number",
              "minimum": 0.1,
              "maximum": 1000,
              "example": 10
            }
          },
          {
            "name": "time_min",
            "in": "query",
            "required": false,
            "description": "two of three, 0.5–6000 (decimal minutes, e.g. 25.5)",
            "schema": {
              "type": "number",
              "minimum": 0.5,
              "maximum": 6000,
              "example": 50
            }
          },
          {
            "name": "pace_min_per_km",
            "in": "query",
            "required": false,
            "description": "two of three, 1–60 (decimal minutes per km, e.g. 5.5)",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 60
            }
          },
          {
            "name": "target_distance_km",
            "in": "query",
            "required": false,
            "description": "optional, 0.1–1000 — adds a Riegel race prediction (needs the solved run)",
            "schema": {
              "type": "number",
              "minimum": 0.1,
              "maximum": 1000,
              "example": 21.1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc/batch": {
      "post": {
        "operationId": "calcBatch",
        "summary": "batch",
        "description": "Up to 200 calculations in one request (e.g. a spreadsheet column). Each item is answered exactly like GET /api/calc/{calculator} with the same params; a bad item gets its own error in results, the batch still returns 200. Not cached.",
        "tags": [
          "Calculation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requests"
                ],
                "properties": {
                  "requests": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "calculator"
                      ],
                      "properties": {
                        "calculator": {
                          "type": "string",
                          "enum": [
                            "bmi",
                            "body-fat",
                            "bmr",
                            "tdee",
                            "max-heart-rate",
                            "waist-to-height",
                            "ideal-weight",
                            "ffmi",
                            "bsa",
                            "body-shape",
                            "body-frame",
                            "protein",
                            "water",
                            "creatine",
                            "one-rep-max",
                            "vo2max",
                            "running-pace"
                          ]
                        },
                        "params": {
                          "type": "object",
                          "description": "Query parameters of that calculator, as JSON values",
                          "additionalProperties": {
                            "oneOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "requests": [
                  {
                    "calculator": "bmi",
                    "params": {
                      "weight_kg": 70,
                      "height_cm": 175
                    }
                  },
                  {
                    "calculator": "max-heart-rate",
                    "params": {
                      "age": 40
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One entry per request, in order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "integer",
                            "description": "200, or 400/404 for that item"
                          },
                          "calculator": {
                            "type": "string"
                          },
                          "inputs": {
                            "type": "object"
                          },
                          "result": {
                            "type": "object"
                          },
                          "page_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "formulas_used": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "attribution_notice": {
                      "type": "string"
                    },
                    "registry_version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed body or more than the maximum items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Registry": {
        "type": "object",
        "required": [
          "registry_version",
          "license",
          "formulas"
        ],
        "properties": {
          "registry_version": {
            "type": "string",
            "example": "2026.08.11"
          },
          "last_updated": {
            "type": "string",
            "format": "date"
          },
          "license": {
            "type": "string",
            "example": "CC-BY-4.0"
          },
          "attribution_notice": {
            "type": "string"
          },
          "canonical_page": {
            "type": "string",
            "format": "uri"
          },
          "formula_count": {
            "type": "integer"
          },
          "formulas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Formula"
            }
          }
        }
      },
      "Formula": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "equation",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "cun-bae"
          },
          "name": {
            "type": "string",
            "example": "CUN-BAE"
          },
          "category": {
            "type": "string",
            "example": "body-fat"
          },
          "equation": {
            "type": "string",
            "description": "Human-readable equation"
          },
          "inputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "bmi",
              "age",
              "sex"
            ]
          },
          "source": {
            "type": "object",
            "properties": {
              "authors": {
                "type": "string"
              },
              "year": {
                "type": "integer"
              },
              "journal": {
                "type": "string"
              },
              "doi": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "sample": {
            "type": "object",
            "description": "Derivation sample",
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "description": "Reported error of the equation",
            "additionalProperties": true
          },
          "verification": {
            "type": "string",
            "description": "How the coefficients were checked against the source"
          },
          "independent_derivation": {
            "type": "boolean"
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "canonical_page": {
            "type": "string",
            "format": "uri"
          },
          "coefficients": {
            "type": "object",
            "description": "Coefficients keyed by term; values are numbers, or nested objects for sex-specific equations",
            "additionalProperties": true
          },
          "sex_coding": {
            "type": "string"
          },
          "units": {
            "type": "string",
            "example": "metric"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Plain-English explanation"
          }
        }
      },
      "CalcResponse": {
        "type": "object",
        "required": [
          "calculator",
          "inputs",
          "result",
          "formulas_used",
          "disclaimer",
          "attribution_notice"
        ],
        "properties": {
          "calculator": {
            "type": "string"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": true,
            "description": "The parsed inputs that were used"
          },
          "result": {
            "type": "object",
            "additionalProperties": true,
            "description": "The range (low/high), unit, category or band, and each formula's value with its registry_id"
          },
          "page_url": {
            "type": "string",
            "format": "uri",
            "description": "The wimsta.com page of this calculator — link humans here"
          },
          "formulas_used": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Registry ids of the formulas behind the result"
          },
          "formula_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "disclaimer": {
            "type": "string"
          },
          "attribution_notice": {
            "type": "string"
          },
          "registry_version": {
            "type": "string"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Registry",
      "description": "Formula registry (CC BY 4.0)"
    },
    {
      "name": "Calculation",
      "description": "Honest-range calculations from your inputs"
    }
  ]
}
