# Electrochemistry Nernst API
> Electrochemistry maths as an API, computed locally and deterministically. The nernst endpoint applies the Nernst equation, E = E° − (R·T/nF)·ln Q, to give the actual electrode or cell potential under non-standard conditions from the standard potential E°, the number of electrons transferred n, the reaction quotient Q and the temperature — at 25 °C this reduces to E = E° − (0.05916/n)·log10 Q, and a larger Q (more product) lowers the potential. The cell-potential endpoint computes a galvanic cell's standard EMF from the cathode and anode standard reduction potentials, E°cell = E°cathode − E°anode, together with the standard Gibbs free energy ΔG° = −nF·E°cell and whether the reaction is spontaneous. The equilibrium endpoint computes the equilibrium constant of a redox reaction, K = exp(nF·E°cell / RT), and the corresponding ΔG°, from the standard cell potential and the electrons transferred. Potentials are in volts, energies in kJ/mol, the Faraday constant is 96485 C/mol and the gas constant 8.314 J/mol·K. Everything is computed locally and deterministically, so it is instant and private. Ideal for chemistry-education, battery, corrosion, electroplating and electroanalytical app developers, galvanic-cell and redox tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is electrochemistry; for acid-base pH use a pH API and for reaction-rate kinetics an Arrhenius 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/nernst-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 35,000 calls/Mo, 6 req/s
- **Pro** ($15/Mo) — 220,000 calls/Mo, 15 req/s
- **Mega** ($45/Mo) — 1,300,000 calls/Mo, 40 req/s

## Endpoints

### Electrochemistry

#### `GET /v1/cell-potential` — Cell EMF

**Parameters:**
- `cathode_potential` (query, required, string) — Cathode E°red (V) Example: `0.34`
- `anode_potential` (query, required, string) — Anode E°red (V) Example: `-0.76`
- `electrons` (query, required, string) — Electrons transferred n Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nernst-api/v1/cell-potential?cathode_potential=0.34&anode_potential=-0.76&electrons=2"
```

**Response:**
```json
{
    "data": {
        "note": "E°cell = E°cathode − E°anode (both standard reduction potentials). ΔG° = −nF·E°cell; a positive cell potential (negative ΔG°) means the reaction is spontaneous (galvanic).",
        "inputs": {
            "electrons": 2,
            "anode_potential_v": -0.76,
            "cathode_potential_v": 0.34
        },
        "spontaneous": true,
        "cell_potential_v": 1.1,
        "delta_g_standard_j_mol": -212267.731,
        "delta_g_standard_kj_mol": -212.267731
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:39.469Z",
        "request_id": "ca88eee8-dc7f-4a12-9bcf-c7bfd9a7bec4"
    },
    "status": "ok",
    "message": "Cell potential",
    "success": true
}
```

#### `GET /v1/equilibrium` — Equilibrium constant

**Parameters:**
- `cell_potential` (query, required, string) — Standard cell potential E°cell (V) Example: `1.10`
- `electrons` (query, required, string) — Electrons transferred n Example: `2`
- `temperature` (query, optional, string) — Temperature (K) Example: `298.15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nernst-api/v1/equilibrium?cell_potential=1.10&electrons=2&temperature=298.15"
```

**Response:**
```json
{
    "data": {
        "ln_k": 85.627838,
        "note": "K = exp(nF·E°cell / RT); ΔG° = −RT·ln K = −nF·E°cell. A large positive E°cell gives a huge K (products favoured).",
        "inputs": {
            "electrons": 2,
            "temperature_k": 298.15,
            "cell_potential_v": 1.1
        },
        "log10_k": 37.187697,
        "equilibrium_constant": 1.5406269586154516e+37,
        "delta_g_standard_kj_mol": -212.267731
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:39.561Z",
        "request_id": "69ee338f-ecd4-463c-b7ef-b4279088fe90"
    },
    "status": "ok",
    "message": "Equilibrium constant",
    "success": true
}
```

#### `GET /v1/nernst` — Nernst equation

**Parameters:**
- `standard_potential` (query, required, string) — Standard potential E° (V) Example: `1.10`
- `electrons` (query, required, string) — Electrons transferred n Example: `2`
- `reaction_quotient` (query, required, string) — Reaction quotient Q Example: `0.001`
- `temperature` (query, optional, string) — Temperature (K) Example: `298.15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nernst-api/v1/nernst?standard_potential=1.10&electrons=2&reaction_quotient=0.001&temperature=298.15"
```

**Response:**
```json
{
    "data": {
        "note": "Nernst: E = E° − (R·T/nF)·ln Q. At 25 °C this is E = E° − (0.05916/n)·log10 Q. A larger Q (more products) lowers the cell potential.",
        "inputs": {
            "electrons": 2,
            "temperature_k": 298.15,
            "reaction_quotient": 0.001,
            "standard_potential_v": 1.1
        },
        "log10_quotient": -3,
        "nernst_slope_v": 0.02957967,
        "cell_potential_v": 1.188739
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:39.666Z",
        "request_id": "9e798971-f814-49fd-895b-2598181c0b39"
    },
    "status": "ok",
    "message": "Nernst equation",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Potentials in volts (standard reduction potentials), electrons n a positive integer, temperature in K (default 298.15). Q and K are dimensionless.",
        "service": "nernst-api",
        "formulae": {
            "nernst": "E = E° − (R·T/nF)·ln Q",
            "cell_emf": "E°cell = E°cathode − E°anode",
            "equilibrium": "K = exp(nF·E°cell / RT)",
            "free_energy": "ΔG° = −nF·E°cell"
        },
        "constants": {
            "faraday_c_mol": 96485.33212,
            "gas_constant_j_mol_k": 8.314462618
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/nernst": "Cell potential under non-standard conditions from E°, electrons and reaction quotient Q.",
            "GET /v1/equilibrium": "Equilibrium constant K and ΔG° from the standard cell potential.",
            "GET /v1/cell-potential": "Standard cell EMF from cathode/anode reduction potentials, with ΔG° and spontaneity."
        },
        "description": "Electrochemistry calculator: the Nernst equation for non-standard cell potential, galvanic cell EMF from electrode potentials with Gibbs free energy and spontaneity, and the equilibrium constant of a redox reaction."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:39.752Z",
        "request_id": "de565556-20a8-43f2-b423-d4d593f46e71"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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