# Deck Builder API
> Deck-building maths as an API, computed locally and deterministically — the board, joist and fastener counts a homeowner or contractor needs to material out a rectangular deck. The boards endpoint turns the deck size into a real shopping list: rows = deck width ÷ (board width + gap), rounded up, so a 16 ft × 12 ft deck with a 5.5-inch board face (a 5/4×6) and a 1/8-inch gap needs 26 rows; boards run the length, each row takes one 16 ft board, and a 10 % waste allowance brings it to 29 boards plus the linear footage and the deck area. The joists endpoint frames it: joists are spaced along the length, so count = ⌊length ÷ spacing⌋ + 1 — thirteen joists at 16-inch on-center (seventeen at 12-inch for stronger or diagonal decking), each spanning the width, plus two rim joists and a ledger as total framing linear feet. The fasteners endpoint counts the screws: every decking row crosses every joist once and is fastened with two face screws there, so a 16×12 deck takes 26 × 13 × 2 = 676 screws, about 744 with waste — or one hidden clip per intersection. Everything is computed locally and deterministically, so it is instant and private. Ideal for construction, contractor, home-improvement, building-materials and renovation app developers, deck-estimator and takeoff tools, and lumber-yard calculators. Pure local computation — no key, no third-party service, instant. US units (feet/inches). Live, nothing stored. 3 compute endpoints. Rectangular decks; for indoor floor area use a flooring 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/deck-api/..."
```

## Pricing
- **Free** (Free) — 7,600 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 52,500 calls/Mo, 6 req/s
- **Pro** ($13/Mo) — 219,000 calls/Mo, 15 req/s
- **Mega** ($40/Mo) — 1,295,000 calls/Mo, 40 req/s

## Endpoints

### Deck

#### `GET /v1/boards` — Decking boards

**Parameters:**
- `length_ft` (query, required, string) — Deck length (boards run this way) Example: `16`
- `width_ft` (query, required, string) — Deck width Example: `12`
- `board_width_in` (query, optional, string) — Board face width (default 5.5) Example: `5.5`
- `gap_in` (query, optional, string) — Gap between boards (default 0.125) Example: `0.125`
- `board_length_ft` (query, optional, string) — Stock board length (default 16) Example: `16`
- `waste_percent` (query, optional, string) — Waste allowance % (default 10) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/deck-api/v1/boards?length_ft=16&width_ft=12&board_width_in=5.5&gap_in=0.125&board_length_ft=16&waste_percent=10"
```

**Response:**
```json
{
    "data": {
        "note": "Rows = deck width ÷ (board width + gap), rounded up. Boards run the length; each row needs ⌈length ÷ stock board length⌉ boards. A 5/4×6 board is about 5.5\" wide; 1/8\" gaps are typical. Waste covers cuts and culls.",
        "rows": 26,
        "inputs": {
            "gap_in": 0.125,
            "width_ft": 12,
            "length_ft": 16,
            "waste_percent": 10,
            "board_width_in": 5.5,
            "board_length_ft": 16
        },
        "linear_feet": 416,
        "boards_per_row": 1,
        "deck_area_sqft": 192,
        "boards_no_waste": 26,
        "boards_with_waste": 29
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:05.722Z",
        "request_id": "aaaaa53d-68d9-41af-8e47-6d87c5d9c9e5"
    },
    "status": "ok",
    "message": "Decking boards",
    "success": true
}
```

#### `GET /v1/fasteners` — Fasteners

**Parameters:**
- `length_ft` (query, required, string) — Deck length Example: `16`
- `width_ft` (query, required, string) — Deck width Example: `12`
- `board_width_in` (query, optional, string) — Board face width (default 5.5) Example: `5.5`
- `gap_in` (query, optional, string) — Gap (default 0.125) Example: `0.125`
- `spacing_in` (query, optional, string) — Joist spacing (default 16) Example: `16`
- `screws_per_joist` (query, optional, string) — Screws per board per joist (default 2) Example: `2`
- `waste_percent` (query, optional, string) — Waste % (default 10) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/deck-api/v1/fasteners?length_ft=16&width_ft=12&board_width_in=5.5&gap_in=0.125&spacing_in=16&screws_per_joist=2&waste_percent=10"
```

**Response:**
```json
{
    "data": {
        "note": "Each decking row crosses every joist once and is fastened with 2 face screws there: screws = rows × joists × 2. Hidden-clip systems use 1 clip per intersection instead. Add ~10 % for drops and stripped heads.",
        "rows": 26,
        "inputs": {
            "gap_in": 0.125,
            "width_ft": 12,
            "length_ft": 16,
            "spacing_in": 16,
            "waste_percent": 10,
            "board_width_in": 5.5,
            "screws_per_joist": 2
        },
        "joist_count": 13,
        "screws_no_waste": 676,
        "screws_with_waste": 744
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:05.812Z",
        "request_id": "8baa601a-9a5d-4855-bc85-337e15cd9dcf"
    },
    "status": "ok",
    "message": "Fasteners",
    "success": true
}
```

#### `GET /v1/joists` — Joist framing

**Parameters:**
- `length_ft` (query, required, string) — Deck length Example: `16`
- `width_ft` (query, required, string) — Deck width (joist span) Example: `12`
- `spacing_in` (query, optional, string) — On-center spacing (default 16) Example: `16`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/deck-api/v1/joists?length_ft=16&width_ft=12&spacing_in=16"
```

**Response:**
```json
{
    "data": {
        "note": "Joists are spaced along the deck length: count = ⌊length ÷ spacing⌋ + 1, each spanning the width. 16\" on-center is standard (12\" for stronger/diagonal decking, 24\" only for thick boards). Plus two rim joists and a ledger.",
        "inputs": {
            "width_ft": 12,
            "length_ft": 16,
            "spacing_in": 16
        },
        "joist_count": 13,
        "ledger_feet": 16,
        "rim_joist_feet": 32,
        "joist_length_ft": 12,
        "joist_linear_feet": 156,
        "total_framing_linear_feet": 204
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:05.897Z",
        "request_id": "597ff070-747b-4408-832e-642342a85498"
    },
    "status": "ok",
    "message": "Joist framing",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "US units (feet/inches). Boards run the deck length and lay across joists spaced along the length. Defaults: 5.5\" board face, 1/8\" gap, 16\" on-center joists, 10 % waste. Rectangular decks; for area-only flooring use a flooring API.",
        "service": "deck-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/boards": "Decking boards (rows, boards, linear feet) for a deck, with gap and waste.",
            "GET /v1/joists": "Joist count, length and rim/ledger lumber for the frame.",
            "GET /v1/fasteners": "Screws (or clips) to fasten the decking to the joists."
        },
        "description": "Deck-building maths: decking boards, joist framing, and fasteners for a rectangular deck."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:05.966Z",
        "request_id": "d52f9707-2b08-4187-a35f-b9f44c48e49e"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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