# Zener Regulator API
> Zener-diode voltage-regulator electronics maths as an API, computed locally and deterministically. The series-resistor endpoint sizes the series (dropping) resistor for a shunt Zener regulator, Rs = (Vin − Vz)/(Iz + Il), from the input voltage, the Zener voltage, the load current and the desired Zener (knee) current, and gives the power the resistor and the Zener must dissipate — the core design step so the diode stays in regulation at maximum load. The regulator endpoint analyses an existing regulator: from the input voltage, the Zener voltage, the series resistor and the load (as a current or a resistance) it computes the total current, the Zener current Iz = (Vin − Vz)/Rs − Il, the load current, the output voltage and whether the regulator is still regulating (Iz > 0) or has dropped out under heavy load. The power endpoint computes the Zener power dissipation P = Vz·Iz and the maximum safe current Iz_max = Pz_max/Vz from the diode's power rating. Voltages are in volts, currents in amperes, resistances in ohms and power in watts. Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics, power-supply, hobbyist and embedded app developers, regulator-design and reference-voltage tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the Zener shunt regulator; for BJT biasing use a transistor API and for an LED series resistor an LED-resistor 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/zener-api/..."
```

## Pricing
- **Free** (Free) — 2,720 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 40,800 calls/Mo, 6 req/s
- **Pro** ($20/Mo) — 254,000 calls/Mo, 15 req/s
- **Mega** ($63/Mo) — 1,645,000 calls/Mo, 40 req/s

## Endpoints

### Zener

#### `GET /v1/power` — Power & current limit

**Parameters:**
- `zener_voltage` (query, required, string) — Zener voltage Vz (V) Example: `5.1`
- `zener_current` (query, optional, string) — Zener current Iz (A) Example: `0.01`
- `power_rating` (query, optional, string) — Rated power Pz_max (W) Example: `0.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/zener-api/v1/power?zener_voltage=5.1&zener_current=0.01&power_rating=0.5"
```

**Response:**
```json
{
    "data": {
        "note": "Zener dissipation P = Vz·Iz. The maximum safe current is Iz_max = Pz_max/Vz; stay well below it (derate for temperature).",
        "inputs": {
            "power_rating": 0.5,
            "zener_current": 0.01,
            "zener_voltage": 5.1
        },
        "dissipation_w": 0.051,
        "max_current_a": 0.09803922,
        "within_rating": true,
        "max_current_ma": 98.0392
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.327Z",
        "request_id": "5a6b5a6d-f38f-4ff7-9120-d94033d86369"
    },
    "status": "ok",
    "message": "Power & current limit",
    "success": true
}
```

#### `GET /v1/regulator` — Regulator analysis

**Parameters:**
- `input_voltage` (query, required, string) — Input voltage Vin (V) Example: `12`
- `zener_voltage` (query, required, string) — Zener voltage Vz (V) Example: `5.1`
- `series_resistor` (query, required, string) — Series resistor Rs (Ω) Example: `230`
- `load_current` (query, optional, string) — Load current Il (A) Example: `0.02`
- `load_resistance` (query, optional, string) — Or load resistance (Ω)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/zener-api/v1/regulator?input_voltage=12&zener_voltage=5.1&series_resistor=230&load_current=0.02"
```

**Response:**
```json
{
    "data": {
        "note": "Zener current Iz = (Vin − Vz)/Rs − Il > 0, so the output is held at Vz. As the load draws more, the Zener gives up current; if Iz reaches 0 regulation is lost.",
        "inputs": {
            "load_current": 0.02,
            "input_voltage": 12,
            "zener_voltage": 5.1,
            "series_resistor": 230
        },
        "regulating": true,
        "zener_power_w": 0.051,
        "load_current_a": 0.02,
        "total_current_a": 0.03,
        "zener_current_a": 0.01,
        "output_voltage_v": 5.1,
        "resistor_power_w": 0.207
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.410Z",
        "request_id": "9f61e4cd-fa7f-43c5-b481-1ba0c5174e72"
    },
    "status": "ok",
    "message": "Regulator analysis",
    "success": true
}
```

#### `GET /v1/series-resistor` — Series resistor

**Parameters:**
- `input_voltage` (query, required, string) — Input voltage Vin (V) Example: `12`
- `zener_voltage` (query, required, string) — Zener voltage Vz (V) Example: `5.1`
- `load_current` (query, optional, string) — Load current Il (A) Example: `0.02`
- `zener_current` (query, optional, string) — Zener knee current Iz (A) Example: `0.01`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/zener-api/v1/series-resistor?input_voltage=12&zener_voltage=5.1&load_current=0.02&zener_current=0.01"
```

**Response:**
```json
{
    "data": {
        "note": "Series resistor Rs = (Vin − Vz)/(Iz + Il). Pick Iz a few mA above the knee so the Zener stays in regulation at maximum load. Rate the resistor for its dissipation (Vin−Vz)·I_total.",
        "inputs": {
            "load_current": 0.02,
            "input_voltage": 12,
            "zener_current": 0.01,
            "zener_voltage": 5.1
        },
        "zener_power_w": 0.051,
        "resistor_power_w": 0.207,
        "series_resistor_ohm": 230
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.520Z",
        "request_id": "086d02e1-4c01-4f49-9246-33d04240e036"
    },
    "status": "ok",
    "message": "Series resistor",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Voltages in V, currents in A, resistances in Ω, power in W. A shunt Zener regulator holds the output at Vz as long as the Zener keeps conducting (Iz > 0).",
        "service": "zener-api",
        "formulae": {
            "max_current": "Iz_max = Pz_max/Vz",
            "zener_current": "Iz = (Vin − Vz)/Rs − Il",
            "series_resistor": "Rs = (Vin − Vz)/(Iz + Il)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/power": "Zener dissipation and the maximum safe current from the power rating.",
            "GET /v1/regulator": "Zener/load currents, output voltage and whether the regulator is in regulation.",
            "GET /v1/series-resistor": "Series resistor and power ratings for a shunt Zener regulator."
        },
        "description": "Zener-diode voltage-regulator calculator: series-resistor sizing, regulator operating-point analysis, and Zener power dissipation and current limits."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.624Z",
        "request_id": "0e1e9af7-5f64-44d8-a8be-7ef706f07adb"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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