# Leathercraft API
> Leathercraft maths as an API, computed locally and deterministically — the weight, area and strap numbers a leatherworker, saddler or maker cuts a project by. The thickness endpoint handles the quirk that leather “weight” is really a thickness: one ounce equals one sixty-fourth of an inch, or 0.397 mm, so 8 oz leather is 3.18 mm — and it converts in either direction between ounces, millimetres and inches and suggests typical uses, from 2–3 oz linings and wallets up to 9 oz-plus belts and saddlery. The area endpoint converts hide area between the US square foot, the European square decimetre (1 ft² = 9.29 dm²) and square metres, and sizes a project: given the leather a project needs and a waste allowance — 25–40 % is normal because hides have irregular edges and flaws — it returns the usable area and how many hides to buy. The strap endpoint counts straps cut from a rectangular piece (count = ⌊width ÷ strap width⌋, each as long as the piece) or the continuous lace length a spiral cut yields from an area (length = area ÷ width). Everything is computed locally and deterministically, so it is instant and private. Ideal for leatherwork, saddlery, crafting, bag-making and maker app developers, project-estimator and material-cost tools, and workshop software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints.

## 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/leather-api/..."
```

## Pricing
- **Free** (Free) — 6,750 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 57,200 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 233,000 calls/Mo, 15 req/s
- **Mega** ($37/Mo) — 1,346,000 calls/Mo, 40 req/s

## Endpoints

### Leather

#### `GET /v1/area` — Hide area + project yield

**Parameters:**
- `value` (query, required, string) — Area value Example: `50`
- `from` (query, optional, string) — sqft, sqdm or sqm (default sqft) Example: `sqft`
- `project_sqft` (query, optional, string) — Project area to size hides for
- `waste_percent` (query, optional, string) — Waste allowance % (default 30) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/leather-api/v1/area?value=50&from=sqft&waste_percent=30"
```

**Response:**
```json
{
    "data": {
        "note": "Hide area converted between US square feet, EU square decimetres (1 ft² = 9.29 dm²) and m². Pass project_sqft (and waste_percent) to size how many such hides a project needs.",
        "inputs": {
            "from": "sqft",
            "value": 50
        },
        "square_feet": 50,
        "square_meters": 4.645,
        "square_decimeters": 464.52
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:01.526Z",
        "request_id": "8038f48d-d275-4946-a029-80219a939aaa"
    },
    "status": "ok",
    "message": "Hide area",
    "success": true
}
```

#### `GET /v1/strap` — Strap / lace yield

**Parameters:**
- `strap_width` (query, required, string) — Strap/lace width Example: `1`
- `piece_length` (query, optional, string) — Piece length (cut straps) Example: `24`
- `piece_width` (query, optional, string) — Piece width (cut straps) Example: `12`
- `kerf` (query, optional, string) — Blade/gap per cut Example: `0`
- `area_sqft` (query, optional, string) — Area for continuous lace (width in inches)
- `waste_percent` (query, optional, string) — Lace waste % (default 15) Example: `15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/leather-api/v1/strap?strap_width=1&piece_length=24&piece_width=12&kerf=0&waste_percent=15"
```

**Response:**
```json
{
    "data": {
        "note": "Straps cut along the length of a rectangular piece: count = ⌊(width + kerf) ÷ (strap width + kerf)⌋, each as long as the piece. Cut straps along the backbone, not across, for the least stretch.",
        "inputs": {
            "strap_width": 1
        },
        "each_length": 24,
        "piece_width": 12,
        "strap_count": 12,
        "piece_length": 24,
        "total_strap_length": 288
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:01.612Z",
        "request_id": "b7a20368-a1e6-4254-adcf-1af80c6e3eac"
    },
    "status": "ok",
    "message": "Strap yield",
    "success": true
}
```

#### `GET /v1/thickness` — Weight ↔ thickness

**Parameters:**
- `value` (query, required, string) — The value to convert Example: `8`
- `from` (query, optional, string) — oz, mm or in (default oz) Example: `oz`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/leather-api/v1/thickness?value=8&from=oz"
```

**Response:**
```json
{
    "data": {
        "note": "Leather weight IS its thickness: 1 oz = 1/64 inch = 0.397 mm. Leather is often sold in a 2-oz range (e.g. 8-9 oz) because thickness varies across a hide. Quoted weight is per square foot but only depends on thickness.",
        "inches": 0.125,
        "inputs": {
            "from": "oz",
            "value": 8
        },
        "ounces": 8,
        "millimeters": 3.175,
        "typical_use": "belts, straps, holsters",
        "weight_range_oz": "8-8 oz"
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:01.709Z",
        "request_id": "e87e574b-e5d6-4283-af12-a8602b374847"
    },
    "status": "ok",
    "message": "Leather thickness",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Leather weight is thickness: 1 oz = 1/64\" = 0.397 mm. Area in ft² (US), dm² (EU) or m². Budget 25–40 % waste for hides. For tooling stamp sizes or dye coverage use a different tool.",
        "service": "leather-api",
        "endpoints": {
            "GET /v1/area": "Convert hide area (ft²/dm²/m²) and size how many hides a project needs.",
            "GET /v1/meta": "This document.",
            "GET /v1/strap": "Strap count from a piece, or continuous lace length from an area.",
            "GET /v1/thickness": "Convert leather weight (oz) ↔ thickness (mm/inch) with typical uses."
        },
        "description": "Leathercraft maths: leather weight ↔ thickness, hide-area unit conversion with project yield, and strap/lace yield."
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:01.811Z",
        "request_id": "d318771b-e8f6-4d80-af43-c41f6963f351"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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