# Log Scaling & Timber API
> Log-scaling and timber maths as an API, computed locally and deterministically — the board-foot yield and cubic volume a logger, sawyer or forester scales a round saw log with. The boardfeet endpoint runs the three classic log rules at once from the small-end diameter inside bark and the length: Doyle = ((D − 4) ÷ 4)² × L, Scribner Decimal C ≈ (0.79·D² − 2·D − 4) × L ÷ 16, and the International ¼-inch rule by exact four-foot segments with a half-inch taper allowance, rounded to the nearest 5 board feet — so a 20-inch, 16-foot log scales 256 BF by Doyle, 272 by Scribner and 320 by International, neatly showing how Doyle under-scales small logs, International is the most accurate and Scribner sits between. The volume endpoint gives the cubic content by Smalian’s formula — the average of the two end cross-section areas times length — and Huber’s formula — the mid cross-section area times length, usually the most accurate — both in cubic feet and cords (128 ft³ = 1 cord). Everything is computed locally and deterministically, so it is instant and private. Ideal for forestry, logging, sawmill, timber-cruising and land-management app developers, log-buyer and timber-valuation tools, and woodlot calculators. Pure local computation — no key, no third-party service, instant. Imperial forestry units. Live, nothing stored. 2 compute endpoints. For sawn-board board feet use a lumber 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/logscale-api/..."
```

## Pricing
- **Free** (Free) — 6,800 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 51,500 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 216,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,285,000 calls/Mo, 40 req/s

## Endpoints

### LogScale

#### `GET /v1/boardfeet` — Board-foot yield (log rules)

**Parameters:**
- `diameter_in` (query, required, string) — Small-end diameter inside bark (in) Example: `20`
- `length_ft` (query, required, string) — Log length (ft) Example: `16`
- `logs` (query, optional, string) — Number of identical logs (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/logscale-api/v1/boardfeet?diameter_in=20&length_ft=16&logs=1"
```

**Response:**
```json
{
    "data": {
        "note": "Board feet of sawn lumber a round log will yield, by the three standard rules. Doyle under-scales small logs and over-scales big ones; International ¼\" is the most accurate; Scribner sits between. Diameter is the small end inside bark.",
        "total": {
            "doyle": 256,
            "scribner": 272,
            "international_quarter_inch": 320
        },
        "inputs": {
            "logs": 1,
            "length_ft": 16,
            "diameter_in": 20
        },
        "per_log": {
            "doyle": 256,
            "scribner": 272,
            "international_quarter_inch": 320
        }
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.405Z",
        "request_id": "0cee1f1f-bbc6-4049-b9a5-4aacd82970ae"
    },
    "status": "ok",
    "message": "Log board feet",
    "success": true
}
```

#### `GET /v1/volume` — Cubic volume (Smalian/Huber)

**Parameters:**
- `length_ft` (query, required, string) — Log length (ft) Example: `16`
- `small_diameter_in` (query, required, string) — Small-end diameter (in) Example: `18`
- `large_diameter_in` (query, optional, string) — Large-end diameter (Smalian) Example: `22`
- `mid_diameter_in` (query, optional, string) — Mid diameter (Huber) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/logscale-api/v1/volume?length_ft=16&small_diameter_in=18&large_diameter_in=22&mid_diameter_in=20"
```

**Response:**
```json
{
    "data": {
        "note": "Smalian's = (large-end area + small-end area) ÷ 2 × length. Huber's = mid area × length (usually the most accurate). Areas use diameter inside bark. 128 ft³ = 1 stacked cord.",
        "inputs": {
            "length_ft": 16,
            "small_diameter_in": 18
        },
        "huber_cuft": 34.907,
        "huber_cords": 0.273,
        "smalian_cuft": 35.256,
        "smalian_cords": 0.275,
        "mid_diameter_in": 20,
        "large_diameter_in": 22
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.501Z",
        "request_id": "6331830d-b008-44ff-8183-5fa735fd0c4e"
    },
    "status": "ok",
    "message": "Log volume",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Imperial forestry units: small-end diameter inside bark (inches), length (feet). Doyle = ((D−4)/4)²×L; Scribner ≈ (0.79D²−2D−4)×L/16; International ¼\" by 4-ft segments to the nearest 5 BF. For sawn-board board feet use a lumber API.",
        "service": "logscale-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/volume": "Cubic-foot (and cord) volume by Smalian's and Huber's formulas.",
            "GET /v1/boardfeet": "Board-foot yield of a saw log by all three log rules."
        },
        "description": "Log-scaling maths: board-foot yield by the Doyle, Scribner and International ¼-inch rules, and cubic volume by Smalian's and Huber's formulas."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:03.589Z",
        "request_id": "2e6abdae-d7e9-4716-989f-5855bae3e334"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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