# Masonry Estimating API
> Masonry estimating maths as an API, computed locally and deterministically — the brick, block and mortar counts a bricklayer, builder or estimator works to. The brick endpoint computes how many bricks a wall needs from its area (or length × height in feet): bricks per square foot = 144 / ((brick length + joint) × (brick height + joint)), so a standard modular brick with a 3/8-inch mortar joint works out to the well-known 6.86 bricks per square foot — a 100 ft² wall is 686 bricks, plus a waste allowance and the mortar bags (about 7 per 1000 bricks). The block endpoint does the same for concrete masonry units: a standard 16×8-inch CMU with a 3/8-inch joint is 1.125 blocks per square foot, with roughly 2.5 mortar bags per 100 blocks. Both endpoints take custom unit face dimensions and joint thickness, add a configurable waste percentage and round up to whole units. Everything is computed locally and deterministically, so it is instant and private. Ideal for construction, masonry-contractor, building-supply and home-improvement app developers, takeoff and material-estimating tools, and trade calculators. Pure local computation — no key, no third-party service, instant. Imperial units (inches and square feet). Live, nothing stored. 2 compute endpoints. This is brick/block and mortar estimating; for poured-concrete volume use a concrete API and for drywall use a drywall 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/masonry-api/..."
```

## Pricing
- **Free** (Free) — 5,150 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 52,000 calls/Mo, 6 req/s
- **Pro** ($11/Mo) — 218,000 calls/Mo, 15 req/s
- **Mega** ($35/Mo) — 1,310,000 calls/Mo, 40 req/s

## Endpoints

### Masonry

#### `GET /v1/block` — Blocks + mortar for a wall

**Parameters:**
- `area` (query, optional, string) — Wall area (ft², or use length+height) Example: `320`
- `length` (query, optional, string) — Wall length (ft)
- `height` (query, optional, string) — Wall height (ft)
- `block_length` (query, optional, string) — Block face length (in, default 15.625)
- `block_height` (query, optional, string) — Block face height (in, default 7.625)
- `joint` (query, optional, string) — Mortar joint (in, default 0.375)
- `waste_percent` (query, optional, string) — Waste % (default 5)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/masonry-api/v1/block?area=320"
```

**Response:**
```json
{
    "data": {
        "note": "Blocks/ft² = 144 / ((L+joint)·(H+joint)). A standard 16×8\" CMU with a 3/8\" joint is 1.125/ft². Mortar ≈ 2.5 bags per 100 blocks. Waste added then rounded up.",
        "inputs": {
            "joint": 0.375,
            "area_sqft": 320,
            "block_height": 7.625,
            "block_length": 15.625,
            "waste_percent": 5
        },
        "mortar_bags": 10,
        "blocks_needed": 378,
        "blocks_no_waste": 360,
        "blocks_per_sqft": 1.125
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:47.066Z",
        "request_id": "21b6f3de-08bb-4a32-a53c-5218b1bc6d67"
    },
    "status": "ok",
    "message": "Block estimate",
    "success": true
}
```

#### `GET /v1/brick` — Bricks + mortar for a wall

**Parameters:**
- `area` (query, optional, string) — Wall area (ft², or use length+height) Example: `100`
- `length` (query, optional, string) — Wall length (ft)
- `height` (query, optional, string) — Wall height (ft)
- `brick_length` (query, optional, string) — Brick face length (in, default 7.625)
- `brick_height` (query, optional, string) — Brick face height (in, default 2.25)
- `joint` (query, optional, string) — Mortar joint (in, default 0.375)
- `waste_percent` (query, optional, string) — Waste % (default 5)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/masonry-api/v1/brick?area=100"
```

**Response:**
```json
{
    "data": {
        "note": "Bricks/ft² = 144 / ((L+joint)·(H+joint)). A standard modular brick with a 3/8\" joint is 6.86/ft². Mortar ≈ 7 bags per 1000 bricks. Waste added then rounded up.",
        "inputs": {
            "joint": 0.375,
            "area_sqft": 100,
            "brick_height": 2.25,
            "brick_length": 7.625,
            "waste_percent": 5
        },
        "mortar_bags": 6,
        "bricks_needed": 720,
        "bricks_no_waste": 686,
        "bricks_per_sqft": 6.8571
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:47.168Z",
        "request_id": "a201b037-be1e-42c0-b84a-d9182e8fb449"
    },
    "status": "ok",
    "message": "Brick estimate",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Imperial: unit face in inches, wall in square feet (or length × height in feet). Defaults are a modular brick and a standard CMU with a 3/8\" mortar joint. For poured-concrete volume use a concrete API.",
        "service": "masonry-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/block": "Concrete-block (CMU) count and mortar bags for a wall area (16×8\" default).",
            "GET /v1/brick": "Brick count and mortar bags for a wall area (modular brick default)."
        },
        "description": "Masonry estimating: bricks and concrete blocks (CMU) for a wall, plus the mortar bags to lay them."
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:47.253Z",
        "request_id": "add42c12-1517-4276-94b3-efd04508fff6"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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