# Blast Effects API
> Blast-effects and TNT-equivalence maths as an API for safety engineering and education, computed locally and deterministically. The energy endpoint converts between a TNT charge mass and the energy it releases using the conventional 4.184 MJ per kilogram, in both directions, including the kiloton equivalent. The scaled-distance endpoint computes the Hopkinson-Cranz scaled distance Z = R / W^(1/3) from a standoff distance and a charge weight — the cube-root scaling law means two blasts with the same Z produce the same overpressure — and inverts it to give the standoff distance for a target Z, which is how safety distances are set for a given charge. The overpressure endpoint estimates the peak side-on overpressure with the Brode (1955) correlation from the scaled distance (or from distance and charge), in kilopascals, bar and psi, with a qualitative damage assessment from shattered glass to structural collapse. Charge is in kilograms of TNT, distance in metres and energy in joules. Everything is computed locally and deterministically, so it is instant and private. Ideal for blast-resistant design, demolition, mining, process-safety and emergency-planning app developers, standoff-distance and overpressure tools, and engineering education; for engineering use, consult the applicable standards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is explosive blast effects; for earthquake magnitude and energy use an earthquake-magnitude 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/tnt-api/..."
```

## Pricing
- **Free** (Free) — 2,600 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 36,000 calls/Mo, 6 req/s
- **Pro** ($27/Mo) — 250,000 calls/Mo, 15 req/s
- **Mega** ($82/Mo) — 1,720,000 calls/Mo, 40 req/s

## Endpoints

### Blast

#### `GET /v1/energy` — TNT energy

**Parameters:**
- `mass` (query, optional, string) — TNT mass (kg) Example: `1000`
- `energy` (query, optional, string) — Or energy (J) for the TNT equivalent

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tnt-api/v1/energy?mass=1000"
```

**Response:**
```json
{
    "data": {
        "note": "1 kg of TNT releases 4.184 MJ (the conventional value). 1 kiloton = 10⁶ kg TNT = 4.184 TJ.",
        "inputs": {
            "mass_kg": 1000
        },
        "energy_gj": 4.184,
        "energy_mj": 4184,
        "tnt_kilotons": 0.001,
        "energy_joules": 4184000000
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.499Z",
        "request_id": "32b85eb7-00ab-4951-95cf-58eda3fdba7e"
    },
    "status": "ok",
    "message": "TNT energy",
    "success": true
}
```

#### `GET /v1/overpressure` — Peak overpressure

**Parameters:**
- `distance` (query, optional, string) — Standoff distance (m) Example: `50`
- `charge` (query, optional, string) — Charge (kg TNT) Example: `1000`
- `scaled_distance` (query, optional, string) — Or scaled distance Z

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tnt-api/v1/overpressure?distance=50&charge=1000"
```

**Response:**
```json
{
    "data": {
        "note": "Peak side-on overpressure via the Brode (1955) correlation from the scaled distance. For safety-distance and blast-resistant-design estimates; consult standards for engineering use.",
        "inputs": {
            "charge_kg": 1000,
            "distance_m": 50,
            "scaled_distance": 5
        },
        "damage_assessment": "houses badly damaged, eardrum rupture risk",
        "peak_overpressure_bar": 0.281,
        "peak_overpressure_kpa": 28.1,
        "peak_overpressure_psi": 4.0756
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.613Z",
        "request_id": "d1b0da4d-f06e-4afa-9945-2814b22e8bc9"
    },
    "status": "ok",
    "message": "Peak overpressure",
    "success": true
}
```

#### `GET /v1/scaled-distance` — Scaled distance

**Parameters:**
- `distance` (query, optional, string) — Standoff distance (m) Example: `50`
- `charge` (query, required, string) — Charge (kg TNT) Example: `1000`
- `scaled_distance` (query, optional, string) — Or Z to get the distance

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tnt-api/v1/scaled-distance?distance=50&charge=1000"
```

**Response:**
```json
{
    "data": {
        "note": "Hopkinson-Cranz scaled distance Z = R / W^(1/3) (m/kg^⅓). Blasts with equal Z produce the same overpressure — the cube-root scaling law.",
        "inputs": {
            "charge_kg": 1000,
            "distance_m": 50
        },
        "scaled_distance": 5
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.722Z",
        "request_id": "60dfcad5-f043-4a16-9ae0-01deecfd93d0"
    },
    "status": "ok",
    "message": "Scaled distance",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Charge in kg TNT, distance in m, energy in J, overpressure in kPa/bar/psi. The cube-root law means equal Z gives equal overpressure. For education and first-order safety estimates.",
        "service": "tnt-api",
        "formulae": {
            "energy": "E = mass · 4.184 MJ/kg",
            "overpressure": "Brode (1955): ΔP(bar) from Z",
            "scaled_distance": "Z = R / W^(1/3)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/energy": "Energy from a TNT mass, or the TNT equivalent of an energy.",
            "GET /v1/overpressure": "Peak overpressure and damage assessment from scaled distance (or distance + charge).",
            "GET /v1/scaled-distance": "Hopkinson-Cranz scaled distance Z from standoff and charge (or the inverse)."
        },
        "description": "Blast-effects calculator (safety engineering): TNT-equivalent energy, Hopkinson-Cranz scaled distance and Brode peak overpressure with a damage assessment."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.815Z",
        "request_id": "6c883074-1895-4a34-9a1f-66c9fe500c77"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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