# Ventilation & Airflow API
> Ventilation and airflow maths as an API, computed locally and deterministically. The air-changes endpoint relates the air changes per hour, the airflow in CFM and the room volume — ACH = CFM × 60 ÷ volume — and solves whichever you leave out (the volume can be given directly or as length × width × height), reporting the airflow in cubic metres per hour too. The required-cfm endpoint applies the ASHRAE 62.1 breathing-zone rule, outdoor airflow = people × Rp + floor area × Ra, with sensible office defaults (5 CFM per person and 0.06 CFM per square foot), to size the fresh-air a space needs. The duct-velocity endpoint computes the air velocity in a round or rectangular duct from the flow and the duct size, V = CFM ÷ area, in feet per minute, metres per second and miles per hour, with guidance on whether it is in the quiet residential or noisier high-velocity range. Everything is computed locally and deterministically, so it is instant and private. Ideal for HVAC, building-services, indoor-air-quality and facilities app developers, ventilation-sizing and duct-design tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is ventilation and airflow; for heating and cooling load sizing use an HVAC 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/ventilation-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 15 req/s
- **Mega** ($69/Mo) — 750,000 calls/Mo, 40 req/s

## Endpoints

### Ventilation

#### `GET /v1/air-changes` — Air changes per hour

**Parameters:**
- `volume` (query, optional, string) — Room volume (ft³) Example: `1000`
- `length` (query, optional, string) — Or length (ft)
- `width` (query, optional, string) — Width (ft)
- `height` (query, optional, string) — Height (ft)
- `cfm` (query, optional, string) — Airflow (CFM) Example: `200`
- `ach` (query, optional, string) — Air changes per hour

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ventilation-api/v1/air-changes?volume=1000&cfm=200"
```

**Response:**
```json
{
    "data": {
        "ach": 12,
        "cfm": 200,
        "note": "ACH = CFM × 60 / volume(ft³). Air changes per hour is how many times the room's air is fully replaced each hour.",
        "inputs": {
            "solved_for": "ach",
            "volume_ft3": 1000
        },
        "volume_ft3": 1000,
        "airflow_m3h": 339.8022
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:01.952Z",
        "request_id": "e54036be-e3a1-474f-885d-ef3766764616"
    },
    "status": "ok",
    "message": "Air changes",
    "success": true
}
```

#### `GET /v1/duct-velocity` — Duct velocity

**Parameters:**
- `cfm` (query, required, string) — Airflow (CFM) Example: `400`
- `diameter` (query, optional, string) — Round duct diameter (in) Example: `10`
- `width` (query, optional, string) — Or rectangular width (in)
- `height` (query, optional, string) — Rectangular height (in)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ventilation-api/v1/duct-velocity?cfm=400&diameter=10"
```

**Response:**
```json
{
    "data": {
        "note": "Velocity = CFM ÷ duct area. Round area = π(d/2)²; rectangular = w·h. Keep main ducts roughly under 1200–1500 fpm to limit noise.",
        "inputs": {
            "cfm": 400,
            "shape": "round",
            "duct_area_ft2": 0.545415
        },
        "guidance": "residential / branch ducts",
        "velocity_ms": 3.7256,
        "velocity_fpm": 733.386,
        "velocity_mph": 8.3339
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:02.059Z",
        "request_id": "ce2a264d-75ed-4e7d-b0c9-992cf75563e3"
    },
    "status": "ok",
    "message": "Duct velocity",
    "success": true
}
```

#### `GET /v1/required-cfm` — ASHRAE required CFM

**Parameters:**
- `people` (query, optional, string) — Number of occupants Example: `5`
- `area` (query, optional, string) — Floor area (ft²) Example: `500`
- `rate_per_person` (query, optional, string) — Rp (CFM/person) Example: `5`
- `rate_per_area` (query, optional, string) — Ra (CFM/ft²) Example: `0.06`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ventilation-api/v1/required-cfm?people=5&area=500&rate_per_person=5&rate_per_area=0.06"
```

**Response:**
```json
{
    "data": {
        "note": "ASHRAE 62.1: outdoor airflow = people × Rp + area × Ra. Office defaults Rp = 5 cfm/person, Ra = 0.06 cfm/ft².",
        "inputs": {
            "people": 5,
            "area_ft2": 500,
            "rate_per_area": 0.06,
            "rate_per_person": 5
        },
        "area_cfm": 30,
        "people_cfm": 25,
        "required_cfm": 55,
        "required_m3h": 93.4456
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:02.164Z",
        "request_id": "004ba6b5-7d85-4d32-bc72-72063e8d74ed"
    },
    "status": "ok",
    "message": "Required CFM",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Imperial: volume ft³, airflow CFM, area ft², duct size inches, velocity fpm (also m/s and m³/h). ASHRAE office defaults Rp = 5, Ra = 0.06.",
        "service": "ventilation-api",
        "formulae": {
            "air_changes": "ACH = CFM × 60 / volume(ft³)",
            "required_cfm": "CFM = people·Rp + area·Ra",
            "duct_velocity": "V(fpm) = CFM / area(ft²)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/air-changes": "ACH ⇄ CFM ⇄ room volume — supply any two.",
            "GET /v1/required-cfm": "ASHRAE 62.1 outdoor airflow from people and floor area.",
            "GET /v1/duct-velocity": "Air velocity in a round or rectangular duct from the flow."
        },
        "description": "Ventilation and airflow calculator: air changes per hour from flow and room volume, ASHRAE required ventilation from occupancy and area, and duct air velocity from flow and duct size."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:02.284Z",
        "request_id": "75c8dd85-20a6-4bd9-b7c5-bb60d10bdb33"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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