# Wallpaper Calculator API
> Wallpaper-estimating maths as an API, computed locally and deterministically. The rolls endpoint uses the proper drop method: it works out how many full-height drops come from each roll, floor(roll length ÷ (wall height + pattern repeat)), how many drops the room perimeter needs, ceil(perimeter ÷ roll width), and from those the rolls required — so a larger pattern repeat correctly increases the count. The simple endpoint gives a quick area-based estimate, rolls = ceil(wall area·(1+waste) ÷ roll coverage), handy for plain papers. The cost endpoint totals the project from the rolls and price per roll plus the adhesive, with one tub of paste hanging about five rolls. The standard roll of 10.05 m × 0.53 m is assumed unless you override it. Everything is computed locally and deterministically, so it is instant and private. Ideal for home-decor, renovation and trade app developers, DIY and room-planning tools, and decorator and retailer calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is wallpaper estimation; for wall paint use a paint API and for floor tiles 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/wallpaper-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 15,000 calls/Mo, 5 req/s
- **Pro** ($12/Mo) — 80,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 400,000 calls/Mo, 40 req/s

## Endpoints

### Wallpaper

#### `GET /v1/cost` — Project cost

**Parameters:**
- `rolls` (query, required, string) — Number of rolls Example: `8`
- `price_per_roll` (query, required, string) — Price per roll Example: `25`
- `paste_price` (query, optional, string) — Price per tub of paste Example: `10`
- `rolls_per_tub` (query, optional, string) — Rolls per tub (default 5) Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wallpaper-api/v1/cost?rolls=8&price_per_roll=25&paste_price=10&rolls_per_tub=5"
```

**Response:**
```json
{
    "data": {
        "note": "Total = rolls × price + paste tubs × paste price. One tub of paste hangs ~5 rolls.",
        "inputs": {
            "rolls": 8,
            "paste_price": 10,
            "rolls_per_tub": 5,
            "price_per_roll": 25
        },
        "paper_cost": 200,
        "paste_cost": 20,
        "paste_tubs": 2,
        "total_cost": 220
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:17.497Z",
        "request_id": "d2d7b2eb-15e2-49fd-8b8d-71b0603a61b7"
    },
    "status": "ok",
    "message": "Project cost",
    "success": true
}
```

#### `GET /v1/rolls` — Rolls (drop method)

**Parameters:**
- `perimeter` (query, optional, string) — Room perimeter (m) Example: `16`
- `length` (query, optional, string) — Or room length (m)
- `width` (query, optional, string) — and room width (m)
- `wall_height` (query, required, string) — Wall height (m) Example: `2.4`
- `roll_length` (query, optional, string) — Roll length (m, default 10.05) Example: `10.05`
- `roll_width` (query, optional, string) — Roll width (m, default 0.53) Example: `0.53`
- `pattern_repeat` (query, optional, string) — Pattern repeat (m, default 0) Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wallpaper-api/v1/rolls?perimeter=16&wall_height=2.4&roll_length=10.05&roll_width=0.53&pattern_repeat=0"
```

**Response:**
```json
{
    "data": {
        "note": "Drop method: drops/roll = floor(roll_length/(height+repeat)); a larger pattern repeat wastes more and needs more rolls.",
        "inputs": {
            "perimeter": 16,
            "roll_width": 0.53,
            "roll_length": 10.05,
            "wall_height": 2.4,
            "pattern_repeat": 0
        },
        "total_drops": 31,
        "rolls_needed": 8,
        "drops_per_roll": 4
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:17.590Z",
        "request_id": "8539b9a9-4549-4556-962b-3f4280b34bbb"
    },
    "status": "ok",
    "message": "Rolls (drop method)",
    "success": true
}
```

#### `GET /v1/simple` — Rolls (area method)

**Parameters:**
- `wall_area` (query, optional, string) — Wall area (m²) Example: `38.4`
- `perimeter` (query, optional, string) — Or perimeter (m)
- `wall_height` (query, optional, string) — and wall height (m)
- `roll_length` (query, optional, string) — Roll length (m, default 10.05) Example: `10.05`
- `roll_width` (query, optional, string) — Roll width (m, default 0.53) Example: `0.53`
- `waste_percent` (query, optional, string) — Waste % (default 15) Example: `15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wallpaper-api/v1/simple?wall_area=38.4&roll_length=10.05&roll_width=0.53&waste_percent=15"
```

**Response:**
```json
{
    "data": {
        "note": "Area method: rolls = ceil(area·(1+waste) / roll coverage). Patterned papers need ~15 % waste; plain ones less.",
        "inputs": {
            "wall_area": 38.4,
            "roll_width": 0.53,
            "roll_length": 10.05,
            "waste_percent": 15
        },
        "rolls_needed": 9,
        "roll_coverage_m2": 5.3265
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:17.693Z",
        "request_id": "10175faa-38fb-4ced-bfb1-56d6d350cec7"
    },
    "status": "ok",
    "message": "Rolls (area method)",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Lengths in m, area in m². Standard roll 10.05 m × 0.53 m. The drop method is more accurate for patterned papers; round up and keep a spare roll.",
        "service": "wallpaper-api",
        "formulae": {
            "area": "ceil(area·(1+waste) / (roll_length·roll_width))",
            "rolls": "ceil(ceil(perimeter/roll_width) / drops_per_roll)",
            "drops_per_roll": "floor(roll_length / (height + repeat))"
        },
        "endpoints": {
            "GET /v1/cost": "Project cost from rolls, price per roll and adhesive.",
            "GET /v1/meta": "This document.",
            "GET /v1/rolls": "Rolls needed by the drop method, accounting for wall height and pattern repeat.",
            "GET /v1/simple": "Quick area-based roll estimate with a waste allowance."
        },
        "description": "Wallpaper estimator: rolls by the drop method (with pattern repeat), a quick area-based estimate, and project cost."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:17.839Z",
        "request_id": "1acb4915-0434-4222-ac94-86a03d8e6dab"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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