# Valve Flow Coefficient API
> Control-valve flow-coefficient (Cv / Kv) maths as an API, computed locally and deterministically. The liquid endpoint sizes a control valve for liquid service using Q = Kv·√(ΔP/SG): give any two of the flow rate (m³/h), the pressure drop across the valve (bar) and the flow coefficient Kv, and it returns the third — the required Kv to size a valve, the flow a valve passes, or the pressure drop it develops — together with the equivalent Cv. The convert endpoint converts between the three flow coefficients in use around the world: the metric Kv, the US Cv = 1.156·Kv, and the SI Av = 2.4e-5·Cv. The opening endpoint computes how far a valve must open to pass an operating Kv against its rated Kvs, for both a linear trim (opening = Kv/Kvs) and an equal-percentage trim (opening = 1 + ln(Kv/Kvs)/ln(R) for a rangeability R), so you can keep the valve in its controllable 20–80 % travel band. Everything is computed locally and deterministically, so it is instant and private. Ideal for process, instrumentation and HVAC engineering tools, control-valve selection and commissioning, hydronic-balancing and plant-design apps, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is control-valve sizing; for pump power and head use a pump API and for orifice-plate metering use an orifice 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/valveflow-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 15,000 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 80,000 calls/Mo, 16 req/s
- **Mega** ($74/Mo) — 450,000 calls/Mo, 40 req/s

## Endpoints

### Valve

#### `GET /v1/convert` — Cv / Kv / Av conversion

**Parameters:**
- `kv` (query, optional, string) — Metric flow coefficient Kv Example: `10`
- `cv` (query, optional, string) — Or US flow coefficient Cv

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/valveflow-api/v1/convert?kv=10"
```

**Response:**
```json
{
    "data": {
        "cv": 11.56,
        "kv": 10,
        "note": "Cv = 1.156·Kv (Cv in US gpm/√psi, Kv in m³/h/√bar). Av = 2.4e-5·Cv (m²) is the SI flow coefficient.",
        "av_m2": 0.00027744,
        "inputs": {
            "kv": 10
        }
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.786Z",
        "request_id": "753ad63a-55bc-4b92-b757-d9fd53f1db28"
    },
    "status": "ok",
    "message": "Cv/Kv conversion",
    "success": true
}
```

#### `GET /v1/liquid` — Liquid valve sizing

**Parameters:**
- `flow` (query, optional, string) — Flow rate Q (m³/h) Example: `10`
- `pressure_drop` (query, optional, string) — Pressure drop ΔP (bar) Example: `2`
- `kv` (query, optional, string) — Flow coefficient Kv
- `specific_gravity` (query, optional, string) — Specific gravity (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/valveflow-api/v1/liquid?flow=10&pressure_drop=2&specific_gravity=1"
```

**Response:**
```json
{
    "data": {
        "cv": 8.17415,
        "kv": 7.07107,
        "mode": "solve_kv",
        "note": "Kv = Q/√(ΔP/SG). Required flow coefficient for the duty; pick a valve whose Kvs exceeds this.",
        "inputs": {
            "flow": 10,
            "pressure_drop": 2,
            "specific_gravity": 1
        }
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:25.892Z",
        "request_id": "1cfef2f8-0cb9-4ef3-8403-91bd67482c36"
    },
    "status": "ok",
    "message": "Liquid valve sizing",
    "success": true
}
```

#### `GET /v1/opening` — Required valve opening

**Parameters:**
- `rated_kv` (query, required, string) — Rated Kvs (fully open) Example: `20`
- `operating_kv` (query, required, string) — Operating Kv at duty Example: `7.07`
- `rangeability` (query, optional, string) — Equal-% rangeability R (default 50) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/valveflow-api/v1/opening?rated_kv=20&operating_kv=7.07&rangeability=50"
```

**Response:**
```json
{
    "data": {
        "note": "Linear opening = Kv/Kvs. Equal-percentage opening = 1 + ln(Kv/Kvs)/ln(R). Aim for 20–80 % travel at normal flow.",
        "inputs": {
            "rated_kv": 20,
            "operating_kv": 7.07,
            "rangeability": 50
        },
        "kv_ratio": 0.3535,
        "linear_opening_percent": 35.35,
        "equal_percentage_opening_percent": 73.4186
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:26.001Z",
        "request_id": "d90a89cb-4cd6-4e62-a3b9-33599f939f23"
    },
    "status": "ok",
    "message": "Valve opening",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Flow in m³/h, pressure drop in bar, specific gravity relative to water. Turbulent, non-choked liquid flow; flashing, cavitation and gas/steam sizing are not covered.",
        "service": "valveflow-api",
        "formulae": {
            "sizing": "Q = Kv·√(ΔP/SG),  Kv = Q/√(ΔP/SG),  ΔP = SG·(Q/Kv)²",
            "opening": "linear = Kv/Kvs,  equal-% = 1 + ln(Kv/Kvs)/ln(R)",
            "conversion": "Cv = 1.156·Kv,  Av = 2.4e-5·Cv"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/liquid": "Liquid valve sizing: solve Kv, flow or pressure drop from the other two.",
            "GET /v1/convert": "Convert between the Cv, Kv and Av flow coefficients.",
            "GET /v1/opening": "Required valve opening (%) for an operating Kv against the rated Kvs."
        },
        "description": "Control-valve flow-coefficient calculator: liquid Cv/Kv sizing, Cv↔Kv↔Av conversion, and required valve opening for linear and equal-percentage trims."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:26.122Z",
        "request_id": "fbf75516-5e87-4e66-a4d0-06a292d5ab8a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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