# Nuclear Physics API
> Nuclear-physics maths as an API, computed locally and deterministically. The binding-energy endpoint computes a nucleus's mass defect, Δm = Z·m_H + N·m_n − M_atom, and its binding energy E = Δm·c² (1 u = 931.494 MeV) and binding energy per nucleon, from the proton and neutron counts and the measured atomic mass. The semf endpoint estimates the binding energy from the semi-empirical (Bethe-Weizsäcker) mass formula, breaking it into the volume, surface, Coulomb, asymmetry and pairing terms, from just the mass number and proton number. The q-value endpoint computes the energy released or absorbed in a nuclear reaction from the masses of the reactants and products, Q = (Σm_reactants − Σm_products)·c², classifying it as exothermic (fusion of light nuclei or fission of heavy ones) or endothermic. Masses are in atomic mass units and energies in MeV and joules. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics-education, nuclear-engineering, astrophysics and science app developers, reactor and reaction tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is nuclear binding and reactions; for radioactive decay use a half-life API and for atomic energy levels a quantum 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/nuclear-api/..."
```

## Pricing
- **Free** (Free) — 3,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** ($49/Mo) — 750,000 calls/Mo, 40 req/s

## Endpoints

### Nuclear

#### `GET /v1/binding-energy` — Binding energy

**Parameters:**
- `protons` (query, required, string) — Proton number Z Example: `26`
- `neutrons` (query, optional, string) — Neutron number N
- `mass_number` (query, optional, string) — Or mass number A Example: `56`
- `atomic_mass` (query, required, string) — Measured atomic mass (u) Example: `55.934936`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nuclear-api/v1/binding-energy?protons=26&mass_number=56&atomic_mass=55.934936"
```

**Response:**
```json
{
    "data": {
        "note": "Δm = Z·m_H + N·m_n − M_atom (atomic masses include electrons). E = Δm·c², 1 u = 931.494 MeV.",
        "inputs": {
            "protons": 26,
            "neutrons": 30,
            "mass_number": 56,
            "atomic_mass_u": 55.934936
        },
        "mass_defect_u": 0.52846231,
        "binding_energy_j": 7.8868671e-11,
        "binding_energy_mev": 492.259525,
        "binding_energy_per_nucleon_mev": 8.790349
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.338Z",
        "request_id": "bebc0635-57d1-4a87-8e26-a5950809e4ab"
    },
    "status": "ok",
    "message": "Binding energy",
    "success": true
}
```

#### `GET /v1/q-value` — Reaction Q-value

**Parameters:**
- `reactants` (query, required, string) — Comma-separated reactant masses (u) Example: `2.014102,3.016049`
- `products` (query, required, string) — Comma-separated product masses (u) Example: `4.002602,1.008665`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nuclear-api/v1/q-value?reactants=2.014102%2C3.016049&products=4.002602%2C1.008665"
```

**Response:**
```json
{
    "data": {
        "note": "Q = (Σm_reactants − Σm_products)·c². A positive Q means energy is released (fusion of light nuclei, fission of heavy nuclei).",
        "inputs": {
            "product_count": 2,
            "reactant_count": 2,
            "total_product_mass_u": 5.011267,
            "total_reactant_mass_u": 5.030151
        },
        "reaction": "exothermic (energy released)",
        "q_value_j": 2.818282e-12,
        "q_value_mev": 17.590335,
        "mass_difference_u": 0.018884
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.433Z",
        "request_id": "3b1a175b-cc75-45f2-871c-1ec35117d9f4"
    },
    "status": "ok",
    "message": "Reaction Q-value",
    "success": true
}
```

#### `GET /v1/semf` — Semi-empirical mass formula

**Parameters:**
- `mass_number` (query, required, string) — Mass number A Example: `56`
- `protons` (query, required, string) — Proton number Z Example: `26`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nuclear-api/v1/semf?mass_number=56&protons=26"
```

**Response:**
```json
{
    "data": {
        "note": "Bethe-Weizsäcker SEMF binding-energy estimate: B = aV·A − aS·A^(2/3) − aC·Z(Z−1)/A^(1/3) − aA·(A−2Z)²/A + δ.",
        "inputs": {
            "protons": 26,
            "neutrons": 30,
            "mass_number": 56
        },
        "terms_mev": {
            "volume": 882,
            "coulomb": -120.7963,
            "pairing": 1.494,
            "surface": -260.5426,
            "asymmetry": -6.7714
        },
        "binding_energy_mev": 495.3837,
        "binding_energy_per_nucleon_mev": 8.846137
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.522Z",
        "request_id": "c785bb7d-a5cf-4472-87f6-718e1ca70387"
    },
    "status": "ok",
    "message": "SEMF estimate",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Masses in atomic mass units (u); energies in MeV (and joules). m_H = 1.007825 u, m_n = 1.008665 u. SEMF is an estimate.",
        "service": "nuclear-api",
        "formulae": {
            "q_value": "(Σm_reactants − Σm_products)·c²",
            "mass_defect": "Δm = Z·m_H + N·m_n − M_atom",
            "binding_energy": "E = Δm·c², 1 u = 931.494 MeV"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/semf": "Semi-empirical mass-formula binding-energy estimate from A and Z.",
            "GET /v1/q-value": "Reaction energy from reactant and product masses (fusion/fission).",
            "GET /v1/binding-energy": "Mass defect, binding energy and binding energy per nucleon from the measured mass."
        },
        "description": "Nuclear-physics calculator: nuclear binding energy and mass defect, the semi-empirical (Bethe-Weizsäcker) mass-formula estimate, and the Q-value of a nuclear reaction."
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.611Z",
        "request_id": "b22fb6ce-64dd-4106-b0cf-95ee9c64b3b2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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