# Cable Tray Fill API
> Cable-tray fill engineering maths as an API, computed locally and deterministically from NEC Article 392 — the allowable-fill, single-layer and tray-width numbers an electrician, estimator or designer runs for a tray run. The fill endpoint applies NEC 392.22(A)(1) Column 1 for multiconductor power and lighting cables no larger than 4/0 in a ladder or ventilated-bottom tray: the total cable cross-sectional area is capped at the tray width × 7/6, so a 12-inch tray allows 14 in² — sum every cable's csa, get the percentage fill and whether it is within code, with the spare area left. The large-cable endpoint covers cables 4/0 and larger, which must lie in a single layer with the sum of their diameters not exceeding the tray width — no stacking — so it returns the spare width and the code check. The min-width endpoint inverts the rule to size the tray: minimum width = cable area × 6/7, rounded up to a standard 6/9/12/18/24/30/36-inch width, leaving room for spare capacity and future cables. Everything is computed locally and deterministically, so it is instant and private. Ideal for electrical-design and estimating tools, industrial and OSP utilities, and code-check calculators. Pure local computation — no key, no third-party service, instant. Ladder/ventilated trays; solid-bottom and mixed fills use the other NEC columns, and ampacity must be derated for fill. 3 compute endpoints. For conduit and box fill use a conduit 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/cabletray-api/..."
```

## Pricing
- **Free** (Free) — 5,500 calls/Mo, 2 req/s
- **Starter** ($11/Mo) — 56,000 calls/Mo, 6 req/s
- **Pro** ($36/Mo) — 237,000 calls/Mo, 15 req/s
- **Mega** ($112/Mo) — 1,180,000 calls/Mo, 40 req/s

## Endpoints

### Tray

#### `GET /v1/fill` — Allowable fill for ≤4/0 cables

**Parameters:**
- `tray_width_in` (query, required, string) — Tray inside width (in) Example: `12`
- `cable_area_in2` (query, required, string) — Total cable cross-sectional area (in²) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cabletray-api/v1/fill?tray_width_in=12&cable_area_in2=10"
```

**Response:**
```json
{
    "data": {
        "note": "For multiconductor power/lighting cables no larger than 4/0 in a ladder or ventilated-bottom tray, NEC 392.22(A)(1) Column 1 caps the total cable cross-sectional area at the tray width × 7/6 (e.g. a 12-inch tray allows 14 in²). Sum every cable's csa and keep it under that. Solid-bottom trays and trays mixing large and small cables use the other columns/rows — and remember ampacity must be derated for fill under 392.80.",
        "inputs": {
            "tray_width_in": 12,
            "cable_area_in2": 10
        },
        "fill_pct": 71.4,
        "within_code": true,
        "spare_area_in2": 4,
        "allowable_fill_area_in2": 14
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:04.453Z",
        "request_id": "cb0d3ba9-3063-4100-99aa-a637b6baa361"
    },
    "status": "ok",
    "message": "Cable tray fill",
    "success": true
}
```

#### `GET /v1/large-cable` — Single-layer check for ≥4/0 cables

**Parameters:**
- `tray_width_in` (query, required, string) — Tray inside width (in) Example: `12`
- `sum_of_diameters_in` (query, required, string) — Sum of cable diameters (in) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cabletray-api/v1/large-cable?tray_width_in=12&sum_of_diameters_in=10"
```

**Response:**
```json
{
    "data": {
        "note": "For multiconductor cables 4/0 and larger, NEC 392.22(A)(1) requires them laid in a single layer with the sum of their diameters not exceeding the tray width — they cannot be stacked or bundled. So a 12-inch tray holds cables whose diameters add up to 12 inches side by side. Mixing these with smaller cables triggers the combination rule in 392.22(A)(1)(c).",
        "inputs": {
            "tray_width_in": 12,
            "sum_of_diameters_in": 10
        },
        "within_code": true,
        "spare_width_in": 2
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:04.553Z",
        "request_id": "d72ed833-b0bd-4760-a9c8-6bc86c3be658"
    },
    "status": "ok",
    "message": "Large cable check",
    "success": true
}
```

#### `GET /v1/min-width` — Minimum tray width for a bundle

**Parameters:**
- `cable_area_in2` (query, required, string) — Total cable cross-sectional area (in²) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cabletray-api/v1/min-width?cable_area_in2=10"
```

**Response:**
```json
{
    "data": {
        "note": "The minimum ladder/ventilated tray width for a bundle of ≤ 4/0 cables = total cable area × 6/7 (the inverse of the Column-1 rule), then round up to a standard width (6, 9, 12, 18, 24, 30, 36 inches). Sizing up leaves room for spare capacity and future cables, and keeps the fill — and the ampacity derating that comes with it — comfortable.",
        "inputs": {
            "cable_area_in2": 10
        },
        "min_width_in": 8.571,
        "recommended_standard_width_in": 9
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:04.659Z",
        "request_id": "d026f235-af40-4898-a90d-26aa57984dba"
    },
    "status": "ok",
    "message": "Min tray width",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Inches, in². NEC 392.22(A)(1) ladder/ventilated, ≤4/0: allowable area = width×7/6; ≥4/0: Σdiameters ≤ width; min width = area×6/7. Solid-bottom trays use other columns. For conduit/box fill use a conduit API.",
        "service": "cabletray-api",
        "endpoints": {
            "GET /v1/fill": "Allowable fill area and % for ≤4/0 cables in a ladder/ventilated tray.",
            "GET /v1/meta": "This document.",
            "GET /v1/min-width": "Minimum and next standard tray width for a cable bundle.",
            "GET /v1/large-cable": "Single-layer diameter check for ≥4/0 cables."
        },
        "description": "Cable-tray fill maths (NEC 392.22): allowable fill for small cables, single-layer check for large cables, and minimum tray width."
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:04.739Z",
        "request_id": "565a21ca-7f58-4ef0-9299-5e9bcbcaf3fc"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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