# Inductance API
> Inductor-design electromagnetics as an API, computed locally and deterministically. The solenoid endpoint computes the inductance of a straight coil with the long-solenoid formula L = μ₀·μr·N²·A/l, from the number of turns, the coil length, the cross-sectional area (or diameter) and the relative permeability of the core — a ferromagnetic core multiplies the inductance. The toroid endpoint computes the inductance of a doughnut-shaped coil of rectangular cross-section, L = μ₀·μr·N²·h·ln(b/a)/(2π), from the turns, the axial height and the inner and outer radii; the toroidal shape confines the magnetic flux so there is little stray field. The energy endpoint computes the magnetic energy stored in an inductor, E = ½·L·I², and the flux linkage Φ = L·I, from the inductance and current — the energy released when the current is interrupted causes the inductive kick. Lengths are in metres, area in square metres, inductance in henries (millihenries and microhenries also returned) and current in amps, with μ₀ = 4π×10⁻⁷ H/m. Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics, RF, power-supply, filter and motor-design app developers, coil-winding and inductor-sizing tools, and electromagnetics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is inductance from geometry; for the resonant frequency and reactance use a resonance API and for full AC impedance an impedance 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/inductance-api/..."
```

## Pricing
- **Free** (Free) — 2,700 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 37,000 calls/Mo, 6 req/s
- **Pro** ($21/Mo) — 248,000 calls/Mo, 15 req/s
- **Mega** ($66/Mo) — 1,590,000 calls/Mo, 40 req/s

## Endpoints

### Inductance

#### `GET /v1/energy` — Stored energy

**Parameters:**
- `inductance` (query, required, string) — Inductance (H) Example: `0.001`
- `current` (query, required, string) — Current (A) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/inductance-api/v1/energy?inductance=0.001&current=2"
```

**Response:**
```json
{
    "data": {
        "note": "Energy stored in the magnetic field E = ½·L·I²; flux linkage Φ = L·I. The energy is released when the current is interrupted (hence inductive kick).",
        "inputs": {
            "current_a": 2,
            "inductance_h": 0.001
        },
        "energy_mj": 2,
        "energy_joules": 0.002,
        "flux_linkage_wb": 0.002
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.047Z",
        "request_id": "2b62a364-d163-4d32-819f-aa132c170523"
    },
    "status": "ok",
    "message": "Stored energy",
    "success": true
}
```

#### `GET /v1/solenoid` — Solenoid inductance

**Parameters:**
- `turns` (query, required, string) — Number of turns N Example: `100`
- `length` (query, required, string) — Coil length (m) Example: `0.1`
- `area` (query, optional, string) — Cross-sectional area (m²) Example: `0.0001`
- `diameter` (query, optional, string) — Or diameter (m)
- `relative_permeability` (query, optional, string) — Core μr Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/inductance-api/v1/solenoid?turns=100&length=0.1&area=0.0001&relative_permeability=1"
```

**Response:**
```json
{
    "data": {
        "note": "Long-solenoid inductance L = μ₀·μr·N²·A/l, accurate when the length is much greater than the diameter. A ferromagnetic core (μr ≫ 1) multiplies the inductance.",
        "inputs": {
            "turns": 100,
            "area_m2": 0.0001,
            "length_m": 0.1,
            "relative_permeability": 1
        },
        "inductance_h": 1.2566370614e-5,
        "inductance_mh": 0.012566371,
        "inductance_uh": 12.566371
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.147Z",
        "request_id": "59632ddf-f540-429c-bf57-a09647d0e859"
    },
    "status": "ok",
    "message": "Solenoid inductance",
    "success": true
}
```

#### `GET /v1/toroid` — Toroid inductance

**Parameters:**
- `turns` (query, required, string) — Number of turns N Example: `200`
- `height` (query, required, string) — Axial height (m) Example: `0.01`
- `inner_radius` (query, required, string) — Inner radius a (m) Example: `0.05`
- `outer_radius` (query, required, string) — Outer radius b (m) Example: `0.06`
- `relative_permeability` (query, optional, string) — Core μr Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/inductance-api/v1/toroid?turns=200&height=0.01&inner_radius=0.05&outer_radius=0.06&relative_permeability=1"
```

**Response:**
```json
{
    "data": {
        "note": "Rectangular-cross-section toroid L = μ₀·μr·N²·h·ln(b/a)/(2π). The toroidal shape confines the flux, so there is little external field.",
        "inputs": {
            "turns": 200,
            "height_m": 0.01,
            "inner_radius_m": 0.05,
            "outer_radius_m": 0.06,
            "relative_permeability": 1
        },
        "inductance_h": 1.4585724544e-5,
        "inductance_mh": 0.014585725,
        "inductance_uh": 14.585725
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.259Z",
        "request_id": "cee64f35-0a8c-4911-bad6-da76fdbe3472"
    },
    "status": "ok",
    "message": "Toroid inductance",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Lengths and radii in m, area in m², inductance in H (mH/µH also returned), current in A. μ₀ = 4π×10⁻⁷ H/m; relative permeability defaults to 1 (air core).",
        "service": "inductance-api",
        "formulae": {
            "energy": "E = ½·L·I²",
            "toroid": "L = μ₀·μr·N²·h·ln(b/a)/(2π)",
            "solenoid": "L = μ₀·μr·N²·A/l"
        },
        "constants": {
            "mu0_h_per_m": 1.2566370614359173e-6
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/energy": "Stored magnetic energy and flux linkage from inductance and current.",
            "GET /v1/toroid": "Toroid inductance from turns, height, inner/outer radius and permeability.",
            "GET /v1/solenoid": "Solenoid inductance from turns, length, area/diameter and core permeability."
        },
        "description": "Inductance calculator from coil geometry: solenoid and toroid inductance, and the magnetic energy stored in an inductor."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:31.364Z",
        "request_id": "f1341cdd-6f59-4a86-b94a-c5d88358b42b"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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