BMI Calculator

BMI Calculator API

Utilities

Calculate your body mass index in metric or imperial units, see the WHO adult category and the healthy weight range for your height, with honest notes on its limits.

Authentication

Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.

Rate Limit

120 requests per minute

Endpoints

2 endpoints available

Overview

Calculates body mass index for adults from height and weight, in metric (cm, kg) or imperial (feet, inches, pounds). Returns the BMI, its WHO adult category, and the weight range that gives a BMI of 18.5 to 24.9 at that height.

Notes

  • bmi is rounded to one decimal. The category is taken from that rounded number, so a BMI of 24.96 reads as 25.0 and is Overweight. bmiExact has more decimals.
  • For units: "metric" send heightCm and weightKg. For units: "imperial" send heightFeet, heightInches (0 up to, but not including, 12) and weightLb.
  • Heights or weights that look like a unit mistake still calculate, but add a message to warnings.
  • BMI is a screening number for adults. It is not a diagnosis, and it does not suit children, teens or pregnancy.

Categories

under (below 18.5), healthy (18.5 to 24.9), over (25.0 to 29.9), obese1 (30.0 to 34.9), obese2 (35.0 to 39.9), obese3 (40.0 and above).

Endpoints

POST
https://opentools.ca/api/v1/tools/bmi-calculator
Calculate adult BMI and its WHO category

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
units
string
Enum: metric, imperial
OptionalUnit system for the height and weight fields.Default: metric
heightCm
number
OptionalHeight in centimetres. Required for metric.
weightKg
number
OptionalWeight in kilograms. Required for metric.
heightFeet
number
OptionalWhole feet of height. Imperial only.Default: 0
heightInches
number
OptionalInches of height, 0 up to 11.99. Imperial only.Default: 0
weightLb
number
OptionalWeight in pounds. Required for imperial.

Response Example

{
  "success": true,
  "units": "metric",
  "bmi": 23.5,
  "bmiExact": 23.5294,
  "category": {
    "key": "healthy",
    "label": "Healthy weight",
    "range": "18.5 to 24.9"
  },
  "heightCm": 170,
  "weightKg": 68,
  "healthyWeightRange": {
    "bmiFrom": 18.5,
    "bmiTo": 24.9,
    "minKg": 53.47,
    "maxKg": 71.96,
    "minLb": 117.9,
    "maxLb": 158.6
  },
  "warnings": []
}

Error Codes

400
Bad Request - The fields for the chosen unit system are missing, or a value is out of range
401
Unauthorized - Missing or invalid API key
403
Forbidden - The API key is inactive or expired, or the request IP is not allowed
405
Method Not Allowed - This endpoint accepts GET and POST only
429
Too Many Requests - Rate limit exceeded (120 requests per minute per API key)
500
Internal Server Error
GET
https://opentools.ca/api/v1/tools/bmi-calculator
Calculate adult BMI and its WHO category. Same fields as the POST body, sent as query parameters.

Query Parameters

ParameterTypeRequiredDescription
units
string
Enum: metric, imperial
OptionalUnit system for the height and weight fields.Default: metric
heightCm
number
OptionalHeight in centimetres. Required for metric.
weightKg
number
OptionalWeight in kilograms. Required for metric.
heightFeet
number
OptionalWhole feet of height. Imperial only.Default: 0
heightInches
number
OptionalInches of height, 0 up to 11.99. Imperial only.Default: 0
weightLb
number
OptionalWeight in pounds. Required for imperial.

Response Example

{
  "success": true,
  "units": "metric",
  "bmi": 23.5,
  "bmiExact": 23.5294,
  "category": {
    "key": "healthy",
    "label": "Healthy weight",
    "range": "18.5 to 24.9"
  },
  "heightCm": 170,
  "weightKg": 68,
  "healthyWeightRange": {
    "bmiFrom": 18.5,
    "bmiTo": 24.9,
    "minKg": 53.47,
    "maxKg": 71.96,
    "minLb": 117.9,
    "maxLb": 158.6
  },
  "warnings": []
}

Error Codes

400
Bad Request - The fields for the chosen unit system are missing, or a value is out of range
401
Unauthorized - Missing or invalid API key
403
Forbidden - The API key is inactive or expired, or the request IP is not allowed
405
Method Not Allowed - This endpoint accepts GET and POST only
429
Too Many Requests - Rate limit exceeded (120 requests per minute per API key)
500
Internal Server Error

Code Examples

# Metric
curl -X POST https://opentools.ca/api/v1/tools/bmi-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "units": "metric",
  "heightCm": 170,
  "weightKg": 68
}'

# Imperial
curl -X POST https://opentools.ca/api/v1/tools/bmi-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "units": "imperial",
  "heightFeet": 5,
  "heightInches": 7,
  "weightLb": 150
}'

# The same request as a GET with query parameters
curl "https://opentools.ca/api/v1/tools/bmi-calculator?heightCm=170&weightKg=68" \
  -H "Authorization: Bearer YOUR_API_KEY"

Ready to get started?

Create an API key to start using the BMI Calculator API.

Rather use it in your browser? Open the BMI Calculator