# Latent Heat & Enthalpy API
> Latent-heat and phase-change enthalpy as an API, computed locally and deterministically. The latent endpoint applies Q = m·L — the heat to melt, freeze, boil or condense a substance equals its mass times the latent heat — and solves for whichever of the heat, the mass or the latent heat you leave out, taking the latent heat of fusion or vaporization directly or from a built-in substance table (water, ethanol, mercury, lead, aluminium, iron, nitrogen, oxygen). The phase-change endpoint computes the full enthalpy of heating or cooling a substance from one temperature to another, automatically combining the sensible heat m·c·ΔT within each phase with the latent heat at every melting and boiling transition it crosses, and returns a step-by-step breakdown — so it can tell you, for example, the total energy to turn ice at −10 °C all the way into steam at 110 °C, using the right specific heat for the solid, the liquid and the gas. The substances endpoint lists the latent heats and per-phase specific heats. Heat is reported in joules, kilojoules, watt-hours and kilocalories. Everything is computed locally and deterministically, so it is instant and private. Ideal for thermodynamics and HVAC tools, refrigeration, heating and process-engineering apps, food and material science, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is latent heat and phase change; for sensible heat alone (Q = m·c·ΔT with no phase change) use a specific-heat 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/enthalpy-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, 15 req/s
- **Mega** ($45/Mo) — 762,000 calls/Mo, 40 req/s

## Endpoints

### Enthalpy

#### `GET /v1/latent` — Latent heat Q = m·L

**Parameters:**
- `substance` (query, optional, string) — water|ethanol|mercury|… (for latent_heat) Example: `water`
- `transition` (query, optional, string) — fusion|vaporization (default fusion) Example: `fusion`
- `mass` (query, optional, string) — Mass (kg) Example: `1`
- `latent_heat` (query, optional, string) — Or latent heat (J/kg)
- `energy` (query, optional, string) — Or energy (J) to solve mass/latent

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/enthalpy-api/v1/latent?substance=water&transition=fusion&mass=1"
```

**Response:**
```json
{
    "data": {
        "formula": "Q = m·L (L = latent heat of fusion or vaporization).",
        "mass_kg": 1,
        "energy_kj": 334,
        "energy_wh": 92.77777778,
        "substance": "water",
        "transition": "fusion",
        "energy_kcal": 79.82791587,
        "energy_joules": 334000,
        "latent_heat_j_per_kg": 334000
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:53.362Z",
        "request_id": "8eadb7ea-749d-42d1-824c-28cabb77efcb"
    },
    "status": "ok",
    "message": "Latent heat Q = m·L",
    "success": true
}
```

#### `GET /v1/phase-change` — Full heating/cooling enthalpy path

**Parameters:**
- `substance` (query, required, string) — water|ethanol|mercury|lead|aluminium|iron|nitrogen|oxygen Example: `water`
- `mass` (query, required, string) — Mass (kg) Example: `1`
- `initial_temperature` (query, required, string) — Start temperature (°C) Example: `-10`
- `final_temperature` (query, required, string) — End temperature (°C) Example: `110`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/enthalpy-api/v1/phase-change?substance=water&mass=1&initial_temperature=-10&final_temperature=110"
```

**Response:**
```json
{
    "data": {
        "note": "Total enthalpy change combines sensible heat (m·c·ΔT) in each phase with the latent heat at every transition crossed.",
        "steps": [
            {
                "to_c": 0,
                "type": "sensible",
                "phase": "solid",
                "from_c": -10,
                "energy_joules": 20900,
                "specific_heat_j_per_kg_k": 2090
            },
            {
                "at_c": 0,
                "type": "latent_fusion",
                "energy_joules": 334000,
                "latent_heat_j_per_kg": 334000
            },
            {
                "to_c": 100,
                "type": "sensible",
                "phase": "liquid",
                "from_c": 0,
                "energy_joules": 418600,
                "specific_heat_j_per_kg_k": 4186
            },
            {
                "at_c": 100,
                "type": "latent_vaporization",
                "energy_joules": 2256000,
                "latent_heat_j_per_kg": 2256000
            },
            {
                "to_c": 110,
                "type": "sensible",
                "phase": "gas",
                "from_c": 100,
                "energy_joules": 20100,
                "specific_heat_j_per_kg_k": 2010
            }
        ],
        "mass_kg": 1,
        "process": "heating (energy absorbed)",
        "energy_kj": 3049.6,
        "energy_wh": 847.11111111,
        "substance": "water",
        "energy_kcal": 728.8718
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/substances` — Substance reference (latent heats & specific heats)

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

**Response:**
```json
{
    "data": {
        "note": "Latent heats of fusion (lf) and vaporization (lv) and per-phase specific heats. null = not tabulated.",
        "units": {
            "latent_heat": "J/kg",
            "temperature": "°C",
            "specific_heat": "J/(kg·K)"
        },
        "aliases": {
            "fe": "iron",
            "hg": "mercury",
            "n2": "nitrogen",
            "o2": "oxygen",
            "pb": "lead",
            "h2o": "water",
            "ice": "water",
            "steam": "water",
            "aluminum": "aluminium"
        },
        "substances": {
            "iron": {
                "lf": 247000,
                "lv": 6090000,
                "c_gas": null,
                "boil_c": 2862,
                "melt_c": 1538,
                "c_solid": 449,
                "c_liquid": 820
            },
            "lead": {
                "lf": 23000,
                "lv": 871000,
                "c_gas": null,
                "boil_c": 1749,
                "melt_c": 327.46,
                "c_solid": 129,
                "c_liquid": 130
            },
            "water": {
                "lf": 334000,
                "lv": 2256000,
                "c_gas": 2010,
                "boil_c": 100,
                "melt_c": 0,
                "c_solid": 2090,
                "c_liquid": 4186
            },
            "oxygen": {
                "lf": 13900,
                "lv": 213000,
                "c_gas": 918,
                "boil_c
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "enthalpy",
        "note": "Latent-heat / phase-change enthalpy — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/latent",
            "/v1/phase-change",
            "/v1/substances",
            "/v1/meta"
        ],
        "substances": [
            "water",
            "ethanol",
            "mercury",
            "lead",
            "aluminium",
            "iron",
            "nitrogen",
            "oxygen"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:53.654Z",
        "request_id": "4b09ae49-9a55-4f7b-9dfb-e49492cac805"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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