# Flooring & Tile API
> Flooring and tiling material-estimation maths as an API, computed locally and deterministically. The tile endpoint computes how many tiles a floor needs — the floor area (given directly or as length × width) divided by the tile area, with a waste allowance for cuts and breakage (10 % by default) — and, given the tiles per box, how many boxes to buy. The packs endpoint sizes laminate, vinyl or carpet from the coverage printed on each pack: packs = ceil(area·(1+waste) / coverage per pack), with the total coverage supplied. The grout endpoint estimates the grout in kilograms for a tiled area from the tile size, the joint width and the tile thickness, ((A+B)/(A·B))·joint·thickness·density per square metre. Everything is computed locally and deterministically, so it is instant and private. Ideal for home-improvement, renovation and trade app developers, DIY and material-ordering tools, and builder and retailer calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is floor-covering estimation; for wall paint use a paint API, for roofing use a roofing 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/flooring-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 20,000 calls/Mo, 5 req/s
- **Pro** ($14/Mo) — 120,000 calls/Mo, 15 req/s
- **Mega** ($44/Mo) — 600,000 calls/Mo, 40 req/s

## Endpoints

### Flooring

#### `GET /v1/grout` — Grout quantity

**Parameters:**
- `area` (query, optional, string) — Tiled area (m²) Example: `20`
- `length` (query, optional, string) — Or length (m)
- `width` (query, optional, string) — and width (m)
- `tile_length` (query, required, string) — Tile length (mm) Example: `300`
- `tile_width` (query, required, string) — Tile width (mm) Example: `300`
- `joint_width` (query, optional, string) — Joint width (mm, default 3) Example: `3`
- `tile_thickness` (query, optional, string) — Tile thickness (mm, default 8) Example: `8`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flooring-api/v1/grout?area=20&tile_length=300&tile_width=300&joint_width=3&tile_thickness=8"
```

**Response:**
```json
{
    "data": {
        "note": "Grout ≈ ((A+B)/(A·B))·joint·thickness·1.8 per m² (tile dims in mm). Add ~10 % for waste and uneven joints.",
        "inputs": {
            "area": 20,
            "tile_width": 300,
            "joint_width": 3,
            "tile_length": 300,
            "tile_thickness": 8
        },
        "grout_total_kg": 5.76,
        "grout_kg_per_m2": 0.288
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:17.971Z",
        "request_id": "06287194-7b43-4d0a-8d00-a4be5351d228"
    },
    "status": "ok",
    "message": "Grout quantity",
    "success": true
}
```

#### `GET /v1/packs` — Packs needed

**Parameters:**
- `area` (query, optional, string) — Floor area (m²) Example: `20`
- `length` (query, optional, string) — Or room length (m)
- `width` (query, optional, string) — and room width (m)
- `coverage_per_pack` (query, required, string) — Coverage per pack (m²) Example: `2.5`
- `waste_percent` (query, optional, string) — Waste % (default 8) Example: `8`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flooring-api/v1/packs?area=20&coverage_per_pack=2.5&waste_percent=8"
```

**Response:**
```json
{
    "data": {
        "note": "Packs = ceil(area·(1+waste) / coverage per pack). Laminate/engineered floors use ~8 % waste; herringbone or diagonal lay more.",
        "inputs": {
            "area": 20,
            "waste_percent": 8,
            "coverage_per_pack": 2.5
        },
        "packs_needed": 9,
        "coverage_with_waste_m2": 21.6,
        "total_coverage_supplied_m2": 22.5
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:18.097Z",
        "request_id": "24bf36cc-b9ff-4a02-a01e-28bd1e623be5"
    },
    "status": "ok",
    "message": "Packs needed",
    "success": true
}
```

#### `GET /v1/tile` — Tiles needed

**Parameters:**
- `area` (query, optional, string) — Floor area (m²) Example: `20`
- `length` (query, optional, string) — Or room length (m)
- `width` (query, optional, string) — and room width (m)
- `tile_length` (query, required, string) — Tile length (cm) Example: `30`
- `tile_width` (query, required, string) — Tile width (cm) Example: `30`
- `waste_percent` (query, optional, string) — Waste % (default 10) Example: `10`
- `tiles_per_box` (query, optional, string) — Tiles per box for box count Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flooring-api/v1/tile?area=20&tile_length=30&tile_width=30&waste_percent=10&tiles_per_box=12"
```

**Response:**
```json
{
    "data": {
        "note": "Tiles = ceil(area·(1+waste) / tile area). A 10 % waste allowance covers cuts and breakage.",
        "inputs": {
            "area": 20,
            "tile_width": 30,
            "tile_length": 30,
            "waste_percent": 10
        },
        "boxes_needed": 21,
        "tile_area_m2": 0.09,
        "tiles_needed": 245,
        "tiles_per_box": 12,
        "coverage_with_waste_m2": 22
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:18.207Z",
        "request_id": "3ab56cea-c6ef-458b-82a3-cacfff1f382c"
    },
    "status": "ok",
    "message": "Tiles needed",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Floor area in m² (or length × width in m). Tile size in cm for /tile, mm for /grout. Estimates — always confirm against the manufacturer's coverage and buy a little extra.",
        "service": "flooring-api",
        "formulae": {
            "grout": "((A+B)/(A·B))·joint·thickness·density per m²",
            "packs": "ceil(area·(1+waste) / coverage_per_pack)",
            "tiles": "ceil(area·(1+waste) / tile_area)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/tile": "Number of tiles (and boxes) for a floor area, with a waste allowance.",
            "GET /v1/grout": "Grout quantity in kg for a tiled area from the tile size and joint.",
            "GET /v1/packs": "Packs/boxes of laminate, vinyl or carpet from a per-pack coverage."
        },
        "description": "Flooring and tiling material estimator: tiles needed for a floor, packs from a per-pack coverage, and grout quantity."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:18.312Z",
        "request_id": "ed648ab5-f1aa-4e5a-b2c9-dc2f7545bcca"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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