# Heart Rate Zone API
> Heart-rate training maths as an API. The max-heart-rate endpoint estimates maximum heart rate from age by the three common formulas — Fox (220 − age), Tanaka (208 − 0.7 × age) and Gulati (206 − 0.88 × age, validated for women). The zones endpoint returns the five training zones (recovery, endurance, aerobic, threshold and maximal) as beats-per-minute ranges, computed either as a simple percentage of the maximum heart rate or, when you give a resting heart rate, by the more accurate Karvonen heart-rate-reserve method. The target endpoint computes the target heart rate for any intensity, by percentage of max or by Karvonen. You can pass an age (and choose a formula) or give your own measured max heart rate. Everything is computed locally and deterministically, so it is instant and private. Ideal for fitness and running apps, wearables and gym equipment, coaching tools, and cardio training programmes. Informational only — not medical advice. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is heart-rate maths; for BMI, BMR and calories use a health-calculator API and for running pace use a pace 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/heartrate-api/..."
```

## Pricing
- **Free** (Free) — 7,435 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 16,950 calls/Mo, 8 req/s
- **Pro** ($29/Mo) — 220,500 calls/Mo, 20 req/s
- **Mega** ($67/Mo) — 1,145,000 calls/Mo, 50 req/s

## Endpoints

### Heart Rate

#### `GET /v1/max-heart-rate` — Estimate max heart rate

**Parameters:**
- `age` (query, required, string) — Age in years Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/heartrate-api/v1/max-heart-rate?age=30"
```

**Response:**
```json
{
    "data": {
        "age": 30,
        "formulas": {
            "fox": {
                "note": "220 − age (classic, most common)",
                "value": 190
            },
            "gulati": {
                "note": "206 − 0.88 × age (validated for women)",
                "value": 180
            },
            "tanaka": {
                "note": "208 − 0.7 × age",
                "value": 187
            }
        },
        "max_heart_rate_bpm": 190
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:08.651Z",
        "request_id": "3de82ff3-b609-4f06-a86e-e481ab32fb88"
    },
    "status": "ok",
    "message": "Max heart rate",
    "success": true
}
```

#### `GET /v1/target` — Target heart rate

**Parameters:**
- `age` (query, optional, string) — Age (or max_hr) Example: `30`
- `intensity` (query, required, string) — Percent, e.g. 70 Example: `70`
- `resting_hr` (query, optional, string) — For Karvonen (optional) Example: `60`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/heartrate-api/v1/target?age=30&intensity=70&resting_hr=60"
```

**Response:**
```json
{
    "data": {
        "hrmax": 190,
        "method": "Karvonen (% heart-rate reserve)",
        "resting_hr": 60,
        "hrmax_source": "fox (age 30)",
        "intensity_percent": 70,
        "target_heart_rate_bpm": 151
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:08.764Z",
        "request_id": "ee8933a1-6d94-4360-a7cf-91027bf6d8d0"
    },
    "status": "ok",
    "message": "Target HR",
    "success": true
}
```

#### `GET /v1/zones` — Five training zones

**Parameters:**
- `age` (query, optional, string) — Age (or max_hr) Example: `30`
- `formula` (query, optional, string) — fox|tanaka|gulati Example: `fox`
- `resting_hr` (query, optional, string) — For Karvonen (optional) Example: `60`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/heartrate-api/v1/zones?age=30&formula=fox&resting_hr=60"
```

**Response:**
```json
{
    "data": {
        "hrmax": 190,
        "zones": [
            {
                "name": "Recovery",
                "zone": 1,
                "max_bpm": 138,
                "min_bpm": 125,
                "intensity": "50–60%"
            },
            {
                "name": "Endurance / fat burn",
                "zone": 2,
                "max_bpm": 151,
                "min_bpm": 138,
                "intensity": "60–70%"
            },
            {
                "name": "Aerobic",
                "zone": 3,
                "max_bpm": 164,
                "min_bpm": 151,
                "intensity": "70–80%"
            },
            {
                "name": "Threshold / anaerobic",
                "zone": 4,
                "max_bpm": 177,
                "min_bpm": 164,
                "intensity": "80–90%"
            },
            {
                "name": "Maximal / VO2 max",
                "zone": 5,
                "max_bpm": 190,
                "min_bpm": 177,
                "intensity": "90–100%"
            }
        ],
        "method": "Karvonen (% heart-rate reserve)",
        "resting_hr": 60,
        "hrmax_source": "fox (age 30)"
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:08.856Z",
        "request_id": "9c8bb944-71c8-4926-81bc-923b656898c6"
    },
    "status": "ok",
    "message": "Zones",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "Heart Rate Zone API",
        "notes": "HRmax from age by Fox/Tanaka/Gulati, or pass max_hr. With resting_hr the Karvonen (heart-rate-reserve) method is used. Informational, not medical advice. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/max-heart-rate",
                "params": {
                    "age": "years"
                },
                "returns": "estimated HRmax by the Fox, Tanaka and Gulati formulas"
            },
            {
                "path": "/v1/zones",
                "params": {
                    "age": "years (or max_hr)",
                    "formula": "fox|tanaka|gulati (default fox)",
                    "resting_hr": "for Karvonen (optional)"
                },
                "returns": "the five training zones in bpm"
            },
            {
                "path": "/v1/target",
                "params": {
                    "age": "years (or max_hr)",
                    "intensity": "percent, e.g. 70",
                    "resting_hr": "for Karvonen (optional)"
                },
                "returns": "the target heart rate"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Heart-rate training maths as an API. The max-heart-rate endpoint estimates maximum heart rate from age by the three co
…(truncated, see openapi.json for full schema)
```


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