# Orifice Flow Meter API
> Differential-pressure flow-meter maths (ISO 5167) as an API, computed locally and deterministically for orifice plates, venturi tubes and flow nozzles. The flow endpoint computes the mass and volumetric flow rate from the measured pressure drop across the meter, qm = Cd·ε·E·A·√(2·ρ·ΔP), where E = 1/√(1−β⁴) is the velocity-of-approach factor, β = d/D the diameter ratio and A the bore area — and it reports the throat velocity and the permanent (unrecovered) pressure loss. The pressure endpoint works the other way: from a known flow it returns the differential pressure the meter will develop, ΔP = (qm/(Cd·ε·E·A))²/(2ρ), and the permanent loss. The sizing endpoint solves the meter geometry: from a target flow and an allowable pressure drop it iterates the required bore diameter and diameter ratio, and flags whether β falls in the ISO-recommended 0.2–0.75 range. Each device type carries its standard discharge coefficient (orifice 0.61, venturi 0.984, nozzle 0.96) which you can override. Everything is computed locally and deterministically, so it is instant and private. Ideal for process, HVAC and instrumentation engineering tools, flow-meter selection and commissioning, and fluid-mechanics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is differential-pressure flow metering; for pipe continuity (Q=A·v) use a flow-rate API and for friction pressure drop use a Darcy-Weisbach 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/orifice-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 20,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 1,000,000 calls/Mo, 40 req/s

## Endpoints

### Orifice

#### `GET /v1/flow` — Flow from differential pressure

**Parameters:**
- `type` (query, optional, string) — orifice | venturi | nozzle (default orifice) Example: `orifice`
- `pipe_diameter` (query, required, string) — Pipe inner diameter D (m) Example: `0.1`
- `bore_diameter` (query, optional, string) — Bore/throat diameter d (m) Example: `0.05`
- `beta` (query, optional, string) — Or diameter ratio β = d/D
- `density` (query, optional, string) — Fluid density ρ (kg/m³, default 1000) Example: `1000`
- `discharge_coefficient` (query, optional, string) — Cd override
- `expansibility` (query, optional, string) — Expansibility ε (default 1) Example: `1`
- `differential_pressure` (query, required, string) — Measured pressure drop ΔP (Pa) Example: `10000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/orifice-api/v1/flow?type=orifice&pipe_diameter=0.1&bore_diameter=0.05&density=1000&expansibility=1&differential_pressure=10000"
```

**Response:**
```json
{
    "data": {
        "note": "qm = Cd·ε·E·A·√(2ρΔP) per ISO 5167. Permanent loss is the unrecovered pressure downstream.",
        "inputs": {
            "beta": 0.5,
            "type": "orifice",
            "density": 1000,
            "bore_diameter": 0.05,
            "expansibility": 1,
            "pipe_diameter": 0.1,
            "differential_pressure": 10000,
            "discharge_coefficient": 0.61
        },
        "mass_flow_kg_s": 5.532088,
        "throat_velocity_m_s": 2.817469,
        "volumetric_flow_l_s": 5.532088,
        "volumetric_flow_m3_s": 0.005532088,
        "permanent_pressure_loss_pa": 7307.2754,
        "velocity_of_approach_factor": 1.032796
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:35.626Z",
        "request_id": "ce898623-7381-4a56-b591-65e269b08c2c"
    },
    "status": "ok",
    "message": "Flow from differential pressure",
    "success": true
}
```

#### `GET /v1/pressure` — Differential pressure from flow

**Parameters:**
- `type` (query, optional, string) — orifice | venturi | nozzle (default orifice) Example: `orifice`
- `pipe_diameter` (query, required, string) — Pipe inner diameter D (m) Example: `0.1`
- `bore_diameter` (query, optional, string) — Bore/throat diameter d (m) Example: `0.05`
- `beta` (query, optional, string) — Or diameter ratio β = d/D
- `density` (query, optional, string) — Fluid density ρ (kg/m³, default 1000) Example: `1000`
- `discharge_coefficient` (query, optional, string) — Cd override
- `expansibility` (query, optional, string) — Expansibility ε (default 1) Example: `1`
- `mass_flow` (query, optional, string) — Mass flow qm (kg/s) Example: `5.53`
- `volumetric_flow` (query, optional, string) — Or volumetric flow qv (m³/s)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/orifice-api/v1/pressure?type=orifice&pipe_diameter=0.1&bore_diameter=0.05&density=1000&expansibility=1&mass_flow=5.53"
```

**Response:**
```json
{
    "data": {
        "note": "ΔP = (qm/(Cd·ε·E·A))²/(2ρ). The permanent loss is what the meter costs in unrecovered pressure.",
        "inputs": {
            "beta": 0.5,
            "type": "orifice",
            "density": 1000,
            "mass_flow": 5.53,
            "bore_diameter": 0.05,
            "pipe_diameter": 0.1,
            "discharge_coefficient": 0.61
        },
        "differential_pressure_pa": 9992.4525,
        "differential_pressure_kpa": 9.992453,
        "permanent_pressure_loss_pa": 7301.7602,
        "velocity_of_approach_factor": 1.032796
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:35.723Z",
        "request_id": "7da58b28-73a7-475e-aaee-d8f8ac8c1a30"
    },
    "status": "ok",
    "message": "Pressure from flow",
    "success": true
}
```

#### `GET /v1/sizing` — Bore sizing for a target flow

**Parameters:**
- `type` (query, optional, string) — orifice | venturi | nozzle (default orifice) Example: `orifice`
- `pipe_diameter` (query, required, string) — Pipe inner diameter D (m) Example: `0.1`
- `differential_pressure` (query, required, string) — Allowable pressure drop ΔP (Pa) Example: `10000`
- `mass_flow` (query, optional, string) — Target mass flow qm (kg/s) Example: `5.53`
- `volumetric_flow` (query, optional, string) — Or volumetric flow qv (m³/s)
- `density` (query, optional, string) — Fluid density ρ (kg/m³, default 1000) Example: `1000`
- `discharge_coefficient` (query, optional, string) — Cd override
- `expansibility` (query, optional, string) — Expansibility ε (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/orifice-api/v1/sizing?type=orifice&pipe_diameter=0.1&differential_pressure=10000&mass_flow=5.53&density=1000&expansibility=1"
```

**Response:**
```json
{
    "data": {
        "beta": 0.499912,
        "note": "Bore solved by iteration so it gives the target flow at the allowable ΔP. ISO 5167 recommends 0.2 ≤ β ≤ 0.75 for an orifice.",
        "inputs": {
            "type": "orifice",
            "density": 1000,
            "mass_flow": 5.53,
            "pipe_diameter": 0.1,
            "differential_pressure": 10000,
            "discharge_coefficient": 0.61
        },
        "required_bore_diameter_m": 0.049991,
        "beta_in_recommended_range": true,
        "permanent_pressure_loss_pa": 7308.1337,
        "velocity_of_approach_factor": 1.032771
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:35.838Z",
        "request_id": "7a740d3a-ca17-46df-b519-77e8137b523c"
    },
    "status": "ok",
    "message": "Bore sizing",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "SI units: diameters in metres, pressure in pascals, density in kg/m³, flow in kg/s or m³/s. Default Cd: orifice 0.61, venturi 0.984, nozzle 0.96. ε=1 assumes incompressible flow.",
        "service": "orifice-api",
        "formulae": {
            "beta": "β = d/D",
            "mass_flow": "qm = Cd·ε·E·A·√(2ρΔP),  E = 1/√(1−β⁴),  A = π/4·d²",
            "permanent_loss": "Δϖ = (√(1−β⁴(1−Cd²)) − Cd·β²)/(√(1−β⁴(1−Cd²)) + Cd·β²)·ΔP"
        },
        "endpoints": {
            "GET /v1/flow": "Mass and volumetric flow from the measured differential pressure across the meter.",
            "GET /v1/meta": "This document.",
            "GET /v1/sizing": "Required bore diameter (and beta) for a target flow at an allowable pressure drop.",
            "GET /v1/pressure": "Differential pressure required for a given flow, plus the permanent pressure loss."
        },
        "description": "Differential-pressure flow-meter calculator (ISO 5167) for orifice plates, venturi tubes and flow nozzles: flow from ΔP, ΔP from flow, and bore sizing."
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:35.935Z",
        "request_id": "a1ed82a6-cc59-46e2-8fe7-9fcc0600599e"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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