# Septic System API
> Septic-system sizing as an API, computed locally and deterministically with the typical US onsite-wastewater rules of thumb. The flow endpoint estimates the design wastewater flow for a home from its number of bedrooms (assuming two people per bedroom) or an explicit occupancy, at a default 60 gallons per person per day, returning the daily flow in US gallons and litres. The tank endpoint recommends a septic tank size as the larger of a retention-based size (flow × retention days, default two days) and the typical bedroom-based code minimum (≤3 bedrooms 1,000, 4 bedrooms 1,200, 5 bedrooms 1,500, 6 bedrooms 2,000 US gallons), and tells you which one governs. The drainfield endpoint sizes the soil absorption (leach) field: it divides the daily flow by a soil loading rate — given directly or looked up from a percolation rate in minutes per inch — to get the absorption area, then divides by the trench width to get the trench length, in both imperial and metric. Everything is computed locally and deterministically, so it is instant and private. An estimating aid, not a code-stamped design — always confirm with your local health authority. Ideal for plumbing and septic-installer tools, rural real-estate and land apps, home-building and permitting calculators, and inspection software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is septic / onsite-wastewater sizing; for storage-tank volume and fill level use a tank 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/septic-api/..."
```

## Pricing
- **Free** (Free) — 13,635 calls/Mo, 2 req/s
- **Starter** ($15/Mo) — 23,350 calls/Mo, 8 req/s
- **Pro** ($35/Mo) — 283,500 calls/Mo, 20 req/s
- **Mega** ($73/Mo) — 1,460,000 calls/Mo, 50 req/s

## Endpoints

### Septic

#### `GET /v1/drainfield` — Drain field area & trench

**Parameters:**
- `bedrooms` (query, optional, string) — Bedrooms (for flow) Example: `3`
- `daily_flow` (query, optional, string) — Or explicit flow (gpd)
- `perc_rate` (query, optional, string) — Percolation (minutes/inch) Example: `20`
- `loading_rate` (query, optional, string) — Or soil loading rate (gpd/ft²)
- `trench_width_ft` (query, optional, string) — Trench width (ft, default 2) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/septic-api/v1/drainfield?bedrooms=3&perc_rate=20&trench_width_ft=2"
```

**Response:**
```json
{
    "data": {
        "note": "Absorption area = daily flow ÷ soil loading rate. Loading rate from perc: ≤5→1.2, ≤10→1.0, ≤15→0.8, ≤30→0.6, ≤45→0.5, ≤60→0.4 gpd/ft². Trench length = area ÷ trench width.",
        "daily_flow": {
            "litres": 1362.7,
            "us_gallons": 360
        },
        "trench_length": {
            "m": 91.44,
            "ft": 300
        },
        "loading_source": "perc 20 min/in",
        "absorption_area": {
            "m2": 55.74,
            "ft2": 600
        },
        "trench_width_ft": 2,
        "loading_rate_gpd_ft2": 0.6
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.868Z",
        "request_id": "bccd4bda-7185-45e5-b040-53a7f430374d"
    },
    "status": "ok",
    "message": "Drain field area & trench length",
    "success": true
}
```

#### `GET /v1/flow` — Daily wastewater flow

**Parameters:**
- `bedrooms` (query, optional, string) — Number of bedrooms Example: `3`
- `occupants` (query, optional, string) — Or number of occupants
- `per_person_gpd` (query, optional, string) — Gallons per person per day (default 60)
- `daily_flow` (query, optional, string) — Or an explicit flow (gpd)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/septic-api/v1/flow?bedrooms=3"
```

**Response:**
```json
{
    "data": {
        "note": "Estimated design flow. Default 60 gpd/person; bedrooms assume 2 persons each. Local codes vary — check your jurisdiction.",
        "basis": "3 bedrooms × 2 persons × 60 gpd",
        "daily_flow": {
            "litres": 1362.7,
            "us_gallons": 360
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.948Z",
        "request_id": "3bea25c7-70ea-4bb1-88fe-ff73e609061c"
    },
    "status": "ok",
    "message": "Daily wastewater flow estimate",
    "success": true
}
```

#### `GET /v1/tank` — Recommended septic tank size

**Parameters:**
- `bedrooms` (query, optional, string) — Bedrooms (for code minimum) Example: `3`
- `occupants` (query, optional, string) — Or occupants
- `daily_flow` (query, optional, string) — Or explicit flow (gpd)
- `retention_days` (query, optional, string) — Retention days (default 2) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/septic-api/v1/tank?bedrooms=3&retention_days=2"
```

**Response:**
```json
{
    "data": {
        "note": "Recommended = larger of (flow × retention days) and the typical bedroom-based minimum. Standard minimums: ≤3 BR 1000, 4 BR 1200, 5 BR 1500, 6 BR 2000 US gal.",
        "bedrooms": 3,
        "governing": "bedroom_minimum",
        "daily_flow": {
            "litres": 1362.7,
            "us_gallons": 360
        },
        "retention_days": 2,
        "bedroom_minimum": {
            "litres": 3785.4,
            "us_gallons": 1000
        },
        "retention_based_size": {
            "litres": 2725.5,
            "us_gallons": 720
        },
        "recommended_tank_size": {
            "litres": 3785.4,
            "us_gallons": 1000
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:09.043Z",
        "request_id": "a76e2ffc-4cab-4ac6-ab60-f1aba866adde"
    },
    "status": "ok",
    "message": "Recommended septic tank size",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "septic",
        "note": "Septic system sizing — typical US onsite-wastewater rules of thumb, computed locally and deterministically. An estimating aid, not a code-stamped design; always confirm with the local health authority.",
        "defaults": {
            "per_person_gpd": 60,
            "retention_days": 2,
            "trench_width_ft": 2,
            "persons_per_bedroom": 2
        },
        "endpoints": [
            "/v1/flow",
            "/v1/tank",
            "/v1/drainfield",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:09.143Z",
        "request_id": "5498524a-6e2a-4c25-9912-f9ef7cdb8d1c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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