# BMI & Body Composition API
> Body-composition maths as an API, computed locally and deterministically. The bmi endpoint computes the body mass index, BMI = weight/height², classifies it on the WHO scale (underweight, normal, overweight, obese) and returns the healthy weight range for the person's height. The idealweight endpoint computes the ideal body weight by the four classic formulas — Devine, Robinson, Miller and Hamwi — each a base weight plus an increment for every inch of height above five feet, and their average. The bodyfat endpoint estimates body-fat percentage by the US Navy circumference method from the neck and waist (and hip for women) and the height, classifies it from essential to high, and — given a weight — splits it into fat mass and lean mass. Everything is computed locally and deterministically, so it is instant and private. Ideal for fitness, health and wellness app developers, body-tracking and coaching tools, gym and clinic dashboards, and self-assessment apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. Estimates only, not medical advice. 3 endpoints. This is body composition; for basal metabolic rate and calories use a BMR API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/bmi-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($12/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,500,000 calls/Mo, 40 req/s

## Endpoints

### Body

#### `GET /v1/bmi` — Body mass index

**Parameters:**
- `weight` (query, required, string) — Weight (kg) Example: `80`
- `height` (query, required, string) — Height (cm) Example: `180`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bmi-api/v1/bmi?weight=80&height=180"
```

**Response:**
```json
{
    "data": {
        "bmi": 24.69,
        "note": "BMI = kg/m². WHO bands: <18.5 underweight, 18.5–24.9 normal, 25–29.9 overweight, ≥30 obese.",
        "inputs": {
            "height": 180,
            "weight": 80
        },
        "category": "normal",
        "healthy_weight_max_kg": 80.68,
        "healthy_weight_min_kg": 59.94
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:21.571Z",
        "request_id": "ba38788d-8863-4ff9-93ec-675b7b45dfa8"
    },
    "status": "ok",
    "message": "Body mass index",
    "success": true
}
```

#### `GET /v1/bodyfat` — Body-fat percentage

**Parameters:**
- `sex` (query, required, string) — male | female Example: `male`
- `height` (query, required, string) — Height (cm) Example: `180`
- `neck` (query, required, string) — Neck circumference (cm) Example: `40`
- `waist` (query, required, string) — Waist circumference (cm) Example: `90`
- `hip` (query, optional, string) — Hip circumference (cm, women)
- `weight` (query, optional, string) — Weight (kg) for fat/lean mass Example: `80`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bmi-api/v1/bodyfat?sex=male&height=180&neck=40&waist=90&weight=80"
```

**Response:**
```json
{
    "data": {
        "note": "US Navy circumference method (metric). Measurements in cm. An estimate — calipers or DEXA are more accurate.",
        "inputs": {
            "hip": null,
            "sex": "male",
            "neck": 40,
            "waist": 90,
            "height": 180
        },
        "category": "average",
        "fat_mass_kg": 14.69,
        "lean_mass_kg": 65.31,
        "body_fat_percent": 18.37
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:21.676Z",
        "request_id": "cee46a31-db3c-4ad2-adba-053b122c33ed"
    },
    "status": "ok",
    "message": "Body fat percentage",
    "success": true
}
```

#### `GET /v1/idealweight` — Ideal body weight

**Parameters:**
- `height` (query, required, string) — Height (cm) Example: `180`
- `sex` (query, required, string) — male | female Example: `male`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bmi-api/v1/idealweight?height=180&sex=male"
```

**Response:**
```json
{
    "data": {
        "note": "Classic ideal-body-weight formulas, each = base + increment per inch of height above 5 ft (152.4 cm).",
        "inputs": {
            "sex": "male",
            "height": 180
        },
        "hamwi_kg": 77.34,
        "devine_kg": 74.99,
        "miller_kg": 71.52,
        "average_kg": 74.12,
        "robinson_kg": 72.65
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:21.793Z",
        "request_id": "4b7d74a7-f5a0-4281-84f3-7a34cb08e819"
    },
    "status": "ok",
    "message": "Ideal weight",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bmi-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Weight in kg, height/girths in cm. Body-fat needs neck and waist (and hip for women). Estimates only — not medical advice.",
        "service": "bmi-api",
        "formulae": {
            "bmi": "BMI = kg/m²",
            "ideal_weight": "base + increment·(inches over 5 ft)",
            "navy_bodyfat_male": "495/(1.0324 − 0.19077·log10(waist−neck) + 0.15456·log10(height)) − 450"
        },
        "endpoints": {
            "GET /v1/bmi": "BMI = kg/m² with WHO category and the healthy weight range for the height.",
            "GET /v1/meta": "This document.",
            "GET /v1/bodyfat": "US Navy body-fat percentage from girth measurements, with lean/fat mass.",
            "GET /v1/idealweight": "Ideal body weight by the Devine, Robinson, Miller and Hamwi formulas."
        },
        "description": "Body-composition calculator: body mass index, ideal body weight (four formulas) and US Navy body-fat percentage."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:21.902Z",
        "request_id": "c5a225bf-6753-459e-a580-fb206bd38fc2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/bmi-api
OpenAPI spec: https://www.oanor.com/api/bmi-api/openapi.json
