# Concrete Mix API
> Concrete mix-design maths as an API, computed locally and deterministically. The mix endpoint breaks down a volume of concrete into its materials from a nominal mix ratio (cement:sand:aggregate, for example 1:2:4): it applies the 1.54 dry-volume allowance, then returns the cement in cubic metres, kilograms and 50 kg bags, the sand and aggregate volumes and masses, and the water from the water-cement ratio — the complete batch for the pour. The quantity endpoint computes the concrete volume of a slab, footing, or round or square column from its dimensions, adds a wastage allowance and gives the dry material volume. The watercement endpoint solves the water-cement ratio, the water or the cement from the other two — the single most important number for concrete strength and durability. Densities used are cement 1440, sand 1600 and aggregate 1450 kg/m³, with a 50 kg cement bag. Everything is computed locally and deterministically, so it is instant and private. Ideal for construction, estimating and site-engineering tools, material take-off and ordering, DIY and builder apps, and civil-engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is nominal volume-batch concrete estimating; for retaining-wall earth pressure use an earth-pressure 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/concrete-api/..."
```

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

## Endpoints

### Concrete

#### `GET /v1/mix` — Mix material breakdown

**Parameters:**
- `volume` (query, required, string) — Finished concrete volume (m³) Example: `1`
- `ratio_cement` (query, optional, string) — Cement parts (default 1) Example: `1`
- `ratio_sand` (query, required, string) — Sand parts Example: `2`
- `ratio_aggregate` (query, required, string) — Aggregate parts Example: `4`
- `water_cement_ratio` (query, optional, string) — Water-cement ratio (default 0.5) Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/concrete-api/v1/mix?volume=1&ratio_cement=1&ratio_sand=2&ratio_aggregate=4&water_cement_ratio=0.5"
```

**Response:**
```json
{
    "data": {
        "note": "Dry volume = wet × 1.54. Densities: cement 1440, sand 1600, aggregate 1450 kg/m³; bag = 50 kg. Water = w/c × cement mass.",
        "sand": {
            "mass_kg": 704,
            "volume_m3": 0.44
        },
        "cement": {
            "mass_kg": 316.8,
            "bags_50kg": 6.336,
            "volume_m3": 0.22
        },
        "inputs": {
            "ratio": "1:2:4",
            "volume": 1,
            "water_cement_ratio": 0.5
        },
        "aggregate": {
            "mass_kg": 1276,
            "volume_m3": 0.88
        },
        "water_litres": 158.4,
        "dry_volume_m3": 1.54
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.419Z",
        "request_id": "a5f899e1-6738-4f31-94b5-edf54cce73cc"
    },
    "status": "ok",
    "message": "Concrete mix breakdown",
    "success": true
}
```

#### `GET /v1/quantity` — Concrete volume from a shape

**Parameters:**
- `shape` (query, optional, string) — slab | footing | column | cylinder (default slab) Example: `slab`
- `length` (query, optional, string) — Length (m) for slab/footing Example: `5`
- `width` (query, optional, string) — Width (m) Example: `4`
- `thickness` (query, optional, string) — Thickness (m) Example: `0.15`
- `diameter` (query, optional, string) — Diameter (m) for round column
- `side` (query, optional, string) — Side (m) for square column
- `height` (query, optional, string) — Height (m) for column
- `wastage_percent` (query, optional, string) — Wastage allowance (%, default 5) Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/concrete-api/v1/quantity?shape=slab&length=5&width=4&thickness=0.15&wastage_percent=5"
```

**Response:**
```json
{
    "data": {
        "note": "Net volume from the geometry; wastage adds an allowance. Multiply by 1.54 for the dry material volume.",
        "inputs": {
            "shape": "slab",
            "dimensions": {
                "width": 4,
                "length": 5,
                "thickness": 0.15
            },
            "wastage_percent": 5
        },
        "dry_volume_m3": 4.851,
        "net_volume_m3": 3,
        "volume_with_wastage_m3": 3.15
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.524Z",
        "request_id": "78f34efc-4449-4a8d-ab9d-5be857a373cb"
    },
    "status": "ok",
    "message": "Concrete volume",
    "success": true
}
```

#### `GET /v1/watercement` — Water-cement ratio

**Parameters:**
- `cement_mass` (query, optional, string) — Cement mass (kg) Example: `316.8`
- `water` (query, optional, string) — Water (litres) Example: `158.4`
- `ratio` (query, optional, string) — Water-cement ratio Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/concrete-api/v1/watercement?cement_mass=316.8&water=158.4&ratio=0.5"
```

**Response:**
```json
{
    "data": {
        "mode": "solve_cement",
        "note": "w/c = water/cement. Lower ratios (0.4–0.5) give higher strength but lower workability; 0.45–0.60 is typical.",
        "inputs": {
            "ratio": 0.5,
            "water": 158.4,
            "cement_mass": 316.8
        },
        "bags_50kg": 6.336,
        "cement_mass_kg": 316.8
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.605Z",
        "request_id": "e95f6b13-444e-42dc-93ee-e3bcc36c1ace"
    },
    "status": "ok",
    "message": "Water-cement ratio",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Volume in m³, mass in kg, water in litres. Densities: cement 1440, sand 1600, aggregate 1450 kg/m³; cement bag 50 kg. Nominal volume-batching estimate, not a designed (BS/ACI) mix.",
        "service": "concrete-api",
        "formulae": {
            "water": "water = (w/c)·cement_mass",
            "cement": "cement_vol = dry·c/Σ,  mass = vol×1440,  bags = mass/50",
            "dry_volume": "dry = wet × 1.54"
        },
        "endpoints": {
            "GET /v1/mix": "Cement (bags), sand, aggregate and water for a volume of concrete at a nominal mix ratio.",
            "GET /v1/meta": "This document.",
            "GET /v1/quantity": "Concrete volume from a slab, footing or column, with a wastage allowance.",
            "GET /v1/watercement": "Water-cement ratio: solve water, cement or ratio from the other two."
        },
        "description": "Concrete mix-design calculator: material breakdown from a mix ratio, concrete volume from a shape, and water-cement ratio solving."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.661Z",
        "request_id": "1a1a8696-cb8c-40c3-997d-44d73fb609e4"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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