# PCB Design API
> Printed-circuit-board design maths as an API, computed locally and deterministically. The trace-width endpoint applies the IPC-2221 standard to find the minimum copper trace width for a current and an allowable temperature rise, A = (I/(k·ΔT^0.44))^(1/0.725) with k = 0.048 for outer layers and 0.024 for inner, returning the cross-section and the width in mils and millimetres for a given copper weight. The trace-resistance endpoint computes a trace's resistance from its width, length and copper thickness, R = ρ·L/(W·t), with the copper temperature coefficient, and — given a current — the voltage drop and power dissipation. The microstrip endpoint computes the characteristic impedance of a microstrip line by the Hammerstad model from the trace width, the dielectric height and the dielectric constant (about 4.5 for FR4), with the effective permittivity and propagation delay for controlled-impedance routing. Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics, hardware, embedded and PCB-design app developers, board-layout and signal-integrity tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is PCB design; for resistor colour codes use a resistor API and for general Ohm's-law maths an Ohm's-law 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/pcb-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 15 req/s
- **Mega** ($75/Mo) — 788,000 calls/Mo, 40 req/s

## Endpoints

### PCB

#### `GET /v1/microstrip` — Microstrip impedance

**Parameters:**
- `width` (query, required, string) — Trace width (mm) Example: `0.5`
- `height` (query, required, string) — Dielectric height (mm) Example: `0.5`
- `dielectric` (query, optional, string) — Dielectric constant εr Example: `4.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pcb-api/v1/microstrip?width=0.5&height=0.5&dielectric=4.5"
```

**Response:**
```json
{
    "data": {
        "note": "Hammerstad microstrip model. εr ≈ 4.5 for FR4; the effective εr accounts for fields in both the substrate and air.",
        "inputs": {
            "w_over_h": 1,
            "width_mm": 0.5,
            "height_mm": 0.5,
            "dielectric_constant": 4.5
        },
        "impedance_ohm": 70.119,
        "propagation_velocity_m_s": 166670683.99,
        "propagation_delay_ps_per_mm": 5.999855,
        "effective_dielectric_constant": 3.235363
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.301Z",
        "request_id": "75d1e9e9-ba79-4f5c-a4ef-cc4534469aa5"
    },
    "status": "ok",
    "message": "Microstrip impedance",
    "success": true
}
```

#### `GET /v1/trace-resistance` — Trace resistance

**Parameters:**
- `width` (query, required, string) — Trace width (mm) Example: `0.762`
- `length` (query, required, string) — Trace length (mm) Example: `100`
- `copper_oz` (query, optional, string) — Copper weight (oz) Example: `1`
- `temperature` (query, optional, string) — Temperature (°C) Example: `20`
- `current` (query, optional, string) — Current (A) for drop/loss Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pcb-api/v1/trace-resistance?width=0.762&length=100&copper_oz=1&temperature=20&current=2"
```

**Response:**
```json
{
    "data": {
        "note": "Trace resistance R = ρ·L/(W·t), copper ρ = 1.724×10⁻⁸ Ω·m at 20 °C with a +0.393 %/°C tempco.",
        "inputs": {
            "width_mm": 0.762,
            "length_mm": 100,
            "temperature_c": 20,
            "copper_thickness_mm": 0.0347
        },
        "current_a": 2,
        "resistance_ohm": 0.065200784,
        "voltage_drop_v": 0.130402,
        "power_dissipation_w": 0.260803,
        "resistance_milliohm": 65.200784
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.399Z",
        "request_id": "1b485884-1be9-42a7-b4e1-5ec260c728db"
    },
    "status": "ok",
    "message": "Trace resistance",
    "success": true
}
```

#### `GET /v1/trace-width` — IPC-2221 trace width

**Parameters:**
- `current` (query, required, string) — Current (A) Example: `2`
- `temp_rise` (query, optional, string) — Allowable temp rise (°C) Example: `10`
- `layer` (query, optional, string) — external or internal Example: `external`
- `copper_oz` (query, optional, string) — Copper weight (oz) Example: `1`
- `thickness_mm` (query, optional, string) — Or copper thickness (mm)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/pcb-api/v1/trace-width?current=2&temp_rise=10&layer=external&copper_oz=1"
```

**Response:**
```json
{
    "data": {
        "note": "IPC-2221: A = (I/(k·ΔT^0.44))^(1/0.725) in mils²; k = 0.048 external, 0.024 internal. Width = area ÷ copper thickness.",
        "inputs": {
            "layer": "external",
            "current_a": 2,
            "temp_rise_c": 10,
            "copper_thickness_mm": 0.0347
        },
        "trace_width_mm": 0.78819,
        "trace_width_mils": 31.0312,
        "cross_section_mils2": 42.3931
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.502Z",
        "request_id": "f11b4805-d37a-41cb-b74e-feaab05eca51"
    },
    "status": "ok",
    "message": "Trace width",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Current in A, temperature rise in °C, widths/lengths in mm, copper weight in oz (1 oz ≈ 34.7 µm) or thickness_mm. εr ≈ 4.5 for FR4.",
        "service": "pcb-api",
        "formulae": {
            "microstrip": "Hammerstad Z₀ from W/h and εr",
            "resistance": "R = ρ·L/(W·t)",
            "trace_width": "A = (I/(k·ΔT^0.44))^(1/0.725), width = A/thickness"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/microstrip": "Characteristic impedance of a microstrip line (Hammerstad).",
            "GET /v1/trace-width": "Minimum trace width (IPC-2221) for a current and temperature rise.",
            "GET /v1/trace-resistance": "Trace resistance, voltage drop and power loss from its geometry."
        },
        "description": "PCB design calculator: IPC-2221 minimum trace width for a current, trace resistance and voltage drop, and microstrip characteristic impedance."
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:01.574Z",
        "request_id": "14650259-4ecf-44ff-a859-a651f4e58df2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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