# Psychrometric Air API
> Moist-air (psychrometric) thermodynamics as an API, computed locally and deterministically. The dewpoint endpoint computes the dew-point temperature and the saturation and actual water-vapour pressures from a dry-bulb temperature and relative humidity, using the Magnus-Tetens relation over water, es = 6.112·exp(17.62·T/(243.12+T)) hPa — the dew point is the temperature to which air must cool for water vapour to start condensing. The humidity-ratio endpoint computes the humidity ratio (mixing ratio) W = 0.621945·Pw/(P−Pw), the specific and absolute humidity, the vapour pressure and the moist-air enthalpy h = 1.006·T + W·(2501 + 1.86·T) kJ per kg of dry air, at any total pressure (default sea-level 101325 Pa). The wet-bulb endpoint computes the wet-bulb temperature with the Stull (2011) empirical fit and the wet-bulb depression, the gap between dry- and wet-bulb that widens as the air gets drier. Temperatures are in °C, relative humidity in %, pressures in Pa. Everything is computed locally and deterministically, so it is instant and private. Ideal for HVAC, building-physics, meteorology, drying, greenhouse and data-centre-cooling app developers, comfort and condensation-risk tools, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is moist-air psychrometrics; for ASHRAE ventilation airflow use a ventilation API, for the WBGT heat-stress index a WBGT API and for the standard atmosphere an atmosphere 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/psychrometric-api/..."
```

## Pricing
- **Free** (Free) — 2,500 calls/Mo, 2 req/s
- **Starter** ($10/Mo) — 45,000 calls/Mo, 6 req/s
- **Pro** ($26/Mo) — 280,000 calls/Mo, 15 req/s
- **Mega** ($79/Mo) — 1,700,000 calls/Mo, 40 req/s

## Endpoints

### Psychrometric

#### `GET /v1/dewpoint` — Dew point

**Parameters:**
- `temperature` (query, required, string) — Dry-bulb temperature (°C) Example: `30`
- `humidity` (query, required, string) — Relative humidity (%) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psychrometric-api/v1/dewpoint?temperature=30&humidity=50"
```

**Response:**
```json
{
    "data": {
        "note": "Magnus-Tetens over water (WMO): es = 6.112·exp(17.62·T/(243.12+T)) hPa; dew point inverts it. Below the dew point, water vapour condenses.",
        "inputs": {
            "humidity_pct": 50,
            "temperature_c": 30
        },
        "dew_point_c": 18.4409,
        "actual_vapour_pressure_hpa": 21.16862,
        "saturation_vapour_pressure_hpa": 42.33724
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:39.914Z",
        "request_id": "07c9e83f-b311-40a6-96c0-534de1862f35"
    },
    "status": "ok",
    "message": "Dew point",
    "success": true
}
```

#### `GET /v1/humidity-ratio` — Humidity ratio & enthalpy

**Parameters:**
- `temperature` (query, required, string) — Dry-bulb temperature (°C) Example: `30`
- `humidity` (query, required, string) — Relative humidity (%) Example: `50`
- `pressure` (query, optional, string) — Total pressure (Pa) Example: `101325`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psychrometric-api/v1/humidity-ratio?temperature=30&humidity=50&pressure=101325"
```

**Response:**
```json
{
    "data": {
        "note": "Humidity ratio W = 0.621945·Pw/(P−Pw) kg/kg dry air; enthalpy h = 1.006·T + W·(2501 + 1.86·T) kJ/kg dry air. Default total pressure is sea-level 101325 Pa.",
        "inputs": {
            "pressure_pa": 101325,
            "humidity_pct": 50,
            "temperature_c": 30
        },
        "vapour_pressure_pa": 2116.862,
        "humidity_ratio_g_kg": 13.2708,
        "humidity_ratio_kg_kg": 0.0132708,
        "absolute_humidity_kg_m3": 0.01513085,
        "specific_humidity_kg_kg": 0.013097,
        "moist_air_enthalpy_kj_kg": 64.11079
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:40.019Z",
        "request_id": "509ccd5b-4320-49a2-9404-4521807c83bf"
    },
    "status": "ok",
    "message": "Humidity ratio",
    "success": true
}
```

#### `GET /v1/wet-bulb` — Wet-bulb temperature

**Parameters:**
- `temperature` (query, required, string) — Dry-bulb temperature (°C) Example: `30`
- `humidity` (query, required, string) — Relative humidity (%) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/psychrometric-api/v1/wet-bulb?temperature=30&humidity=50"
```

**Response:**
```json
{
    "data": {
        "note": "Wet-bulb via Stull (2011) empirical fit, valid for RH 5–99% and T −20…50 °C at sea level. The wet-bulb depression (dry − wet) widens as the air gets drier.",
        "inputs": {
            "humidity_pct": 50,
            "temperature_c": 30
        },
        "dry_bulb_c": 30,
        "wet_bulb_c": 22.2968,
        "dew_point_c": 18.4409,
        "wet_bulb_depression_c": 7.7032
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:40.099Z",
        "request_id": "da191473-599e-4426-90fe-59e9aad78006"
    },
    "status": "ok",
    "message": "Wet-bulb temperature",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Temperatures in °C, relative humidity in %, pressure in Pa. Magnus-Tetens is over liquid water; default total pressure is 101325 Pa.",
        "service": "psychrometric-api",
        "formulae": {
            "enthalpy": "h = 1.006·T + W·(2501 + 1.86·T) kJ/kg",
            "dew_point": "Td = 243.12·ln(e/6.112) / (17.62 − ln(e/6.112))",
            "humidity_ratio": "W = 0.621945·Pw/(P − Pw)",
            "saturation_pressure": "es = 6.112·exp(17.62·T/(243.12+T)) hPa"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/dewpoint": "Dew point and vapour pressures from dry-bulb temperature and relative humidity.",
            "GET /v1/wet-bulb": "Wet-bulb temperature (Stull 2011) and wet-bulb depression.",
            "GET /v1/humidity-ratio": "Humidity ratio, specific & absolute humidity and moist-air enthalpy at a given total pressure."
        },
        "description": "Moist-air (psychrometric) calculator: dew point, humidity ratio, absolute & specific humidity, moist-air enthalpy and wet-bulb temperature, from dry-bulb temperature and relative humidity."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:40.186Z",
        "request_id": "9a69aaf0-67ec-49b1-a087-289b3a1c3724"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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