# Vapor Pressure API
> Vapor-pressure thermodynamics as an API, computed locally and deterministically. The clausius-clapeyron endpoint predicts the vapor pressure of a substance at a new temperature from a known reference point and the molar enthalpy of vaporization, using ln(P2/P1) = -ΔHvap/R·(1/T2 - 1/T1) with temperatures in kelvin — so from water boiling at 101.325 kPa at 373.15 K and ΔHvap ≈ 40.66 kJ/mol it returns about 42.6 kPa at 350 K. The enthalpy endpoint inverts the same relation: given two pressure/temperature points it solves for the molar enthalpy of vaporization, ΔHvap = -R·ln(P2/P1)/(1/T2 - 1/T1), in J/mol and kJ/mol. The antoine endpoint evaluates the Antoine equation log10(P) = A - B/(C + T) both ways — supply a temperature to get the vapor pressure, or a pressure to get the boiling temperature — defaulting to the water constants (°C and mmHg, so water reads 760 mmHg at 100 °C) but accepting any A, B, C for other substances. The gas constant R = 8.314462618 J/(mol·K). Everything is computed locally and deterministically, so it is instant and private. Ideal for chemical-engineering, process-simulation, distillation, HVAC, meteorology and chemistry-education app developers, boiling-point and phase-equilibrium tools, and lab software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is vapor pressure and boiling point; for humidity and dew point use a psychrometric API and for ideal-gas state use a gas-law 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/vaporpressure-api/..."
```

## Pricing
- **Free** (Free) — 3,600 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 38,000 calls/Mo, 6 req/s
- **Pro** ($18/Mo) — 182,000 calls/Mo, 15 req/s
- **Mega** ($58/Mo) — 1,120,000 calls/Mo, 40 req/s

## Endpoints

### VaporPressure

#### `GET /v1/antoine` — Antoine equation

**Parameters:**
- `temperature` (query, optional, string) — Temperature (°C) → pressure Example: `100`
- `pressure` (query, optional, string) — Pressure (mmHg) → boiling temp
- `a` (query, optional, string) — Antoine A (default water)
- `b` (query, optional, string) — Antoine B
- `c` (query, optional, string) — Antoine C

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vaporpressure-api/v1/antoine?temperature=100"
```

**Response:**
```json
{
    "data": {
        "mode": "pressure_from_temperature",
        "note": "Antoine: log10(P) = A - B/(C + T). With the default water constants T is in °C and P in mmHg (water boils at 760 mmHg at 100 °C).",
        "inputs": {
            "a": 8.07131,
            "b": 1730.63,
            "c": 233.426,
            "temperature": 100
        },
        "pressure": 760.086369,
        "log10_pressure": 2.88086294,
        "constants_source": "water (default)"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.225Z",
        "request_id": "c73f7863-d7c6-4864-9e5e-d6fd61ae7788"
    },
    "status": "ok",
    "message": "Antoine equation",
    "success": true
}
```

#### `GET /v1/clausius-clapeyron` — Predict vapor pressure

**Parameters:**
- `p1` (query, required, string) — Reference pressure Example: `101325`
- `t1` (query, required, string) — Reference temperature (K) Example: `373.15`
- `t2` (query, required, string) — Target temperature (K) Example: `350`
- `enthalpy` (query, required, string) — Molar enthalpy of vaporization (J/mol) Example: `40660`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vaporpressure-api/v1/clausius-clapeyron?p1=101325&t1=373.15&t2=350&enthalpy=40660"
```

**Response:**
```json
{
    "data": {
        "p2": 42585.151901,
        "note": "Clausius–Clapeyron: ln(P2/P1) = -ΔHvap/R·(1/T2 - 1/T1). Temperatures in kelvin; P2 comes out in the same pressure unit as P1; ΔHvap in J/mol; R = 8.314462618 J/(mol·K).",
        "inputs": {
            "p1": 101325,
            "t1": 373.15,
            "t2": 350,
            "enthalpy": 40660
        },
        "ln_p2_over_p1": -0.86682753
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.338Z",
        "request_id": "9b09aedd-73fb-44ee-9689-99180e1c7d32"
    },
    "status": "ok",
    "message": "Clausius-Clapeyron vapor pressure",
    "success": true
}
```

#### `GET /v1/enthalpy` — Enthalpy of vaporization

**Parameters:**
- `p1` (query, required, string) — Pressure at point 1 Example: `101325`
- `t1` (query, required, string) — Temperature 1 (K) Example: `373.15`
- `p2` (query, required, string) — Pressure at point 2 Example: `42585`
- `t2` (query, required, string) — Temperature 2 (K) Example: `350`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vaporpressure-api/v1/enthalpy?p1=101325&t1=373.15&p2=42585&t2=350"
```

**Response:**
```json
{
    "data": {
        "note": "Two-point Clausius–Clapeyron solved for ΔHvap = -R·ln(P2/P1)/(1/T2 - 1/T1). Temperatures in kelvin, pressures in any consistent unit.",
        "inputs": {
            "p1": 101325,
            "p2": 42585,
            "t1": 373.15,
            "t2": 350
        },
        "enthalpy_j_per_mol": 40660.1673,
        "enthalpy_kj_per_mol": 40.660167
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.454Z",
        "request_id": "7f1f185f-e0df-4ecc-86b5-761d03cd1992"
    },
    "status": "ok",
    "message": "Enthalpy of vaporization",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Clausius–Clapeyron uses kelvin; Antoine defaults to water constants with °C and mmHg. R = 8.314462618 J/(mol·K).",
        "service": "vaporpressure-api",
        "constants": {
            "default_antoine_water": {
                "A": 8.07131,
                "B": 1730.63,
                "C": 233.426
            },
            "gas_constant_j_per_mol_k": 8.314462618
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/antoine": "Antoine equation: temperature→pressure, or pressure→boiling temperature.",
            "GET /v1/enthalpy": "Molar enthalpy of vaporization from two (P,T) points.",
            "GET /v1/clausius-clapeyron": "Predict vapor pressure P2 at T2 from a reference (P1,T1) and ΔHvap."
        },
        "description": "Vapor pressure thermodynamics: Clausius–Clapeyron prediction, enthalpy of vaporization from two points, and the Antoine equation both ways."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.552Z",
        "request_id": "81f716ac-8ced-4f0f-a32d-538dde1ff449"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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