Need to calculate ideal body weight in your health or fitness application? This guide covers everything you need to know about ideal weight calculation via API, including different formulas, use cases, and implementation examples in multiple languages.
What is Ideal Body Weight?
Ideal Body Weight (IBW) is a weight range that is considered healthy for a person based on their height and gender. Unlike BMI, IBW formulas were developed primarily for clinical use, such as drug dosing and ventilator settings.
It's important to note that IBW is a general guideline and doesn't account for muscle mass, bone density, or individual body composition.
IBW Formulas Explained
Several formulas have been developed over the years:
Devine Formula (1974)
The most commonly used formula in clinical settings. Simple and widely accepted for medication dosing.
Robinson Formula (1983)
A modification of Devine that provides slightly different results, often preferred in some clinical contexts.
Miller Formula (1983)
Another variation that tends to give lower ideal weight estimates than Devine.
Hamwi Formula (1964)
One of the oldest formulas, still used in some dietetic calculations.
Using the Ideal Weight API
TinyFn provides a simple endpoint to calculate ideal weight:
GET https://api.tinyfn.io/v1/health/ideal-weight?height=175&gender=male
Headers: X-API-Key: your-api-key
{
"ideal_weight": {
"devine": 70.5,
"robinson": 68.9,
"miller": 66.1,
"hamwi": 72.7
},
"average": 69.6,
"healthy_range": {
"min": 63.0,
"max": 76.0
},
"unit": "kg",
"height_cm": 175,
"gender": "male"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
height |
number | Height in centimeters |
gender |
string | Gender: male or female |
formula |
string | Optional: devine, robinson, miller, hamwi, or all (default) |
Code Examples
JavaScript / Node.js
const response = await fetch(
'https://api.tinyfn.io/v1/health/ideal-weight?height=175&gender=male',
{ headers: { 'X-API-Key': 'your-api-key' } }
);
const data = await response.json();
console.log(`Average ideal weight: ${data.average} kg`); // Average ideal weight: 69.6 kg
Python
import requests
response = requests.get(
'https://api.tinyfn.io/v1/health/ideal-weight',
params={'height': 175, 'gender': 'male'},
headers={'X-API-Key': 'your-api-key'}
)
data = response.json()
print(f"Healthy range: {data['healthy_range']['min']}-{data['healthy_range']['max']} kg")
cURL
curl "https://api.tinyfn.io/v1/health/ideal-weight?height=175&gender=male" \
-H "X-API-Key: your-api-key"
Common Use Cases
- Health Apps: Display target weight ranges for users
- Fitness Programs: Set realistic weight goals for clients
- Medical Software: Clinical calculations for drug dosing
- Insurance Platforms: Health risk assessments
- Nutrition Planning: Baseline for calorie and macro calculations
Best Practices
- Show ranges: Display a healthy weight range rather than a single number
- Provide context: Explain that these are estimates based on height alone
- Consider body composition: Athletes may weigh more than IBW due to muscle
- Use multiple formulas: Showing results from several formulas provides perspective
Use via MCP
Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:
{
"mcpServers": {
"tinyfn-health": {
"url": "https://api.tinyfn.io/mcp/health/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
See all health tools available via MCP in our Health MCP Tools for AI Agents guide.
Try the Ideal Weight Calculator API
Get your free API key and start calculating ideal weight in seconds.
Get Free API Key