# Lumber Calculator API
> Lumber and framing material-estimation maths as an API, computed locally and deterministically. The boardfeet endpoint computes board feet — the standard volume unit for sawn timber, (thickness_in × width_in × length_ft) ÷ 12 — for a quantity of boards, with the total board feet and linear feet. The studs endpoint frames a wall: the number of vertical studs, ceil(wall length ÷ spacing) + 1 (16-inch ≈ 0.4064 m or 24-inch ≈ 0.6096 m centres), with two extra studs per opening, plus the plate boards for the top and bottom plates. The cost endpoint totals the lumber either by board foot (board feet × price per board foot) or by piece (pieces × price per piece). Everything is computed locally and deterministically, so it is instant and private. Ideal for construction, carpentry and DIY app developers, framing and material take-off tools, and lumberyard and builder calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is lumber and framing estimation; for drywall sheets use a drywall API and for concrete use a concrete 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/lumber-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 20 req/s
- **Mega** ($75/Mo) — 900,000 calls/Mo, 60 req/s

## Endpoints

### Lumber

#### `GET /v1/boardfeet` — Board feet

**Parameters:**
- `thickness` (query, required, string) — Thickness (inches) Example: `2`
- `width` (query, required, string) — Width (inches) Example: `4`
- `length` (query, required, string) — Length (feet) Example: `8`
- `quantity` (query, optional, string) — Number of boards (default 1) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lumber-api/v1/boardfeet?thickness=2&width=4&length=8&quantity=10"
```

**Response:**
```json
{
    "data": {
        "note": "Board feet = (thickness_in × width_in × length_ft) / 12. One board foot is 144 in³ of wood.",
        "inputs": {
            "width": 4,
            "length": 8,
            "quantity": 10,
            "thickness": 2
        },
        "board_feet_each": 5.3333,
        "board_feet_total": 53.3333,
        "linear_feet_total": 80
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:16.628Z",
        "request_id": "4dca6df2-9d87-480b-8de2-7d079c0ed0b6"
    },
    "status": "ok",
    "message": "Board feet",
    "success": true
}
```

#### `GET /v1/cost` — Lumber cost

**Parameters:**
- `board_feet` (query, optional, string) — Board feet Example: `53.33`
- `price_per_board_foot` (query, optional, string) — Price per board foot Example: `0.8`
- `pieces` (query, optional, string) — Or number of pieces
- `price_per_piece` (query, optional, string) — and price per piece

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lumber-api/v1/cost?board_feet=53.33&price_per_board_foot=0.8"
```

**Response:**
```json
{
    "data": {
        "mode": "by_board_foot",
        "note": "Total = board feet × price per board foot.",
        "inputs": {
            "board_feet": 53.33,
            "price_per_board_foot": 0.8
        },
        "total_cost": 42.66
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:16.727Z",
        "request_id": "246a1a39-ba69-4a7e-9c9e-5ac44499049e"
    },
    "status": "ok",
    "message": "Lumber cost",
    "success": true
}
```

#### `GET /v1/studs` — Stud-wall framing

**Parameters:**
- `wall_length` (query, required, string) — Wall length (m) Example: `6`
- `stud_spacing` (query, optional, string) — Stud spacing (m, default 0.4064 = 16") Example: `0.4064`
- `plates` (query, optional, string) — Plate rows (default 2) Example: `2`
- `board_length` (query, optional, string) — Plate board length (m, default 4.8) Example: `4.8`
- `openings` (query, optional, string) — Number of openings (default 0) Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lumber-api/v1/studs?wall_length=6&stud_spacing=0.4064&plates=2&board_length=4.8&openings=0"
```

**Response:**
```json
{
    "data": {
        "note": "Studs = ceil(wall_length / spacing) + 1, plus 2 extra studs per opening. Plate boards cover the top and bottom plates.",
        "inputs": {
            "plates": 2,
            "openings": 0,
            "wall_length": 6,
            "stud_spacing": 0.4064
        },
        "studs_needed": 16,
        "plate_boards_needed": 3
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:16.845Z",
        "request_id": "61024f19-b936-476c-ab5d-344641cd2d09"
    },
    "status": "ok",
    "message": "Stud wall framing",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Board-foot dimensions in inches (thickness, width) and feet (length). Stud spacing in metres (16\" ≈ 0.4064 m, 24\" ≈ 0.6096 m). Framing counts are approximate — add for blocking and corners.",
        "service": "lumber-api",
        "formulae": {
            "cost": "board_feet × price, or pieces × price",
            "studs": "ceil(wall_length / spacing) + 1 (+2 per opening)",
            "board_feet": "(thickness_in × width_in × length_ft) / 12"
        },
        "endpoints": {
            "GET /v1/cost": "Lumber cost by board foot or by piece.",
            "GET /v1/meta": "This document.",
            "GET /v1/studs": "Stud count and plate boards for a framed wall.",
            "GET /v1/boardfeet": "Board feet from thickness, width (inches) and length (feet), times a quantity."
        },
        "description": "Lumber and framing estimator: board feet, stud-wall framing counts, and lumber cost."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:16.951Z",
        "request_id": "328bf4ac-8924-4149-b4c0-1afc65ef8d5d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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