# NTC Thermistor API
> NTC-thermistor sensor maths as an API, computed locally and deterministically. The steinhart-hart endpoint converts between resistance and temperature using the Steinhart-Hart equation, 1/T = A + B·ln R + C·(ln R)³ — the most accurate NTC model — in both directions, solving the resistance at a given temperature with Cardano's cubic formula. The beta endpoint uses the simpler two-point Beta model, 1/T = 1/T0 + (1/β)·ln(R/R0) and R = R0·exp(β·(1/T − 1/T0)), to convert resistance to temperature or back from a reference resistance R0 at T0 (default 25 °C) and the beta coefficient. The divider endpoint recovers the thermistor's resistance from a voltage-divider reading — low-side R = Rs·Vout/(Vsupply − Vout) or high-side — so an ADC voltage can be turned into a resistance and then a temperature. Resistance is in ohms, temperature in °C (kelvin also returned), voltages in volts and beta in kelvin. Everything is computed locally and deterministically, so it is instant and private. Ideal for embedded, IoT, HVAC-control, 3D-printer and battery-management app developers, temperature-sensing and calibration tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is NTC thermistor conversion; for a generic resistive divider use an LED-resistor or voltage-drop API and for thermal expansion a thermal-expansion 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/thermistor-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 38,000 calls/Mo, 6 req/s
- **Pro** ($23/Mo) — 230,000 calls/Mo, 15 req/s
- **Mega** ($72/Mo) — 1,600,000 calls/Mo, 40 req/s

## Endpoints

### Thermistor

#### `GET /v1/beta` — Beta model

**Parameters:**
- `beta` (query, required, string) — Beta coefficient (K) Example: `3950`
- `r0` (query, required, string) — Reference resistance R0 (Ω) Example: `10000`
- `t0` (query, optional, string) — Reference temperature T0 (°C) Example: `25`
- `resistance` (query, optional, string) — Resistance (Ω) for R→T Example: `6505`
- `temperature` (query, optional, string) — Or temperature (°C) for T→R

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thermistor-api/v1/beta?beta=3950&r0=10000&t0=25&resistance=6505"
```

**Response:**
```json
{
    "data": {
        "note": "Beta model: 1/T = 1/T0 + (1/β)·ln(R/R0). Simple two-point fit; less accurate than Steinhart-Hart over wide ranges.",
        "inputs": {
            "t0_c": 25,
            "beta_k": 3950,
            "r0_ohm": 10000,
            "resistance_ohm": 6505
        },
        "temperature_c": 35.002,
        "temperature_k": 308.152
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:38.616Z",
        "request_id": "04c6ff93-0560-4290-82d8-058ae0bbb2d9"
    },
    "status": "ok",
    "message": "Beta model",
    "success": true
}
```

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

**Parameters:**
- `supply_voltage` (query, required, string) — Supply voltage (V) Example: `3.3`
- `output_voltage` (query, required, string) — Midpoint voltage (V) Example: `1.5`
- `series_resistor` (query, required, string) — Series resistor (Ω) Example: `10000`
- `side` (query, optional, string) — Thermistor side: low or high Example: `low`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thermistor-api/v1/divider?supply_voltage=3.3&output_voltage=1.5&series_resistor=10000&side=low"
```

**Response:**
```json
{
    "data": {
        "note": "Voltage divider: low-side thermistor R = Rs·Vout/(Vs−Vout); high-side R = Rs·(Vs−Vout)/Vout. Feed the resistance into /v1/beta or /v1/steinhart-hart to get the temperature.",
        "inputs": {
            "side": "low",
            "output_voltage": 1.5,
            "supply_voltage": 3.3,
            "series_resistor_ohm": 10000
        },
        "thermistor_resistance_ohm": 8333.3333
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:38.727Z",
        "request_id": "621c1287-2673-4bd1-9737-c5b9d68dcf93"
    },
    "status": "ok",
    "message": "Voltage divider",
    "success": true
}
```

#### `GET /v1/steinhart-hart` — Steinhart-Hart

**Parameters:**
- `a` (query, required, string) — Coefficient A Example: `0.001009249522`
- `b` (query, required, string) — Coefficient B Example: `0.0002378405444`
- `c` (query, required, string) — Coefficient C Example: `0.0000002019202697`
- `resistance` (query, optional, string) — Resistance (Ω) for R→T Example: `10000`
- `temperature` (query, optional, string) — Or temperature (°C) for T→R

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thermistor-api/v1/steinhart-hart?a=0.001009249522&b=0.0002378405444&c=0.0000002019202697&resistance=10000"
```

**Response:**
```json
{
    "data": {
        "note": "Steinhart-Hart: 1/T = A + B·ln R + C·(ln R)³. The most accurate NTC model; coefficients are fitted from three calibration points.",
        "inputs": {
            "a": 0.001009249522,
            "b": 0.0002378405444,
            "c": 2.019202697e-7,
            "resistance_ohm": 10000
        },
        "temperature_c": 24.6813,
        "temperature_k": 297.8313
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:38.830Z",
        "request_id": "aab3284f-ba9e-41e5-b6b8-c0d34851ddc9"
    },
    "status": "ok",
    "message": "Steinhart-Hart",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Resistance in Ω, temperature in °C (kelvin also returned), voltages in V, beta in K. Default T0 is 25 °C.",
        "service": "thermistor-api",
        "formulae": {
            "beta": "1/T = 1/T0 + (1/β)·ln(R/R0)",
            "steinhart_hart": "1/T = A + B·ln R + C·(ln R)³",
            "divider_low_side": "R = Rs·Vout/(Vs − Vout)"
        },
        "endpoints": {
            "GET /v1/beta": "Resistance↔temperature via the Beta model with R0, T0 and beta.",
            "GET /v1/meta": "This document.",
            "GET /v1/divider": "Thermistor resistance from a voltage-divider reading (low- or high-side).",
            "GET /v1/steinhart-hart": "Resistance↔temperature via the Steinhart-Hart equation with A/B/C coefficients."
        },
        "description": "NTC thermistor calculator: Steinhart-Hart and Beta-model resistance↔temperature conversion (both directions) and voltage-divider resistance readout."
    },
    "meta": {
        "timestamp": "2026-06-05T11:30:38.937Z",
        "request_id": "8f0226b5-796b-4602-8478-91c08fc3e66b"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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