# Pipe Insulation API
> Pipe-insulation heat-loss maths as an API, computed locally and deterministically — the radial heat loss, thickness and energy-cost numbers a mechanical engineer or energy auditor sizes lagging with. The heat-loss endpoint gives the loss per linear foot through cylindrical insulation, Q/L = 2π·(k/12)·ΔT ÷ ln(r2/r1), where k is the insulation conductivity (BTU·in/hr·ft²·°F, ~0.25 for fibreglass), r1 the pipe radius and r2 the outer radius — a 2-inch line at 300 °F with one inch of fibreglass loses about 43 BTU/hr per foot, and because the relationship is logarithmic, doubling the thickness does not halve the loss. The thickness endpoint inverts it for a target loss: ln(r2/r1) = 2π·(k/12)·ΔT ÷ target, then thickness = r2 − r1, showing the economic-thickness point beyond which more material rarely pays. The annual-cost endpoint turns loss per foot into the yearly heat lost and fuel cost over a run of pipe, the number that justifies the lagging. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical-design and energy-audit apps, insulation-contractor and process-piping tools, building-services calculators, and engineering aids. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. Ignores the outer air film (real loss slightly lower). For flat walls and roofs use a U-value 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/pipeinsulation-api/..."
```

## Pricing
- **Free** (Free) — 480 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 12,600 calls/Mo, 6 req/s
- **Pro** ($18/Mo) — 80,000 calls/Mo, 15 req/s
- **Mega** ($52/Mo) — 260,000 calls/Mo, 36 req/s

## Endpoints

### Pipe Insulation

#### `GET /v1/annual-cost` — Annual loss and fuel cost

**Parameters:**
- `heat_loss_btu_hr_ft` (query, required, string) — Heat loss per foot in BTU/hr Example: `42.9`
- `length_ft` (query, required, string) — Pipe run length in feet Example: `100`
- `hours_per_year` (query, optional, string) — Operating hours/year (default 8760) Example: `8760`
- `price_per_therm` (query, optional, string) — Gas price per therm (default 1.2) Example: `1.2`
- `boiler_efficiency_pct` (query, optional, string) — Boiler efficiency % (default 80) Example: `80`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pipeinsulation-api/v1/annual-cost?heat_loss_btu_hr_ft=42.9&length_ft=100&hours_per_year=8760&price_per_therm=1.2&boiler_efficiency_pct=80"
```

**Response:**
```json
{
    "data": {
        "note": "Annual loss = loss per foot × length × operating hours; fuel = that ÷ 100,000 BTU/therm ÷ the boiler efficiency, times the gas price. A bare or poorly-lagged hot line can leak hundreds of dollars a year, so insulation usually pays back fast — compare against the cost of the lagging to find the payback.",
        "inputs": {
            "length_ft": 100,
            "hours_per_year": 8760,
            "price_per_therm": 1.2,
            "heat_loss_btu_hr_ft": 42.9,
            "boiler_efficiency_pct": 80
        },
        "annual_cost": 563.71,
        "annual_therms": 469.8,
        "annual_loss_btu": 37580400
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:57.628Z",
        "request_id": "7367d67e-b204-4a96-9dc7-7c0d3f046fa3"
    },
    "status": "ok",
    "message": "Annual cost",
    "success": true
}
```

#### `GET /v1/heat-loss` — Heat loss per foot

**Parameters:**
- `pipe_od_in` (query, required, string) — Pipe outer diameter in inches Example: `2.375`
- `insulation_thickness_in` (query, required, string) — Insulation thickness in inches Example: `1`
- `pipe_temp_f` (query, required, string) — Pipe temperature °F Example: `300`
- `ambient_temp_f` (query, required, string) — Ambient temperature °F Example: `100`
- `k_btu_in` (query, optional, string) — Insulation k (BTU·in/hr·ft²·°F, default 0.25) Example: `0.25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pipeinsulation-api/v1/heat-loss?pipe_od_in=2.375&insulation_thickness_in=1&pipe_temp_f=300&ambient_temp_f=100&k_btu_in=0.25"
```

**Response:**
```json
{
    "data": {
        "note": "Radial heat loss per foot = 2π·(k/12)·ΔT ÷ ln(r2/r1) — cylindrical conduction, where k is the insulation conductivity (BTU·in/hr·ft²·°F, ~0.25 for fibreglass), r1 the pipe radius and r2 the outer insulation radius. Unlike a flat wall, doubling the thickness does NOT halve the loss because it is logarithmic. Ignores the outer air film, so real loss is a little lower.",
        "inputs": {
            "k_btu_in": 0.25,
            "pipe_od_in": 2.375,
            "pipe_temp_f": 300,
            "ambient_temp_f": 100,
            "insulation_thickness_in": 1
        },
        "heat_loss_btu_hr_ft": 42.9
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:57.726Z",
        "request_id": "fbd0b911-67c5-48fd-b1e5-94e3b3b19285"
    },
    "status": "ok",
    "message": "Heat loss",
    "success": true
}
```

#### `GET /v1/thickness` — Thickness for a target loss

**Parameters:**
- `pipe_od_in` (query, required, string) — Pipe outer diameter in inches Example: `2.375`
- `target_loss_btu_hr_ft` (query, required, string) — Target loss in BTU/hr per foot Example: `30`
- `pipe_temp_f` (query, required, string) — Pipe temperature °F Example: `300`
- `ambient_temp_f` (query, required, string) — Ambient temperature °F Example: `100`
- `k_btu_in` (query, optional, string) — Insulation k (default 0.25) Example: `0.25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pipeinsulation-api/v1/thickness?pipe_od_in=2.375&target_loss_btu_hr_ft=30&pipe_temp_f=300&ambient_temp_f=100&k_btu_in=0.25"
```

**Response:**
```json
{
    "data": {
        "note": "Thickness for a target loss inverts the cylindrical-conduction law: ln(r2/r1) = 2π·(k/12)·ΔT ÷ target, then thickness = r2 − r1. Because the relationship is logarithmic, chasing a very low loss needs disproportionately thick insulation — there is an economic-thickness sweet spot beyond which more material rarely pays back.",
        "inputs": {
            "k_btu_in": 0.25,
            "pipe_od_in": 2.375,
            "pipe_temp_f": 300,
            "ambient_temp_f": 100,
            "target_loss_btu_hr_ft": 30
        },
        "outer_diameter_in": 5.68,
        "required_thickness_in": 1.65
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:57.815Z",
        "request_id": "300e1fae-60da-434a-b38a-4996da48a2d4"
    },
    "status": "ok",
    "message": "Thickness",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "US units. Q/L = 2π·(k/12)·ΔT ÷ ln(r2/r1); k in BTU·in/hr·ft²·°F (~0.25 fibreglass). Ignores outer air film (loss slightly lower). For flat walls/roofs use a U-value API.",
        "service": "pipeinsulation-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/heat-loss": "Heat loss per foot through cylindrical insulation.",
            "GET /v1/thickness": "Insulation thickness for a target heat loss per foot.",
            "GET /v1/annual-cost": "Annual heat loss and fuel cost for a run of pipe."
        },
        "description": "Pipe-insulation heat-loss maths: radial conduction per foot, the thickness for a target loss, and the annual heat loss & fuel cost."
    },
    "meta": {
        "timestamp": "2026-06-06T23:53:57.890Z",
        "request_id": "1e7cb045-f53d-4434-8224-678299da5cc9"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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