# Colligative Properties API
> Colligative-properties maths for solutions as an API, computed locally and deterministically. The osmotic endpoint computes the osmotic pressure by the van 't Hoff equation, π = i·M·R·T, from the molarity, the temperature and the van 't Hoff factor (the number of dissolved particles per formula unit — 1 for sugar, 2 for NaCl, 3 for CaCl₂), reported in atmospheres, bar and kilopascals, and also solves the molarity back from a measured pressure. The freezing endpoint computes the freezing-point depression, ΔTf = i·Kf·m, from the molality and the cryoscopic constant (1.86 °C·kg/mol for water), and the new freezing point. The boiling endpoint computes the boiling-point elevation, ΔTb = i·Kb·m, from the ebullioscopic constant (0.512 °C·kg/mol for water), and the new boiling point. Everything is computed locally and deterministically, so it is instant and private. Ideal for chemistry, biology and food-science tools, reverse-osmosis and desalination estimates, antifreeze and de-icing formulation, lab and education apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is colligative-properties chemistry; for solution dilution use a dilution API and for pH and buffers use a pH 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/osmosis-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($15/Mo) — 150,000 calls/Mo, 12 req/s
- **Mega** ($45/Mo) — 765,000 calls/Mo, 30 req/s

## Endpoints

### Colligative

#### `GET /v1/boiling` — Boiling-point elevation

**Parameters:**
- `molality` (query, required, string) — Molality m (mol/kg) Example: `1`
- `kb` (query, optional, string) — Ebullioscopic constant Kb (default 0.512) Example: `0.512`
- `van_t_hoff_factor` (query, optional, string) — van 't Hoff factor i (default 1) Example: `1`
- `solvent_boiling_point` (query, optional, string) — Solvent boiling point (°C, default 100) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/osmosis-api/v1/boiling?molality=1&kb=0.512&van_t_hoff_factor=1&solvent_boiling_point=100"
```

**Response:**
```json
{
    "data": {
        "note": "ΔTb = i·Kb·m. Kb for water = 0.512 °C·kg/mol. The solution boils above the pure-solvent point.",
        "inputs": {
            "kb": 0.512,
            "molality": 1,
            "van_t_hoff_factor": 1,
            "solvent_boiling_point": 100
        },
        "new_boiling_point_c": 100.512,
        "boiling_point_elevation_c": 0.512
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:22.896Z",
        "request_id": "8dc38475-a8b5-4552-bef3-53c543cbdbb4"
    },
    "status": "ok",
    "message": "Boiling point elevation",
    "success": true
}
```

#### `GET /v1/freezing` — Freezing-point depression

**Parameters:**
- `molality` (query, required, string) — Molality m (mol/kg) Example: `1`
- `kf` (query, optional, string) — Cryoscopic constant Kf (default 1.86) Example: `1.86`
- `van_t_hoff_factor` (query, optional, string) — van 't Hoff factor i (default 1) Example: `1`
- `solvent_freezing_point` (query, optional, string) — Solvent freezing point (°C, default 0) Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/osmosis-api/v1/freezing?molality=1&kf=1.86&van_t_hoff_factor=1&solvent_freezing_point=0"
```

**Response:**
```json
{
    "data": {
        "note": "ΔTf = i·Kf·m. Kf for water = 1.86 °C·kg/mol. The solution freezes below the pure-solvent point.",
        "inputs": {
            "kf": 1.86,
            "molality": 1,
            "van_t_hoff_factor": 1,
            "solvent_freezing_point": 0
        },
        "new_freezing_point_c": -1.86,
        "freezing_point_depression_c": 1.86
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.006Z",
        "request_id": "251ebb47-37a5-4723-91f0-a71d6868b9d2"
    },
    "status": "ok",
    "message": "Freezing point depression",
    "success": true
}
```

#### `GET /v1/osmotic` — Osmotic pressure

**Parameters:**
- `molarity` (query, optional, string) — Molarity M (mol/L) Example: `1`
- `pressure` (query, optional, string) — Or a pressure (atm) to solve M
- `temperature` (query, optional, string) — Temperature (K, default 298.15) Example: `298.15`
- `van_t_hoff_factor` (query, optional, string) — van 't Hoff factor i (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/osmosis-api/v1/osmotic?molarity=1&temperature=298.15&van_t_hoff_factor=1"
```

**Response:**
```json
{
    "data": {
        "note": "π = i·M·R·T (R = 0.082057 L·atm/mol·K). The van 't Hoff factor i is the number of dissolved particles per formula unit.",
        "inputs": {
            "molarity": 1,
            "temperature": 298.15,
            "van_t_hoff_factor": 1
        },
        "solved_for": null,
        "osmotic_pressure_atm": 24.465384,
        "osmotic_pressure_bar": 24.78955,
        "osmotic_pressure_kpa": 2478.95503
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.105Z",
        "request_id": "5b6a9c78-7876-455d-99d1-f0fd0291d3ef"
    },
    "status": "ok",
    "message": "Osmotic pressure",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Molarity in mol/L, molality in mol/kg, temperature in K. Water constants: Kf = 1.86, Kb = 0.512 °C·kg/mol. i = 1 (non-electrolyte), 2 (NaCl), 3 (CaCl₂), …",
        "service": "osmosis-api",
        "formulae": {
            "boiling": "ΔTb = i·Kb·m",
            "osmotic": "π = i·M·R·T",
            "freezing": "ΔTf = i·Kf·m"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/boiling": "Boiling-point elevation ΔTb = i·Kb·m and the new boiling point.",
            "GET /v1/osmotic": "Osmotic pressure π = i·M·R·T (atm/bar/kPa); solves molarity from a pressure.",
            "GET /v1/freezing": "Freezing-point depression ΔTf = i·Kf·m and the new freezing point."
        },
        "description": "Colligative-properties calculator: osmotic pressure, freezing-point depression and boiling-point elevation for solutions."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:23.214Z",
        "request_id": "e3d96984-f6ad-4675-8435-31686ed4e72e"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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