# Calorie Burn API
> Exercise calorie-burn maths as an API, computed locally and deterministically with the MET (metabolic-equivalent) method. The activity endpoint computes the calories burned by an activity, calories = MET × weight × hours, taking the MET value directly or from a named-activity table (walking, running, cycling, swimming, HIIT, rowing, yoga, weightlifting and more), and returns the calories per minute. The steps endpoint turns a step count into distance and calories: the stride is estimated from height (about 0.415 × height for walking, 0.65 for running), the distance is steps × stride, and the energy is the distance times bodyweight times a net cost of roughly 0.5 kcal/kg/km walking or 1.0 running. The duration endpoint works backwards, giving the minutes of an activity needed to burn a target number of calories. Everything is computed locally and deterministically, so it is instant and private. Ideal for fitness, activity-tracking and weight-management app developers, workout and step-counter tools, and wellness dashboards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. Estimates only. 3 endpoints. This is activity energy expenditure; for resting metabolism and TDEE 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/calorieburn-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, 20 req/s
- **Mega** ($39/Mo) — 1,508,000 calls/Mo, 60 req/s

## Endpoints

### Calorie Burn

#### `GET /v1/activity` — Activity calories

**Parameters:**
- `activity` (query, optional, string) — walking | running | cycling | swimming | hiit … Example: `running`
- `met` (query, optional, string) — Or a MET value
- `weight` (query, required, string) — Bodyweight (kg) Example: `70`
- `duration` (query, required, string) — Duration (minutes) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/calorieburn-api/v1/activity?activity=running&weight=70&duration=30"
```

**Response:**
```json
{
    "data": {
        "note": "Calories = MET × weight(kg) × hours. MET is the metabolic equivalent of the activity (1 MET ≈ resting).",
        "inputs": {
            "met": 9.8,
            "weight": 70,
            "activity": "running",
            "duration_minutes": 30
        },
        "calories_burned": 343,
        "calories_per_minute": 11.4333
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:20.252Z",
        "request_id": "db06d7eb-23ca-4cfd-b476-08d84c2e1ca0"
    },
    "status": "ok",
    "message": "Activity calories",
    "success": true
}
```

#### `GET /v1/duration` — Time to burn target

**Parameters:**
- `target_calories` (query, required, string) — Target calories to burn Example: `500`
- `activity` (query, optional, string) — Activity name Example: `running`
- `met` (query, optional, string) — Or a MET value
- `weight` (query, required, string) — Bodyweight (kg) Example: `70`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/calorieburn-api/v1/duration?target_calories=500&activity=running&weight=70"
```

**Response:**
```json
{
    "data": {
        "note": "Minutes = target ÷ (MET × weight ÷ 60). The time of this activity needed to burn the target calories.",
        "inputs": {
            "met": 9.8,
            "weight": 70,
            "activity": "running",
            "target_calories": 500
        },
        "duration_hours": 0.7289,
        "duration_minutes": 43.73,
        "calories_per_minute": 11.4333
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:20.342Z",
        "request_id": "c2f97f79-8ce2-473c-bcf3-e2f8238f326e"
    },
    "status": "ok",
    "message": "Time to burn target",
    "success": true
}
```

#### `GET /v1/steps` — Steps to calories

**Parameters:**
- `steps` (query, required, string) — Step count Example: `10000`
- `weight` (query, required, string) — Bodyweight (kg) Example: `70`
- `height` (query, optional, string) — Height (cm) to estimate stride Example: `175`
- `stride_length` (query, optional, string) — Or stride length (m)
- `mode` (query, optional, string) — walking | running (default walking) Example: `walking`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/calorieburn-api/v1/steps?steps=10000&weight=70&height=175&mode=walking"
```

**Response:**
```json
{
    "data": {
        "note": "Distance = steps × stride; stride ≈ 0.415 × height (walking), 0.65 × height (running). Calories ≈ distance·weight·(0.5 walk / 1.0 run) kcal/kg/km.",
        "inputs": {
            "mode": "walking",
            "steps": 10000,
            "weight": 70,
            "stride_length_m": 0.7262
        },
        "distance_km": 7.2625,
        "distance_miles": 4.5127,
        "calories_burned": 254.19
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:20.447Z",
        "request_id": "fec683ff-fac5-4230-8792-d77ae47e5138"
    },
    "status": "ok",
    "message": "Steps to calories",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Weight in kg, duration in minutes, height in cm. MET values from the Compendium of Physical Activities. Estimates only — actual burn varies with fitness and conditions.",
        "service": "calorieburn-api",
        "formulae": {
            "steps": "distance = steps × stride;  calories = distance·weight·(0.5/1.0)",
            "activity": "calories = MET × weight(kg) × hours",
            "duration": "minutes = target ÷ (MET × weight ÷ 60)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/steps": "Distance and calories from a step count, weight and height.",
            "GET /v1/activity": "Calories burned = MET × weight × hours, from a MET value or activity name.",
            "GET /v1/duration": "Minutes of an activity needed to burn a target number of calories."
        },
        "activities": [
            "walking",
            "brisk_walking",
            "running",
            "cycling",
            "swimming",
            "yoga",
            "weightlifting",
            "hiit",
            "rowing",
            "elliptical",
            "jumping_rope",
            "hiking",
            "dancing",
            "basketball",
            "soccer",
            "tennis",
            "stairs",
            "pilates",
            "boxing",
            "skiing"
        ],
        "description": "Exercise calorie-burn calculator (MET method): calories for an activity, calories a
…(truncated, see openapi.json for full schema)
```


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