# BJT Transistor API
> Bipolar-junction-transistor (BJT) circuit maths as an API, computed locally and deterministically. The currents endpoint relates the three terminal currents through the DC current gain β (hFE): the collector current Ic = β·Ib, the emitter current Ie = (β+1)·Ib and the common-base gain α = β/(β+1) ≈ 1, from β and any one current. The bias endpoint analyses the operating point of the classic voltage-divider bias network — from the supply voltage, the two divider resistors, the collector and emitter resistors, β and the base-emitter drop it computes the Thévenin equivalent (Vth = Vcc·R2/(R1+R2), Rth = R1‖R2), the base current Ib = (Vth − Vbe)/(Rth + (β+1)·Re), the collector and emitter currents, the collector-emitter voltage Vce and the node voltages, and classifies the operating region as cutoff, active or saturation. The power endpoint computes the transistor's power dissipation, Pd ≈ Vce·Ic (plus Vbe·Ib), to check it against the rated maximum. Currents are in amperes, resistances in ohms and voltages in volts, with Vbe defaulting to 0.7 V for silicon. Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics, amplifier-design, embedded and hobbyist app developers, biasing and operating-point tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is BJT biasing; for op-amp circuits use an op-amp 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/transistor-api/..."
```

## Pricing
- **Free** (Free) — 2,580 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 39,200 calls/Mo, 6 req/s
- **Pro** ($21/Mo) — 253,000 calls/Mo, 15 req/s
- **Mega** ($65/Mo) — 1,640,000 calls/Mo, 40 req/s

## Endpoints

### Transistor

#### `GET /v1/bias` — Voltage-divider bias

**Parameters:**
- `supply_voltage` (query, required, string) — Vcc (V) Example: `12`
- `r1` (query, required, string) — R1 (Ω) Example: `47000`
- `r2` (query, required, string) — R2 (Ω) Example: `10000`
- `rc` (query, optional, string) — Collector resistor Rc (Ω) Example: `1000`
- `re` (query, optional, string) — Emitter resistor Re (Ω) Example: `220`
- `beta` (query, required, string) — β (hFE) Example: `100`
- `vbe` (query, optional, string) — Base-emitter drop (V) Example: `0.7`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/transistor-api/v1/bias?supply_voltage=12&r1=47000&r2=10000&rc=1000&re=220&beta=100&vbe=0.7"
```

**Response:**
```json
{
    "data": {
        "note": "Voltage-divider bias: Vth = Vcc·R2/(R1+R2), Rth = R1‖R2; Ib = (Vth−Vbe)/(Rth+(β+1)Re). A mid-rail Vce (~Vcc/2) gives the most symmetric swing.",
        "vb_v": 1.724924,
        "vc_v": 7.38738,
        "ve_v": 1.024924,
        "vce_v": 6.362455,
        "inputs": {
            "r1": 47000,
            "r2": 10000,
            "rc": 1000,
            "re": 220,
            "vbe": 0.7,
            "beta": 100,
            "supply_voltage": 12
        },
        "region": "active",
        "base_current_a": 4.6126205e-5,
        "emitter_current_a": 0.0046587467,
        "thevenin_voltage_v": 2.105263,
        "collector_current_a": 0.0046126205,
        "thevenin_resistance_ohm": 8245.614
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.863Z",
        "request_id": "3543df5a-5cb2-4bc6-a70c-68950d3c0023"
    },
    "status": "ok",
    "message": "Voltage-divider bias",
    "success": true
}
```

#### `GET /v1/currents` — BJT currents

**Parameters:**
- `beta` (query, required, string) — Current gain β (hFE) Example: `100`
- `base_current` (query, optional, string) — Base current Ib (A) Example: `0.0000461`
- `collector_current` (query, optional, string) — Or collector current Ic (A)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/transistor-api/v1/currents?beta=100&base_current=0.0000461"
```

**Response:**
```json
{
    "data": {
        "note": "BJT current relations: Ic = β·Ib, Ie = Ic + Ib = (β+1)·Ib, and the common-base gain α = β/(β+1) ≈ 1.",
        "alpha": 0.99009901,
        "inputs": {
            "beta": 100,
            "base_current": 4.61e-5,
            "collector_current": null
        },
        "base_current_a": 4.61e-5,
        "emitter_current_a": 0.0046561,
        "collector_current_a": 0.00461
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:23.972Z",
        "request_id": "1c2e703e-574d-445d-81ed-0436f97b2818"
    },
    "status": "ok",
    "message": "BJT currents",
    "success": true
}
```

#### `GET /v1/power` — Power dissipation

**Parameters:**
- `vce` (query, required, string) — Vce (V) Example: `6.37`
- `collector_current` (query, required, string) — Ic (A) Example: `0.00461`
- `vbe` (query, optional, string) — Vbe (V) Example: `0.7`
- `base_current` (query, optional, string) — Ib (A)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/transistor-api/v1/power?vce=6.37&collector_current=0.00461&vbe=0.7"
```

**Response:**
```json
{
    "data": {
        "note": "Transistor power dissipation Pd ≈ Vce·Ic (+ Vbe·Ib). Keep it below the rated Pd(max), derated for temperature, and add a heat sink if needed.",
        "inputs": {
            "vbe": 0.7,
            "vce": 6.37,
            "base_current": 0,
            "collector_current": 0.00461
        },
        "base_dissipation_w": 0,
        "total_dissipation_w": 0.0293657,
        "collector_dissipation_w": 0.0293657
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:24.079Z",
        "request_id": "fd2322b7-6880-4626-bc5c-f97887475b7d"
    },
    "status": "ok",
    "message": "Power dissipation",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Currents in A, resistances in Ω, voltages in V. Vbe defaults to 0.7 V (silicon). β is the DC current gain hFE.",
        "service": "transistor-api",
        "formulae": {
            "bias": "Ib = (Vth − Vbe)/(Rth + (β+1)·Re)",
            "power": "Pd = Vce·Ic",
            "currents": "Ic = β·Ib ; Ie = (β+1)·Ib ; α = β/(β+1)"
        },
        "endpoints": {
            "GET /v1/bias": "Operating point (Ic, Vce, region) of a voltage-divider bias network.",
            "GET /v1/meta": "This document.",
            "GET /v1/power": "Transistor power dissipation from Vce and Ic.",
            "GET /v1/currents": "Base, collector and emitter currents and α from β and one current."
        },
        "description": "Bipolar-junction-transistor (BJT) calculator: current relations through β, voltage-divider bias-point analysis and power dissipation."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:24.187Z",
        "request_id": "1429f18e-f5b3-484f-a937-b37c9a4b83c1"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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