# Baking Pan Scaler API
> Baking-pan maths as an API, computed locally and deterministically — the area and scale-factor numbers a baker resizes a recipe between pans with. The trick everyone gets wrong is that a recipe scales by the pan’s AREA, not its diameter, so a 10-inch round holds far more batter than a 9-inch. The area endpoint gives the surface area of any pan — round and springform as π/4·d², square as s², rectangle as length × width, and bundt or tube pans as the ring (the outer circle minus the centre hole) — so a 9-inch round is 63.6 in², an 8-inch square 64 and a 9×13 is 117; add a depth and it returns the volume in cubic inches and cups. The convert endpoint gives the scale factor to move a recipe from one pan to another, factor = target area ÷ source area: a 9-inch round to a 9×13 is ×1.84, and two 8-inch rounds really do equal one 9×13. Pass an ingredient amount and it scales it for you, with a note to keep the batter depth similar and adjust the bake time. Everything is computed locally and deterministically, so it is instant and private. Ideal for baking, recipe, meal-prep and kitchen app developers, recipe-scaling and substitution tools, and culinary software. Pure local computation — no key, no third-party service, instant. Inches. Live, nothing stored. 2 compute endpoints. For ingredient unit conversion use a cooking 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/panscale-api/..."
```

## Pricing
- **Free** (Free) — 7,240 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 57,700 calls/Mo, 6 req/s
- **Pro** ($11/Mo) — 237,600 calls/Mo, 15 req/s
- **Mega** ($36/Mo) — 1,366,000 calls/Mo, 40 req/s

## Endpoints

### Pan

#### `GET /v1/area` — Pan area + volume

**Parameters:**
- `shape` (query, required, string) — round, square, rectangle, springform, bundt/tube Example: `round`
- `diameter` (query, optional, string) — Diameter (round/springform/bundt) Example: `9`
- `side` (query, optional, string) — Side (square)
- `length` (query, optional, string) — Length (rectangle)
- `width` (query, optional, string) — Width (rectangle)
- `hole_diameter` (query, optional, string) — Centre hole (bundt/tube)
- `depth` (query, optional, string) — Depth for volume

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/panscale-api/v1/area?shape=round&diameter=9"
```

**Response:**
```json
{
    "data": {
        "pan": "9\" round",
        "note": "Pan area: round/springform π/4·d², square s², rectangle L×W, bundt/tube the ring (outer minus centre hole). Recipes scale by AREA, not diameter — a 10\" round holds far more than a 9\". Add a depth to get its volume.",
        "inputs": {
            "shape": "round"
        },
        "area_sqcm": 410.4,
        "area_sqin": 63.62
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:51.296Z",
        "request_id": "29bb70b2-7300-4406-9dba-e85917e153ec"
    },
    "status": "ok",
    "message": "Pan area",
    "success": true
}
```

#### `GET /v1/convert` — Recipe scale factor between pans

**Parameters:**
- `from_shape` (query, required, string) — Source pan shape Example: `round`
- `from_diameter` (query, optional, string) — Source diameter Example: `9`
- `from_side` (query, optional, string) — Source side
- `from_length` (query, optional, string) — Source length
- `from_width` (query, optional, string) — Source width
- `to_shape` (query, required, string) — Target pan shape Example: `rectangle`
- `to_diameter` (query, optional, string) — Target diameter
- `to_side` (query, optional, string) — Target side
- `to_length` (query, optional, string) — Target length Example: `13`
- `to_width` (query, optional, string) — Target width Example: `9`
- `amount` (query, optional, string) — An ingredient amount to scale

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/panscale-api/v1/convert?from_shape=round&from_diameter=9&to_shape=rectangle&to_length=13&to_width=9"
```

**Response:**
```json
{
    "data": {
        "note": "Multiply every ingredient by the scale factor = target area ÷ source area. Keep the batter depth similar; if it ends up deeper, lower the oven ~25 °F and bake longer, and start checking early. Two 8\" rounds ≈ one 9×13.",
        "inputs": {
            "to": "13×9",
            "from": "9\" round"
        },
        "scale_factor": 1.839,
        "to_area_sqin": 117,
        "from_area_sqin": 63.62
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:51.372Z",
        "request_id": "590d4ac5-1abe-4e14-a033-e2a903224fd8"
    },
    "status": "ok",
    "message": "Pan convert",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Shapes: round, square, rectangle, springform, bundt/tube. Recipes scale by area: factor = target ÷ source area. Inches in; areas in². Keep batter depth similar and adjust bake time. For ingredient unit conversion use a cooking API.",
        "service": "panscale-api",
        "endpoints": {
            "GET /v1/area": "Surface area (and volume with a depth) of a pan.",
            "GET /v1/meta": "This document.",
            "GET /v1/convert": "Scale factor to move a recipe from one pan to another, by area."
        },
        "description": "Baking-pan maths: pan area, the scale factor to convert a recipe between pans, and batter volume/depth."
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:51.470Z",
        "request_id": "aa862a68-d89e-4b6d-bb0f-7731fda896cd"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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