# Pressure Vessel API
> Thin-walled pressure-vessel engineering maths as an API, computed locally and deterministically. The thin-wall endpoint computes the wall stresses in a cylindrical or spherical vessel under internal pressure: for a cylinder the hoop (circumferential) stress σ_h = p·r/t and the longitudinal stress σ_l = p·r/(2t), which is half the hoop — so cylinders tend to split along their length — together with the von Mises equivalent stress, and for a sphere the single biaxial stress σ = p·r/(2t); it also reports the radius-to-thickness ratio and whether the thin-wall assumption (r/t ≳ 10) holds. The thickness endpoint computes the wall thickness required to keep the hoop stress within an allowable value, t = p·r/(σ_allow·E), with a weld-joint efficiency factor. The burst endpoint computes the theoretical burst pressure of a pipe from Barlow's formula, p = 2·S·t/OD, using the ultimate tensile strength. Pressures and stresses are in pascals (megapascals also returned) and dimensions in metres. Everything is computed locally and deterministically, so it is instant and private. Ideal for mechanical, chemical-plant, piping, boiler and tank-design app developers, ASME-style sizing and safety tools, and engineering education; for code work consult the applicable standards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is thin-walled vessel stress; for general stress transformation use a Mohr-circle API and for fatigue a fatigue 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/pressurevessel-api/..."
```

## Pricing
- **Free** (Free) — 2,350 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 37,500 calls/Mo, 6 req/s
- **Pro** ($26/Mo) — 247,000 calls/Mo, 15 req/s
- **Mega** ($79/Mo) — 1,660,000 calls/Mo, 40 req/s

## Endpoints

### PressureVessel

#### `GET /v1/burst` — Barlow burst pressure

**Parameters:**
- `ultimate_strength` (query, required, string) — Ultimate tensile strength (Pa) Example: `400000000`
- `thickness` (query, required, string) — Wall thickness (m) Example: `0.01`
- `outer_diameter` (query, required, string) — Outer diameter (m) Example: `1.02`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pressurevessel-api/v1/burst?ultimate_strength=400000000&thickness=0.01&outer_diameter=1.02"
```

**Response:**
```json
{
    "data": {
        "note": "Barlow's formula p = 2·S·t/OD gives the theoretical burst pressure of a thin-walled pipe using the ultimate tensile strength. Apply a design factor for the working pressure.",
        "inputs": {
            "thickness_m": 0.01,
            "outer_diameter_m": 1.02,
            "ultimate_strength_pa": 400000000
        },
        "burst_pressure_pa": 7843137.2549,
        "burst_pressure_bar": 78.4314,
        "burst_pressure_mpa": 7.843137
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:27.601Z",
        "request_id": "24ed00a5-53b9-4a54-9891-334329c8234e"
    },
    "status": "ok",
    "message": "Burst pressure",
    "success": true
}
```

#### `GET /v1/thickness` — Required thickness

**Parameters:**
- `pressure` (query, required, string) — Internal pressure (Pa) Example: `2000000`
- `radius` (query, required, string) — Inner radius (m) Example: `0.5`
- `allowable_stress` (query, required, string) — Allowable stress (Pa) Example: `120000000`
- `joint_efficiency` (query, optional, string) — Weld-joint efficiency (0–1) Example: `1`
- `shape` (query, optional, string) — cylinder or sphere Example: `cylinder`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pressurevessel-api/v1/thickness?pressure=2000000&radius=0.5&allowable_stress=120000000&joint_efficiency=1&shape=cylinder"
```

**Response:**
```json
{
    "data": {
        "note": "Required cylinder thickness t = p·r/(σ_allow·E) (hoop stress governs). E is the weld-joint efficiency.",
        "inputs": {
            "shape": "cylinder",
            "radius_m": 0.5,
            "pressure_pa": 2000000,
            "joint_efficiency": 1,
            "allowable_stress_pa": 120000000
        },
        "required_thickness_m": 0.00833333,
        "required_thickness_mm": 8.33333
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:27.721Z",
        "request_id": "d5c3009b-67d1-48c9-b6b7-4caa8ae9b8f1"
    },
    "status": "ok",
    "message": "Required thickness",
    "success": true
}
```

#### `GET /v1/thin-wall` — Thin-wall stress

**Parameters:**
- `pressure` (query, required, string) — Internal pressure (Pa) Example: `2000000`
- `radius` (query, required, string) — Inner radius (m) Example: `0.5`
- `thickness` (query, required, string) — Wall thickness (m) Example: `0.01`
- `shape` (query, optional, string) — cylinder or sphere Example: `cylinder`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pressurevessel-api/v1/thin-wall?pressure=2000000&radius=0.5&thickness=0.01&shape=cylinder"
```

**Response:**
```json
{
    "data": {
        "note": "Thin-walled cylinder: hoop (circumferential) stress σ_h = p·r/t is twice the longitudinal σ_l = p·r/(2t), so cylinders fail along their length. Thin-wall theory assumes r/t ≳ 10.",
        "inputs": {
            "shape": "cylinder",
            "radius_m": 0.5,
            "pressure_pa": 2000000,
            "thickness_m": 0.01
        },
        "hoop_stress_pa": 100000000,
        "hoop_stress_mpa": 100,
        "thin_wall_valid": true,
        "von_mises_stress_mpa": 86.60254,
        "longitudinal_stress_pa": 50000000,
        "longitudinal_stress_mpa": 50,
        "radius_to_thickness_ratio": 50
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:27.820Z",
        "request_id": "d5d779d4-18f4-4a09-b546-53cb091b453f"
    },
    "status": "ok",
    "message": "Thin-wall stress",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Pressure and stresses in Pa (MPa also returned), radius/thickness/diameter in m. Thin-wall theory assumes r/t ≳ 10. Joint efficiency E defaults to 1.",
        "service": "pressurevessel-api",
        "formulae": {
            "hoop": "σ_h = p·r/t",
            "barlow": "p = 2·S·t/OD",
            "thickness": "t = p·r/(σ_allow·E)",
            "longitudinal": "σ_l = p·r/(2t)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/burst": "Barlow burst pressure from ultimate strength, thickness and outer diameter.",
            "GET /v1/thickness": "Required wall thickness for an allowable stress and joint efficiency.",
            "GET /v1/thin-wall": "Hoop, longitudinal and von Mises stress from pressure, radius and thickness."
        },
        "description": "Thin-walled pressure-vessel calculator: hoop and longitudinal stress in a cylinder or sphere, the required wall thickness for an allowable stress, and the Barlow burst pressure."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:27.909Z",
        "request_id": "258cbf49-3231-4c25-a7d8-1b0ec1c327d7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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