# Quantum Physics API
> Quantum and atomic-physics maths as an API, computed locally and deterministically. The photoelectric endpoint applies Einstein's photoelectric equation, KE = hf − φ — from the incident light's wavelength or frequency and a metal's work function it gives the photon energy, whether electrons are emitted, their maximum kinetic energy, the threshold frequency and wavelength (f₀ = φ/h), the maximum electron speed and the stopping voltage. The bohr endpoint computes the Bohr-model energy level Eₙ = −13.606·Z²/n² eV and orbital radius rₙ = 0.529·n²/Z Å of a hydrogen-like atom, the ionisation energy, and — given a second level — the wavelength of the emitted or absorbed photon. The rydberg endpoint computes a spectral line's wavelength from the Rydberg formula, 1/λ = R·Z²·(1/n₁² − 1/n₂²), and names its series (Lyman, Balmer, Paschen …) and spectral region. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics-education, spectroscopy, astronomy and science app developers, atomic-physics and spectral tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is quantum and atomic physics; for electromagnetic wavelength and photon energy use a wavelength API and for special relativity a relativity 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/quantum-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) — 638,000 calls/Mo, 40 req/s

## Endpoints

### Quantum

#### `GET /v1/bohr` — Bohr model

**Parameters:**
- `level` (query, required, string) — Principal quantum number n Example: `2`
- `atomic_number` (query, optional, string) — Atomic number Z Example: `1`
- `to_level` (query, optional, string) — Second level for a transition

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quantum-api/v1/bohr?level=2&atomic_number=1"
```

**Response:**
```json
{
    "data": {
        "note": "Bohr model: Eₙ = −13.606·Z²/n² eV, rₙ = 0.529·n²/Z Å. n = 1 is the ground state.",
        "inputs": {
            "level": 2,
            "atomic_number": 1
        },
        "energy_j": -5.449680900000001e-19,
        "energy_ev": -3.401423,
        "orbital_radius_nm": 0.2116708,
        "ionization_energy_ev": 3.401423,
        "orbital_radius_angstrom": 2.116708
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.775Z",
        "request_id": "7cc88c4c-5a54-4382-b5c3-ee0720b2d7f8"
    },
    "status": "ok",
    "message": "Bohr model",
    "success": true
}
```

#### `GET /v1/photoelectric` — Photoelectric effect

**Parameters:**
- `work_function` (query, required, string) — Work function φ (eV) Example: `2`
- `wavelength` (query, optional, string) — Incident wavelength (nm) Example: `400`
- `frequency` (query, optional, string) — Or frequency (Hz)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quantum-api/v1/photoelectric?work_function=2&wavelength=400"
```

**Response:**
```json
{
    "data": {
        "note": "Photoelectric effect: KE = hf − φ. No electrons are emitted below the threshold frequency f₀ = φ/h.",
        "inputs": {
            "frequency_hz": 749481140000000,
            "work_function_ev": 2
        },
        "photon_energy_j": 4.966114600000001e-19,
        "photon_energy_ev": 3.099605,
        "electrons_emitted": true,
        "stopping_voltage_v": 1.099605,
        "max_electron_speed_ms": 621933.63,
        "max_kinetic_energy_ev": 1.099605,
        "threshold_frequency_hz": 483597850000000,
        "threshold_wavelength_nm": 619.921
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.851Z",
        "request_id": "6ceb9a1b-33b8-4182-976e-00a94296a236"
    },
    "status": "ok",
    "message": "Photoelectric",
    "success": true
}
```

#### `GET /v1/rydberg` — Rydberg spectral line

**Parameters:**
- `n1` (query, required, string) — Lower level n₁ Example: `2`
- `n2` (query, required, string) — Upper level n₂ Example: `3`
- `atomic_number` (query, optional, string) — Atomic number Z Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quantum-api/v1/rydberg?n1=2&n2=3&atomic_number=1"
```

**Response:**
```json
{
    "data": {
        "note": "Rydberg formula: 1/λ = R·Z²·(1/n₁² − 1/n₂²), R = 1.0974×10⁷ m⁻¹. n₁ = 2 gives the visible Balmer series for hydrogen.",
        "inputs": {
            "n1": 2,
            "n2": 3,
            "atomic_number": 1
        },
        "region": "visible",
        "series": "Balmer",
        "wavenumber_m": 1524129.4,
        "wavelength_nm": 656.1123,
        "photon_energy_ev": 1.88968
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:58.933Z",
        "request_id": "4f0cad5c-d267-45b1-a594-ab77020f8c6c"
    },
    "status": "ok",
    "message": "Rydberg lines",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Wavelengths in nm, frequency in Hz, energies in eV, work function in eV. Bohr/Rydberg take integer levels; Z is the atomic number (1 for hydrogen).",
        "service": "quantum-api",
        "formulae": {
            "rydberg": "1/λ = R·Z²·(1/n₁² − 1/n₂²)",
            "bohr_energy": "Eₙ = −13.606·Z²/n² eV",
            "photoelectric": "KE = hf − φ"
        },
        "endpoints": {
            "GET /v1/bohr": "Bohr energy levels, orbital radius and transition wavelengths (hydrogen-like).",
            "GET /v1/meta": "This document.",
            "GET /v1/rydberg": "Spectral-line wavelength from the Rydberg formula and its series.",
            "GET /v1/photoelectric": "Max kinetic energy, threshold and electron speed from light and a work function."
        },
        "description": "Quantum and atomic-physics calculator: the photoelectric effect, Bohr-model energy levels and orbital radii, and Rydberg spectral-line wavelengths."
    },
    "meta": {
        "timestamp": "2026-06-05T03:08:59.006Z",
        "request_id": "a8287cc9-20ff-4d34-9e9f-09869673faef"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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