# Seawater API
> Seawater oceanography maths as an API, computed locally and deterministically from the standard equations — the density, freezing-point and chlorinity numbers an oceanographer, marine scientist or aquarist works with. The density endpoint gives the seawater density and σt from salinity and temperature using the full UNESCO EOS-80 one-atmosphere equation of state — it reproduces the official check value of 1027.675 kg/m³ at 35 PSU and 5 °C exactly — around 1,025 kg/m³, rising with salinity and falling with temperature, the two drivers of the ocean's density-driven circulation where cold salty water sinks. The freezing-point endpoint gives the freezing point from salinity (Millero): about −1.9 °C at the ocean's typical 35 ppt, and because salt also pushes the temperature of maximum density below freezing, seawater keeps overturning and cooling all the way down instead of stratifying like a freshwater lake — why the open ocean rarely freezes outside the polar seas. The chlorinity endpoint converts between salinity and chlorinity through the Knudsen relation S = 1.80655 × Cl, the classic titration measure that the constant major-ion proportions of seawater make reliable. Everything is computed locally and deterministically, so it is instant and private. Ideal for oceanography and marine-science tools, ocean-model and sensor pipelines, aquarium and aquaculture apps, and environmental dashboards. Pure local computation — no key, no third-party service, instant. Surface (atmospheric-pressure) forms. 3 compute endpoints. For the speed of sound in seawater use a sonar API; for general colligative properties a colligative-properties 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/seawater-api/..."
```

## Pricing
- **Free** (Free) — 5,300 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 55,000 calls/Mo, 6 req/s
- **Pro** ($39/Mo) — 232,000 calls/Mo, 15 req/s
- **Mega** ($120/Mo) — 1,160,000 calls/Mo, 40 req/s

## Endpoints

### Seawater

#### `GET /v1/chlorinity` — Salinity ↔ chlorinity

**Parameters:**
- `salinity_ppt` (query, optional, string) — Salinity (ppt) — give this OR chlorinity Example: `35`
- `chlorinity_ppt` (query, optional, string) — Chlorinity (ppt) — give this OR salinity

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/seawater-api/v1/chlorinity?salinity_ppt=35"
```

**Response:**
```json
{
    "data": {
        "note": "Chlorinity is the classic measure of the halide (mostly chloride) content of seawater, tied to salinity by the Knudsen relation S = 1.80655 × Cl. Before conductivity meters, salinity was found by titrating chlorinity — and because the major-ion ratios of seawater are nearly constant the world over (the principle of constant proportions), one number fixes the other.",
        "inputs": {
            "salinity_ppt": 35,
            "chlorinity_ppt": null
        },
        "salinity_ppt": 35,
        "chlorinity_ppt": 19.3739
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:07.650Z",
        "request_id": "6878494a-11f3-456e-97e5-9ca18b93a8ce"
    },
    "status": "ok",
    "message": "Chlorinity",
    "success": true
}
```

#### `GET /v1/density` — Seawater density and σt

**Parameters:**
- `salinity_ppt` (query, required, string) — Salinity (ppt/PSU) Example: `35`
- `temp_c` (query, required, string) — Temperature (°C) Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/seawater-api/v1/density?salinity_ppt=35&temp_c=25"
```

**Response:**
```json
{
    "data": {
        "note": "Seawater density from the UNESCO EOS-80 equation of state (at the surface). Around 1,025 kg/m³, it rises with salinity and falls with temperature — the two drivers of the ocean's density-driven circulation, where cold salty water sinks. Oceanographers quote σt = density − 1000. The salt adds roughly 0.8 kg/m³ per ppt; this surface form ignores the further increase with pressure at depth.",
        "inputs": {
            "temp_c": 25,
            "salinity_ppt": 35
        },
        "sigma_t": 23.343,
        "density_kg_m3": 1023.343,
        "specific_gravity": 1.0235,
        "pure_water_density_kg_m3": 997.048
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:07.753Z",
        "request_id": "e1ab4ecd-7390-4932-9d29-a4d16b91791c"
    },
    "status": "ok",
    "message": "Seawater density",
    "success": true
}
```

#### `GET /v1/freezing-point` — Freezing point from salinity

**Parameters:**
- `salinity_ppt` (query, required, string) — Salinity (ppt/PSU) Example: `35`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/seawater-api/v1/freezing-point?salinity_ppt=35"
```

**Response:**
```json
{
    "data": {
        "note": "The freezing point of seawater (Millero) drops with salinity — about −1.9 °C at the ocean's typical 35 ppt, versus 0 °C for fresh water. Because salt also lowers the temperature of maximum density below the freezing point, seawater keeps overturning and cooling all the way to freezing instead of stratifying like a freshwater lake — which is why the open ocean rarely freezes except in the polar seas, and the ice that forms is nearly salt-free.",
        "inputs": {
            "salinity_ppt": 35
        },
        "freezing_point_c": -1.9223
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:07.843Z",
        "request_id": "86601428-d9c5-4131-827b-c158431da979"
    },
    "status": "ok",
    "message": "Freezing point",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "ppt/PSU, °C, kg/m³. Density = UNESCO EOS-80 (surface, atmospheric); freezing point = Millero; S = 1.80655·Cl. For the speed of sound in seawater use a sonar API; for general colligative properties a colligative-properties API.",
        "service": "seawater-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/density": "Seawater density and σt from salinity and temperature.",
            "GET /v1/chlorinity": "Salinity ↔ chlorinity (S = 1.80655 × Cl).",
            "GET /v1/freezing-point": "Freezing point of seawater from salinity."
        },
        "description": "Seawater oceanography maths: density (UNESCO EOS-80), freezing point (Millero), and salinity ↔ chlorinity."
    },
    "meta": {
        "timestamp": "2026-06-07T08:18:07.941Z",
        "request_id": "bb96dcec-c928-4b11-a306-70998429a6f2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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