# Hydraulic Press & Pascal API
> Pascal's-principle hydraulics as an API, computed locally and deterministically. The press endpoint computes the force multiplication of a hydraulic press, jack or master/slave cylinder: a pressure P = F/A acts equally throughout a connected fluid, so a small input force on a small piston becomes a large output force on a large piston, F2 = F1·A2/A1, with the mechanical advantage A2/A1 — areas given directly or as piston diameters, and the pressure in pascals, bar and psi. The stroke endpoint applies volume conservation, A1·d1 = A2·d2: the big piston moves less the more force it gains, and the work F·d is the same on both sides. The cylinder endpoint gives the push and pull force of a hydraulic cylinder at a pressure, F = P·A on the bore side and F = P·(A_bore − A_rod) on the rod (annulus) side. Everything is computed locally and deterministically, so it is instant and private. Ideal for hydraulics and fluid-power engineering tools, press, jack and lift design, brake and machine apps, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is Pascal-principle force multiplication; for pressure at depth and force on a submerged wall use a hydrostatics API and for pump power use a pump 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/hydraulic-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 25 req/s
- **Mega** ($74/Mo) — 773,000 calls/Mo, 80 req/s

## Endpoints

### Hydraulic

#### `GET /v1/cylinder` — Cylinder push/pull force

**Parameters:**
- `pressure` (query, required, string) — Pressure (Pa) Example: `10000000`
- `bore_diameter` (query, required, string) — Bore diameter (m) Example: `0.05`
- `rod_diameter` (query, optional, string) — Rod diameter for pull force (m) Example: `0.025`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hydraulic-api/v1/cylinder?pressure=10000000&bore_diameter=0.05&rod_diameter=0.025"
```

**Response:**
```json
{
    "data": {
        "formula": "push F = P·A_bore; pull F = P·(A_bore − A_rod).",
        "bore_area_m2": 0.0019634954,
        "pressure_bar": 100,
        "pull_force_n": 14726.215564,
        "push_force_n": 19634.954085,
        "pull_force_kn": 14.72621556,
        "push_force_kn": 19.63495408,
        "rod_diameter_m": 0.025,
        "annulus_area_m2": 0.0014726216,
        "bore_diameter_m": 0.05
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:40.260Z",
        "request_id": "fdc77ebb-6867-4c86-be9c-8c65fdd5498f"
    },
    "status": "ok",
    "message": "Cylinder push/pull force",
    "success": true
}
```

#### `GET /v1/press` — Hydraulic press force multiplication

**Parameters:**
- `input_force` (query, optional, string) — Input force F1 (N) Example: `100`
- `input_area` (query, optional, string) — Input piston area A1 (m²) Example: `0.001`
- `input_diameter` (query, optional, string) — Or input piston diameter (m)
- `output_area` (query, optional, string) — Output piston area A2 (m²) Example: `0.05`
- `output_diameter` (query, optional, string) — Or output piston diameter (m)
- `output_force` (query, optional, string) — Or output force F2 (N) to solve input

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hydraulic-api/v1/press?input_force=100&input_area=0.001&output_area=0.05"
```

**Response:**
```json
{
    "data": {
        "formula": "P = F1/A1; F2 = F1·A2/A1; mechanical advantage = A2/A1.",
        "pressure_pa": 100000,
        "pressure_bar": 1,
        "pressure_kpa": 100,
        "pressure_psi": 14.503774,
        "input_area_m2": 0.001,
        "input_force_n": 100,
        "output_area_m2": 0.05,
        "output_force_n": 5000,
        "mechanical_advantage": 50
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:40.361Z",
        "request_id": "9dbcf564-9284-4cc8-829e-b1253bb936c0"
    },
    "status": "ok",
    "message": "Hydraulic press force multiplication",
    "success": true
}
```

#### `GET /v1/stroke` — Piston travel & work

**Parameters:**
- `input_area` (query, optional, string) — Input area A1 (m²) Example: `0.001`
- `output_area` (query, optional, string) — Output area A2 (m²) Example: `0.05`
- `input_diameter` (query, optional, string) — Or input diameter (m)
- `output_diameter` (query, optional, string) — Or output diameter (m)
- `input_displacement` (query, optional, string) — Input stroke d1 (m) Example: `0.1`
- `output_displacement` (query, optional, string) — Or output stroke d2 (m)
- `input_force` (query, optional, string) — Input force (N) for work

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hydraulic-api/v1/stroke?input_area=0.001&output_area=0.05&input_displacement=0.1"
```

**Response:**
```json
{
    "data": {
        "formula": "A1·d1 = A2·d2; the output moves less the more force it gains.",
        "input_area_m2": 0.001,
        "output_area_m2": 0.05,
        "displacement_ratio": 0.02,
        "volume_displaced_m3": 0.0001,
        "input_displacement_m": 0.1,
        "output_displacement_m": 0.002,
        "volume_displaced_litres": 0.1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:40.456Z",
        "request_id": "ab66fd50-32e9-492a-8fb1-e16bea63d184"
    },
    "status": "ok",
    "message": "Piston travel & work",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "hydraulic",
        "note": "Pascal's-principle hydraulics (press, stroke, cylinder) — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/press",
            "/v1/stroke",
            "/v1/cylinder",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:40.554Z",
        "request_id": "a0546006-381e-4914-b45d-d5935c8893ae"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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