# Open Channel Flow API
> Open-channel flow maths as an API, computed locally and deterministically with the Manning equation. The flow endpoint computes the discharge and velocity of water in an open channel — rectangular, trapezoidal, triangular or circular (a part-full pipe) — from the flow depth, the channel dimensions, the channel slope and the Manning roughness coefficient n: it works out the flow area, the wetted perimeter and the hydraulic radius, then applies Q = (1/n)·A·R^(2/3)·S^(1/2) and V = Q/A, reporting the discharge in cubic metres per second and hour, litres per second, cubic feet per second and US gallons per minute. The normal-depth endpoint reverses it: given a target discharge it solves for the normal depth by bisection and returns the resulting area, velocity and a discharge check. The roughness endpoint is a reference of typical Manning n values, from smooth PVC (0.009) and concrete (0.013) through earth and gravel to rocky natural streams (0.05); pass a material name or an explicit n. Dimensions are metric (metres by default, or cm, mm, ft, in). Everything is computed locally and deterministically, so it is instant and private. Ideal for civil and drainage engineering tools, stormwater and culvert design, irrigation and hydrology apps, and environmental modelling. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is open-channel (Manning) hydraulics; for full-pipe flow rate from diameter and velocity use a pipe-flow 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/manning-api/..."
```

## Pricing
- **Free** (Free) — 13,735 calls/Mo, 2 req/s
- **Starter** ($15/Mo) — 23,450 calls/Mo, 8 req/s
- **Pro** ($35/Mo) — 284,500 calls/Mo, 20 req/s
- **Mega** ($73/Mo) — 1,465,000 calls/Mo, 50 req/s

## Endpoints

### Channel

#### `GET /v1/flow` — Open-channel discharge & velocity

**Parameters:**
- `shape` (query, optional, string) — rectangular|trapezoidal|triangular|circular Example: `rectangular`
- `depth` (query, required, string) — Flow depth (y) Example: `1`
- `width` (query, optional, string) — Rectangular width / trapezoid bottom width Example: `2`
- `bottom_width` (query, optional, string) — Trapezoid bottom width
- `side_slope` (query, optional, string) — Side slope z (H:V) for trapezoid/triangle
- `diameter` (query, optional, string) — Circular pipe diameter
- `unit` (query, optional, string) — m|cm|mm|ft|in (default m) Example: `m`
- `n` (query, optional, string) — Manning roughness (or material) Example: `0.013`
- `material` (query, optional, string) — concrete|pvc|earth_clean|… (instead of n)
- `slope` (query, optional, string) — Channel slope (m/m) Example: `0.001`
- `slope_percent` (query, optional, string) — Or slope in percent

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/manning-api/v1/flow?shape=rectangular&depth=1&width=2&unit=m&n=0.013&slope=0.001"
```

**Response:**
```json
{
    "data": {
        "unit": "m",
        "shape": "rectangular",
        "slope": 0.001,
        "depth_m": 1,
        "formula": "Q = (1/n)·A·R^(2/3)·S^(1/2), V = Q/A, R = A/P (SI units).",
        "discharge": {
            "l_s": 3064.785,
            "m3_h": 11033.23,
            "m3_s": 3.064785,
            "ft3_s": 108.2319,
            "us_gpm": 48577.8
        },
        "manning_n": 0.013,
        "flow_area_m2": 2,
        "velocity_m_s": 1.5324,
        "roughness_source": "explicit",
        "hydraulic_radius_m": 0.5,
        "wetted_perimeter_m": 4
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.377Z",
        "request_id": "fb976248-9191-43d9-8afd-3f308de17528"
    },
    "status": "ok",
    "message": "Open-channel discharge & velocity",
    "success": true
}
```

#### `GET /v1/normal-depth` — Normal depth for a discharge

**Parameters:**
- `shape` (query, optional, string) — rectangular|trapezoidal|triangular|circular Example: `rectangular`
- `discharge` (query, required, string) — Target discharge (m³/s) Example: `3.06`
- `width` (query, optional, string) — Rectangular width Example: `2`
- `bottom_width` (query, optional, string) — Trapezoid bottom width
- `side_slope` (query, optional, string) — Side slope z
- `diameter` (query, optional, string) — Circular diameter
- `unit` (query, optional, string) — m|cm|mm|ft|in Example: `m`
- `n` (query, optional, string) — Manning roughness (or material) Example: `0.013`
- `material` (query, optional, string) — Material instead of n
- `slope` (query, optional, string) — Channel slope (m/m) Example: `0.001`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/manning-api/v1/normal-depth?shape=rectangular&discharge=3.06&width=2&unit=m&n=0.013&slope=0.001"
```

**Response:**
```json
{
    "data": {
        "note": "Normal depth solved by bisection on Manning's equation; discharge_check should match the target.",
        "unit": "m",
        "shape": "rectangular",
        "slope": 0.001,
        "manning_n": 0.013,
        "flow_area_m2": 1.99766,
        "velocity_m_s": 1.5318,
        "normal_depth_m": 0.99883,
        "discharge_check": {
            "l_s": 3060,
            "m3_h": 11016,
            "m3_s": 3.06,
            "ft3_s": 108.0629,
            "us_gpm": 48502
        },
        "roughness_source": "explicit",
        "hydraulic_radius_m": 0.49971,
        "target_discharge_m3_s": 3.06
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.463Z",
        "request_id": "b6974b09-b314-440a-b8e9-54611f94da0f"
    },
    "status": "ok",
    "message": "Normal depth for a target discharge",
    "success": true
}
```

#### `GET /v1/roughness` — Manning roughness reference

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

**Response:**
```json
{
    "data": {
        "note": "Typical Manning roughness coefficients n. Pass material=<name> or an explicit n to the flow/normal-depth endpoints.",
        "manning_n": {
            "pvc": 0.009,
            "brick": 0.015,
            "glass": 0.01,
            "steel": 0.012,
            "gravel": 0.025,
            "riprap": 0.035,
            "plastic": 0.009,
            "concrete": 0.013,
            "cast_iron": 0.013,
            "earth_clean": 0.022,
            "earth_weedy": 0.035,
            "earth_gravel": 0.025,
            "natural_stream": 0.035,
            "smooth_concrete": 0.012,
            "corrugated_metal": 0.024,
            "finished_concrete": 0.012,
            "natural_stream_rocky": 0.05
        }
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.543Z",
        "request_id": "7f109609-21b5-477a-a743-727f5a7c9f7a"
    },
    "status": "ok",
    "message": "Manning roughness reference",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "manning",
        "note": "Open-channel (Manning) flow maths — computed locally and deterministically, no key, no third-party service. SI form.",
        "shapes": [
            "rectangular",
            "trapezoidal",
            "triangular",
            "circular"
        ],
        "endpoints": [
            "/v1/flow",
            "/v1/normal-depth",
            "/v1/roughness",
            "/v1/meta"
        ],
        "length_units": [
            "m",
            "cm",
            "mm",
            "ft",
            "in"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:08.636Z",
        "request_id": "62e45cd6-a6d0-4d80-b60e-1300589b15a0"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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