# Health Calculator API
> A complete health & fitness calculator suite in one API: Body Mass Index with category and healthy-weight range, Basal Metabolic Rate (Mifflin-St Jeor and Harris-Benedict), Total Daily Energy Expenditure with weight-loss/gain calorie targets, macronutrient splits (balanced, low-carb, high-protein, keto, endurance) with fibre, U.S. Navy body-fat percentage, ideal body weight across four classic formulas (Devine, Robinson, Miller, Hamwi), and daily water intake. Every endpoint accepts GET query parameters or a JSON POST body and works in both metric and imperial units. All computation is done locally with established public-domain equations, so responses are instant and the service is always available. Ideal for fitness trackers, nutrition apps, telehealth and wellness dashboards.

## 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/healthcalc-api/..."
```

## Pricing
- **Free** (Free) — 500 calls/Mo, 2 req/s
- **Basic** ($4/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($12/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($35/Mo) — 2,000,000 calls/Mo, 40 req/s

## Endpoints

### Health

#### `GET /v1/bmi` — Body Mass Index + category

**Parameters:**
- `weight` (query, required, string) — Weight (kg, or lbs if imperial) Example: `80`
- `height` (query, required, string) — Height (cm, or inches if imperial) Example: `180`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

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

**Response:**
```json
{
    "data": {
        "bmi": 24.7,
        "category": "Normal",
        "height_cm": 180,
        "weight_kg": 80,
        "healthy_weight_range_kg": {
            "max": 80.7,
            "min": 59.9
        }
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.394Z",
        "request_id": "b3e5bb26-a20d-47b6-971f-d10c2eb0d1ef"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/bmr` — Basal Metabolic Rate

**Parameters:**
- `weight` (query, required, string) — Weight Example: `80`
- `height` (query, required, string) — Height Example: `180`
- `age` (query, required, string) — Age in years Example: `30`
- `gender` (query, required, string) — male or female Example: `male`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/bmr?weight=80&height=180&age=30&gender=male&unit=metric"
```

**Response:**
```json
{
    "data": {
        "bmr": 1780,
        "unit": "kcal/day",
        "inputs": {
            "age": 30,
            "gender": "male",
            "height_cm": 180,
            "weight_kg": 80
        },
        "formulas": {
            "harris_benedict": 1854,
            "mifflin_st_jeor": 1780
        }
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.549Z",
        "request_id": "47dc0e3a-c014-4610-9378-4c72de932ae0"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/body-fat` — Body-fat % (U.S. Navy)

**Parameters:**
- `gender` (query, required, string) — male or female Example: `male`
- `height` (query, required, string) — Height Example: `180`
- `neck` (query, required, string) — Neck circumference (cm/in) Example: `38`
- `waist` (query, required, string) — Waist circumference (cm/in) Example: `85`
- `hip` (query, optional, string) — Hip circumference (required for female) Example: `95`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/body-fat?gender=male&height=180&neck=38&waist=85&hip=95&unit=metric"
```

**Response:**
```json
{
    "data": {
        "gender": "male",
        "method": "U.S. Navy",
        "category": "Fitness",
        "body_fat_percent": 16.1
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.623Z",
        "request_id": "922889b3-f7a2-4764-a480-2af3856b2e45"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/ideal-weight` — Ideal body weight (4 formulas)

**Parameters:**
- `gender` (query, required, string) — male or female Example: `male`
- `height` (query, required, string) — Height Example: `180`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/ideal-weight?gender=male&height=180&unit=metric"
```

**Response:**
```json
{
    "data": {
        "gender": "male",
        "height_cm": 180,
        "ideal_weight_kg": {
            "hamwi": 77.3,
            "devine": 75,
            "miller": 71.5,
            "robinson": 72.6
        },
        "healthy_bmi_range_kg": {
            "max": 80.7,
            "min": 59.9
        }
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.703Z",
        "request_id": "e07fff32-0167-4c30-999d-e690de1310d6"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/macros` — Macronutrient split

**Parameters:**
- `calories` (query, optional, string) — Target calories (else derived from TDEE inputs) Example: `2500`
- `goal` (query, optional, string) — balanced|low_carb|high_protein|keto|endurance Example: `balanced`
- `weight` (query, optional, string) — Weight (if no calories) Example: `80`
- `height` (query, optional, string) — Height (if no calories) Example: `180`
- `age` (query, optional, string) — Age (if no calories) Example: `30`
- `gender` (query, optional, string) — Gender (if no calories) Example: `male`
- `activity` (query, optional, string) — Activity (if no calories) Example: `moderate`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/macros?calories=2500&goal=balanced&weight=80&height=180&age=30&gender=male&activity=moderate&unit=metric"
```

**Response:**
```json
{
    "data": {
        "goal": "balanced",
        "macros": {
            "fat_g": 83,
            "carbs_g": 250,
            "fiber_g": 35,
            "protein_g": 188
        },
        "calories": 2500,
        "calories_from": {
            "fat": 747,
            "carbs": 1000,
            "protein": 752
        },
        "split_percent": {
            "fat": 30,
            "carbs": 40,
            "protein": 30
        }
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.755Z",
        "request_id": "56ed4514-6811-417c-830f-48791b49b2a7"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/tdee` — Total Daily Energy Expenditure + goals

**Parameters:**
- `weight` (query, required, string) — Weight Example: `80`
- `height` (query, required, string) — Height Example: `180`
- `age` (query, required, string) — Age in years Example: `30`
- `gender` (query, required, string) — male or female Example: `male`
- `activity` (query, optional, string) — sedentary|light|moderate|active|very_active Example: `moderate`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/tdee?weight=80&height=180&age=30&gender=male&activity=moderate&unit=metric"
```

**Response:**
```json
{
    "data": {
        "bmr": 1780,
        "unit": "kcal/day",
        "goals": {
            "weight_gain": 3309,
            "weight_loss": 2209,
            "mild_weight_gain": 3034,
            "mild_weight_loss": 2484,
            "extreme_weight_loss": 1659
        },
        "activity_level": "moderate",
        "activity_factor": 1.55,
        "maintenance_calories": 2759
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.836Z",
        "request_id": "fd1b0d63-8521-4e72-9209-602cad50ca53"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/water` — Daily water intake

**Parameters:**
- `weight` (query, required, string) — Weight Example: `80`
- `activity` (query, optional, string) — Activity level Example: `moderate`
- `unit` (query, optional, string) — metric (default) or imperial Example: `metric`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/healthcalc-api/v1/water?weight=80&activity=moderate&unit=metric"
```

**Response:**
```json
{
    "data": {
        "water_ml": 2975,
        "weight_kg": 80,
        "water_liters": 2.98,
        "activity_level": "moderate"
    },
    "meta": {
        "timestamp": "2026-05-30T14:35:19.908Z",
        "request_id": "460250e0-dca6-49c6-9fcd-66309b9f4036"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```


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