# 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"
```

#### `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"
```

#### `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"
```

### Meta

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

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


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