# Dough Calculator API
> Pizza and bread dough maths as an API, built on baker's percentages — where the flour is always 100% and every other ingredient is expressed as a percentage of the flour weight. The dough endpoint computes a full recipe in grams (flour, water, salt, yeast, oil and sugar) from a target quantity — either a number of dough balls and a ball weight, a total dough weight, or a flour weight — together with a hydration and salt/yeast percentages, or a built-in style preset (Neapolitan, New York, Detroit, Sicilian, focaccia, ciabatta, baguette, sandwich). The hydration endpoint converts between flour, water and hydration percentage and classifies the dough from stiff to extremely wet. The presets endpoint returns the common dough styles as baker's percentages with typical ball weights. Everything is computed locally and deterministically, so it is instant and private. The yeast figure is instant dry yeast (use roughly three times as much fresh). Ideal for recipe and baking apps, pizzeria and bakery tools, meal-planning and kitchen-scale integrations, and food blogs. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is dough formulation by baker's percentage; for ingredient volume-to-weight and oven-temperature 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/dough-api/..."
```

## Pricing
- **Free** (Free) — 10,435 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 20,050 calls/Mo, 8 req/s
- **Pro** ($32/Mo) — 250,500 calls/Mo, 20 req/s
- **Mega** ($70/Mo) — 1,295,000 calls/Mo, 50 req/s

## Endpoints

### Dough

#### `GET /v1/dough` — Full dough recipe (grams)

**Parameters:**
- `balls` (query, optional, string) — Number of dough balls Example: `4`
- `ball_weight` (query, optional, string) — Grams per ball Example: `250`
- `total_dough` (query, optional, string) — Or total dough grams
- `flour` (query, optional, string) — Or flour grams
- `style` (query, optional, string) — neapolitan|newyork|detroit|focaccia|… Example: `neapolitan`
- `hydration` (query, optional, string) — Water % (overrides style) Example: `60`
- `salt` (query, optional, string) — Salt % Example: `2.5`
- `yeast` (query, optional, string) — Yeast % Example: `0.3`
- `oil` (query, optional, string) — Oil %
- `sugar` (query, optional, string) — Sugar %

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dough-api/v1/dough?balls=4&ball_weight=250&style=neapolitan&hydration=60&salt=2.5&yeast=0.3"
```

**Response:**
```json
{
    "data": {
        "note": "Baker's percentages: flour = 100%, others relative to flour. Yeast shown is instant dry yeast; use ~3× for fresh.",
        "input": {
            "style": "neapolitan",
            "percentages": {
                "oil": 0,
                "salt": 2.5,
                "flour": 100,
                "sugar": 0,
                "water": 60,
                "yeast": 0.3
            }
        },
        "ingredients_grams": {
            "oil": 0,
            "salt": 15.4,
            "flour": 614.3,
            "sugar": 0,
            "water": 368.6,
            "yeast": 1.84
        },
        "total_dough_grams": 1000
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:21.301Z",
        "request_id": "5d3c2ca1-6732-4da9-b188-7c034af544b5"
    },
    "status": "ok",
    "message": "Dough recipe",
    "success": true
}
```

#### `GET /v1/hydration` — Flour / water / hydration

**Parameters:**
- `flour` (query, optional, string) — Flour grams Example: `1000`
- `water` (query, optional, string) — Water grams Example: `650`
- `hydration` (query, optional, string) — Or hydration %

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dough-api/v1/hydration?flour=1000&water=650"
```

**Response:**
```json
{
    "data": {
        "note": "Hydration = water ÷ flour × 100 (by weight).",
        "flour_grams": 1000,
        "water_grams": 650,
        "classification": "standard",
        "hydration_percent": 65
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:21.387Z",
        "request_id": "a276ab6c-2184-4076-9c26-40586fc011f4"
    },
    "status": "ok",
    "message": "Hydration conversion",
    "success": true
}
```

#### `GET /v1/presets` — Dough style presets

**Parameters:**
- `style` (query, optional, string) — One style, or omit for all Example: `neapolitan`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dough-api/v1/presets?style=neapolitan"
```

**Response:**
```json
{
    "data": {
        "note": "Baker's percentages plus a typical ball weight (grams).",
        "style": "neapolitan",
        "percentages": {
            "oil": 0,
            "ball": 250,
            "salt": 2.8,
            "flour": 100,
            "sugar": 0,
            "yeast": 0.2,
            "hydration": 60
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:21.479Z",
        "request_id": "52e1a257-b53d-42aa-befe-4f0000206aea"
    },
    "status": "ok",
    "message": "Style presets",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "Baker's percentages: flour is 100%, every other ingredient is a percent of the flour weight.",
        "styles": [
            "neapolitan",
            "newyork",
            "detroit",
            "sicilian",
            "focaccia",
            "ciabatta",
            "baguette",
            "sandwich"
        ],
        "service": "dough",
        "endpoints": {
            "/v1/dough": "Flour, water, salt, yeast, oil and sugar (grams) from balls/total dough and hydration or a style preset.",
            "/v1/presets": "Common dough styles (Neapolitan, NY, ciabatta, focaccia…) as baker's percentages.",
            "/v1/hydration": "Convert between flour, water and hydration percent, with a wetness classification."
        },
        "description": "Dough maths by baker's percentages: full pizza/bread recipe from a target quantity, hydration conversion, and style presets."
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:21.567Z",
        "request_id": "48f19a40-8d5f-44ed-ba0b-0ef0ba7d9267"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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