# Conduit Fill API
> NEC conduit-fill and box-fill maths as an API, computed locally and deterministically — the electrical-code calculations an electrician or estimator does on every run. The conduit-fill endpoint takes a set of conductors (as size:count pairs, e.g. 12:3,10:2) and a conduit trade size and returns the conductor cross-sectional area, the conduit's internal area, the fill percentage and whether it stays within the NEC Chapter 9 limit — 53 % for a single conductor, 31 % for two, 40 % for three or more — so nine #12 THHN fill a half-inch EMT to 39 % (legal) but ten do not. The box-fill endpoint applies NEC 314.16(B): each conductor adds its free-space allowance (2.00 in³ for #14, 2.25 for #12, and so on), a device yoke counts as two, internal cable clamps as one, and all equipment grounds together as one — all at the largest conductor's volume — to give the minimum junction-box size, checked against a box volume if you give one. Uses the THHN/THWN and EMT areas from NEC Chapter 9. Everything is computed locally and deterministically, so it is instant and private. Ideal for electrical-contractor, estimating, inspection and electrician app developers, conduit and box-sizing tools, and apprentice training. Pure local computation — no key, no third-party service, instant. Imperial: square inches and cubic inches. Live, nothing stored. 2 compute endpoints. Always verify against the adopted code edition — this is an estimating aid, not an inspection.

## 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/conduit-api/..."
```

## Pricing
- **Free** (Free) — 4,950 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 49,000 calls/Mo, 6 req/s
- **Pro** ($14/Mo) — 214,000 calls/Mo, 15 req/s
- **Mega** ($44/Mo) — 1,285,000 calls/Mo, 40 req/s

## Endpoints

### Conduit

#### `GET /v1/box-fill` — NEC 314.16 box fill

**Parameters:**
- `conductors` (query, optional, string) — size:count pairs, e.g. 14:3 Example: `14:3`
- `wire_size` (query, optional, string) — Single wire size Example: `14`
- `count` (query, optional, string) — Count for single size Example: `3`
- `devices` (query, optional, string) — Device yokes (receptacles/switches) Example: `1`
- `clamps` (query, optional, string) — Internal cable clamps present Example: `true`
- `grounds` (query, optional, string) — Equipment grounds present Example: `1`
- `box_volume` (query, optional, string) — Box volume to check (in³)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/conduit-api/v1/box-fill?conductors=14%3A3&wire_size=14&count=3&devices=1&clamps=true&grounds=1"
```

**Response:**
```json
{
    "data": {
        "note": "NEC 314.16(B): each conductor adds its free-space allowance; a device counts as 2×, internal clamps as 1×, and all equipment grounds together as 1× — all at the largest conductor's volume.",
        "inputs": {
            "clamps": 1,
            "devices": 1,
            "conductors": [
                {
                    "size": "14",
                    "count": 3
                }
            ],
            "ground_systems": 1
        },
        "required_volume": 14,
        "volume_breakdown": {
            "clamps": 2,
            "devices": 4,
            "grounds": 2,
            "conductors": 6
        }
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:45.876Z",
        "request_id": "602decef-b32e-436a-aaa7-d27d98ea72d5"
    },
    "status": "ok",
    "message": "Box fill",
    "success": true
}
```

#### `GET /v1/conduit-fill` — NEC conduit fill %

**Parameters:**
- `conductors` (query, optional, string) — size:count pairs, e.g. 12:3,10:2 Example: `12:3,10:2`
- `wire_size` (query, optional, string) — Single wire size (AWG/kcmil) Example: `12`
- `count` (query, optional, string) — Count for single size Example: `3`
- `trade_size` (query, optional, string) — EMT trade size (1/2, 3/4, 1, …) Example: `1/2`
- `conduit_area` (query, optional, string) — Override conduit area (in²)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/conduit-api/v1/conduit-fill?conductors=12%3A3%2C10%3A2&wire_size=12&count=3&trade_size=1%2F2"
```

**Response:**
```json
{
    "data": {
        "note": "NEC Chapter 9: max fill is 53% for 1 conductor, 31% for 2, 40% for 3 or more. Fill % = conductor area / conduit area; it must stay within the allowable.",
        "inputs": {
            "conductors": [
                {
                    "size": "12",
                    "count": 3
                },
                {
                    "size": "10",
                    "count": 2
                }
            ],
            "trade_size": "1/2",
            "conduit_area": 0.304
        },
        "spare_area": 0.0395,
        "fill_percent": 27.0066,
        "within_limit": true,
        "allowable_area": 0.1216,
        "conductor_area": 0.0821,
        "conductor_count": 5,
        "max_fill_percent": 40
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:45.953Z",
        "request_id": "645c4d96-6761-4479-b03c-10b329382c97"
    },
    "status": "ok",
    "message": "Conduit fill",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "THHN/THWN conductor and EMT areas (NEC Chapter 9); box-fill volumes (NEC 314.16(B)). Conductors as 'size:count' pairs (e.g. 12:3,10:2). Imperial: in² and in³. Verify against the current code; this is an estimating aid.",
        "service": "conduit-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/box-fill": "Required junction-box volume (NEC 314.16) from conductors, devices, clamps and grounds.",
            "GET /v1/conduit-fill": "Conduit fill % and pass/fail (NEC Chapter 9) for a set of conductors in EMT."
        },
        "description": "NEC conduit fill and box fill for electricians: conductor area vs conduit capacity, and junction-box volume requirements."
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:46.011Z",
        "request_id": "d06f22fe-6213-428e-bf64-8d75f57f5f45"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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