# U-Value & R-Value API
> Building-fabric thermal maths — U-value, R-value and heat loss — as an API, computed locally and deterministically. The rvalue endpoint takes a wall, roof or floor build-up as a list of layers (each given as a thickness and a thermal conductivity, or a thickness and a named material from a built-in table, or a direct R-value) and adds the interior and exterior surface resistances to return the total thermal resistance R = Rsi + ΣR_layer + Rse and the thermal transmittance U = 1/R, in both metric (RSI, m²K/W and W/m²K) and imperial (R-value) units, with a per-layer breakdown. The layer endpoint gives the R-value of a single material from its thickness and conductivity, R = thickness/conductivity, and solves for whichever of the three you leave out, with conductivities for concrete, brick, timber, plasterboard, mineral wool, EPS, XPS, PIR and more. The heatloss endpoint computes the steady-state heat loss through an element, Q = U·A·ΔT, in watts, BTU per hour and kWh per day from a U-value (or R-value), an area and a temperature difference (direct or as indoor minus outdoor), and an annual figure from heating degree days. Everything is computed locally and deterministically, so it is instant and private. Ideal for building-energy and retrofit tools, architecture and construction apps, insulation and SAP/Passivhaus calculators, and energy-assessment software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is building-fabric thermal performance; for rule-of-thumb HVAC equipment 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/uvalue-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 15,000 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 80,000 calls/Mo, 15 req/s
- **Mega** ($69/Mo) — 400,000 calls/Mo, 40 req/s

## Endpoints

### Thermal

#### `GET /v1/heatloss` — Steady-state heat loss

**Parameters:**
- `u_value` (query, optional, string) — U-value (W/m²K) Example: `0.31`
- `r_value` (query, optional, string) — Or R-value (m²K/W)
- `area` (query, required, string) — Element area (m²) Example: `20`
- `delta_t` (query, optional, string) — Temperature difference (K) Example: `20`
- `indoor_temperature` (query, optional, string) — Or indoor temperature (°C)
- `outdoor_temperature` (query, optional, string) — And outdoor temperature (°C)
- `heating_degree_days` (query, optional, string) — Heating degree days for annual energy

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/uvalue-api/v1/heatloss?u_value=0.31&area=20&delta_t=20"
```

**Response:**
```json
{
    "data": {
        "area_m2": 20,
        "formula": "Q = U · A · ΔT.",
        "delta_t_k": 20,
        "heat_loss_w": 124,
        "u_value_w_m2k": 0.31,
        "heat_loss_btu_h": 423.1056,
        "heat_loss_kwh_day": 2.976
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:50.384Z",
        "request_id": "5f14415c-13b3-444c-9ea6-666c19f420cf"
    },
    "status": "ok",
    "message": "Steady-state heat loss",
    "success": true
}
```

#### `GET /v1/layer` — Single-material R-value

**Parameters:**
- `material` (query, optional, string) — Material name (e.g. mineral_wool) Example: `mineral_wool`
- `conductivity` (query, optional, string) — Or conductivity (W/m·K)
- `thickness` (query, optional, string) — Thickness (m) Example: `0.1`
- `r` (query, optional, string) — Or a known R-value to solve thickness/conductivity

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/uvalue-api/v1/layer?material=mineral_wool&thickness=0.1"
```

**Response:**
```json
{
    "data": {
        "formula": "R = thickness / conductivity.",
        "material": "mineral_wool",
        "thickness_m": 0.1,
        "u_value_w_m2k": 0.35,
        "r_value_imperial": 16.22361,
        "conductivity_w_mk": 0.035,
        "r_value_rsi_m2k_w": 2.857143
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:50.493Z",
        "request_id": "2ff30a82-0692-4ee5-bd7e-196b02ca0987"
    },
    "status": "ok",
    "message": "Single-material R-value",
    "success": true
}
```

#### `GET /v1/rvalue` — Assembly R-value & U-value

**Parameters:**
- `layers` (query, required, string) — JSON array of {thickness,material|conductivity} or {r} Example: `[{"thickness":0.1,"material":"mineral_wool"}]`
- `rsi` (query, optional, string) — Interior surface resistance (default 0.13)
- `rse` (query, optional, string) — Exterior surface resistance (default 0.04)
- `include_surfaces` (query, optional, string) — Include surface resistances (default true) Example: `true`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/uvalue-api/v1/rvalue?layers=%5B%7B%22thickness%22%3A0.1%2C%22material%22%3A%22mineral_wool%22%7D%5D&include_surfaces=true"
```

**Response:**
```json
{
    "data": {
        "layers": [
            {
                "index": 0,
                "r_value": 2.857143,
                "material": "mineral_wool",
                "thickness_m": 0.1,
                "conductivity_w_mk": 0.035
            }
        ],
        "formula": "R_total = Rsi + ΣR_layer + Rse; U = 1/R_total; R_layer = thickness/conductivity.",
        "layer_count": 1,
        "u_value_w_m2k": 0.330344,
        "r_value_imperial": 17.188915,
        "layers_resistance": 2.857143,
        "r_value_rsi_m2k_w": 3.027143,
        "exterior_surface_resistance_rse": 0.04,
        "interior_surface_resistance_rsi": 0.13
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:50.590Z",
        "request_id": "eca16a73-744b-473e-a98e-66265e3467f3"
    },
    "status": "ok",
    "message": "Assembly R-value & U-value",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "uvalue",
        "note": "U-value / R-value building-fabric thermal maths — computed locally and deterministically, no key, no third-party service.",
        "defaults": {
            "rse": 0.04,
            "rsi": 0.13
        },
        "endpoints": [
            "/v1/rvalue",
            "/v1/layer",
            "/v1/heatloss",
            "/v1/meta"
        ],
        "materials": [
            "concrete",
            "reinforced_concrete",
            "aerated_concrete",
            "brick",
            "brickwork",
            "stone",
            "sandstone",
            "timber",
            "softwood",
            "hardwood",
            "plywood",
            "osb",
            "plasterboard",
            "gypsum",
            "plaster",
            "render",
            "screed",
            "mineral_wool",
            "glass_wool",
            "rock_wool",
            "sheeps_wool",
            "eps",
            "xps",
            "pir",
            "pur",
            "phenolic",
            "cellulose",
            "wood_fibre",
            "cork",
            "glass",
            "steel",
            "aluminium",
            "plasterboard_foil"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:50.683Z",
        "request_id": "066fd9a0-3d00-4146-b43b-e606bff262b0"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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