# Thermal Radiation API
> Stefan-Boltzmann thermal radiation and Wien's displacement law as an API, computed locally and deterministically. The power endpoint computes the radiant exitance of a surface, M = ε·σ·T⁴ — how much power a body radiates per unit area at a temperature, from its emissivity (1 for a black body) and absolute temperature — and, given the area, the total radiant power in watts and kilowatts; it also solves the temperature from a measured exitance. Temperatures may be entered in kelvin, Celsius or Fahrenheit. The exchange endpoint computes the net radiative heat transfer between an object and its surroundings, Q = ε·σ·A·(T_object⁴ − T_surroundings⁴), telling you whether the object is losing or gaining heat by radiation. The wien endpoint applies Wien's displacement law, λmax = b/T, to give the peak wavelength and frequency of the thermal spectrum and which band it falls in (the Sun at 5778 K peaks in visible green light, a room at 300 K in the infrared), and solves the temperature from a peak wavelength. The Stefan-Boltzmann constant 5.670×10⁻⁸ and Wien constant 2.898×10⁻³ are built in. Everything is computed locally and deterministically, so it is instant and private. Ideal for heat-transfer and building-physics tools, astronomy, infrared-thermography and solar apps, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is thermal-radiation physics; for the RGB colour of a black body at a colour temperature use a colour-temperature 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/radiation-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 200,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 1,500,000 calls/Mo, 40 req/s

## Endpoints

### Radiation

#### `GET /v1/exchange` — Net radiative heat transfer

**Parameters:**
- `object_temperature` (query, required, string) — Object temperature Example: `350`
- `surroundings_temperature` (query, required, string) — Surroundings temperature Example: `300`
- `unit` (query, optional, string) — k|c|f (default k) Example: `k`
- `emissivity` (query, optional, string) — Emissivity 0–1 (default 1) Example: `0.9`
- `area` (query, required, string) — Area (m²) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/radiation-api/v1/exchange?object_temperature=350&surroundings_temperature=300&unit=k&emissivity=0.9&area=2"
```

**Response:**
```json
{
    "data": {
        "area_m2": 2,
        "formula": "Q = ε·σ·A·(T_object⁴ − T_surroundings⁴).",
        "direction": "object loses heat to surroundings",
        "emissivity": 0.9,
        "net_flux_w_m2": 352.44921,
        "object_temperature_k": 350,
        "net_radiative_power_w": 704.89842,
        "net_radiative_power_kw": 0.70489842,
        "surroundings_temperature_k": 300
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:47.768Z",
        "request_id": "433908a7-6c60-4449-9370-e3739a64064e"
    },
    "status": "ok",
    "message": "Net radiative heat transfer",
    "success": true
}
```

#### `GET /v1/power` — Radiant exitance & power

**Parameters:**
- `temperature` (query, optional, string) — Temperature Example: `300`
- `unit` (query, optional, string) — k|c|f (default k) Example: `k`
- `emissivity` (query, optional, string) — Emissivity 0–1 (default 1) Example: `1`
- `area` (query, optional, string) — Area (m²) for total power Example: `1`
- `exitance` (query, optional, string) — Or exitance (W/m²) to solve temperature

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/radiation-api/v1/power?temperature=300&unit=k&emissivity=1&area=1"
```

**Response:**
```json
{
    "data": {
        "area_m2": 1,
        "formula": "M = ε·σ·T⁴; P = M·A.",
        "emissivity": 1,
        "temperature_k": 300,
        "radiant_power_w": 459.300328,
        "radiant_power_kw": 0.4593,
        "radiant_exitance_w_m2": 459.300328,
        "stefan_boltzmann_constant": 5.670374419e-8
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:47.877Z",
        "request_id": "9653e7c3-0618-47e2-91a4-d19d66042df9"
    },
    "status": "ok",
    "message": "Radiant exitance & power",
    "success": true
}
```

#### `GET /v1/wien` — Wien's displacement law

**Parameters:**
- `temperature` (query, optional, string) — Temperature Example: `5778`
- `unit` (query, optional, string) — k|c|f (default k) Example: `k`
- `peak_wavelength_nm` (query, optional, string) — Or peak wavelength (nm) to solve temperature

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/radiation-api/v1/wien?temperature=5778&unit=k"
```

**Response:**
```json
{
    "data": {
        "formula": "λmax = b/T (b = 2.8978×10⁻³ m·K); f_peak = T·5.879×10¹⁰ Hz/K.",
        "spectrum": "visible",
        "temperature_k": 5778,
        "wien_constant": 0.002897771955,
        "peak_frequency_hz": 339684330239460,
        "peak_wavelength_m": 5.01518e-7,
        "peak_wavelength_nm": 501.518165,
        "peak_wavelength_um": 0.50151816
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:47.983Z",
        "request_id": "b5620e4e-d39c-4eb7-bed1-c93ac4517d8e"
    },
    "status": "ok",
    "message": "Wien's displacement law",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "radiation",
        "note": "Stefan-Boltzmann thermal radiation & Wien's law — computed locally and deterministically, no key, no third-party service.",
        "constants": {
            "speed_of_light": 299792458,
            "wien_wavelength": 0.002897771955,
            "stefan_boltzmann": 5.670374419e-8
        },
        "endpoints": [
            "/v1/power",
            "/v1/exchange",
            "/v1/wien",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:48.091Z",
        "request_id": "1ef4cc70-04d3-4b99-99dd-cbfe890fcf89"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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