# VSWR & Impedance Match API
> VSWR and RF impedance-matching maths as an API, computed locally and deterministically. The vswr endpoint computes the voltage standing-wave ratio and its companion figures — the reflection coefficient Γ = (ZL − Z0)/(ZL + Z0) = √(Pr/Pf), the VSWR = (1+|Γ|)/(1−|Γ|), the return loss −20·log₁₀|Γ| dB, the mismatch loss and the percentage of power reflected and transmitted — from a reflection coefficient, a load and source impedance (Z0 default 50 Ω), or the forward and reflected power. The fromvswr endpoint goes the other way, deriving Γ, return loss and the power split from a VSWR figure. The power endpoint computes the reflected and transmitted power from a forward power and a VSWR or reflection coefficient. Everything is computed locally and deterministically, so it is instant and private. Ideal for RF, antenna, amateur-radio and wireless app developers, antenna-tuning and feedline tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is RF impedance match; for antenna gain and aperture use an antenna 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/vswr-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 40,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 250,000 calls/Mo, 25 req/s
- **Mega** ($74/Mo) — 1,503,000 calls/Mo, 80 req/s

## Endpoints

### VSWR

#### `GET /v1/fromvswr` — From a VSWR figure

**Parameters:**
- `vswr` (query, required, string) — VSWR (≥ 1) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vswr-api/v1/fromvswr?vswr=2"
```

**Response:**
```json
{
    "data": {
        "note": "|Γ| = (VSWR−1)/(VSWR+1). A VSWR of 1 is a perfect match (no reflection).",
        "vswr": 2,
        "inputs": {
            "vswr": 2
        },
        "return_loss_db": 9.5424,
        "mismatch_loss_db": 0.51153,
        "reflection_coefficient": 0.333333,
        "power_reflected_percent": 11.1111,
        "power_transmitted_percent": 88.8889
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:11.660Z",
        "request_id": "b1af4af1-4304-40b6-a645-5a2fc8545c20"
    },
    "status": "ok",
    "message": "From VSWR",
    "success": true
}
```

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

**Parameters:**
- `forward_power` (query, required, string) — Forward power Example: `100`
- `vswr` (query, optional, string) — VSWR Example: `2`
- `reflection_coefficient` (query, optional, string) — Or reflection coefficient |Γ|

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vswr-api/v1/power?forward_power=100&vswr=2"
```

**Response:**
```json
{
    "data": {
        "note": "Reflected = forward·|Γ|²; transmitted = forward − reflected. The reflected power returns toward the source.",
        "inputs": {
            "forward_power": 100,
            "reflection_coefficient": 0.333333
        },
        "reflected_power": 11.111111,
        "transmitted_power": 88.888889,
        "power_transmitted_percent": 88.8889
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:11.792Z",
        "request_id": "fc179983-3d51-40bd-b98f-7fae724e506f"
    },
    "status": "ok",
    "message": "Power split",
    "success": true
}
```

#### `GET /v1/vswr` — VSWR & return loss

**Parameters:**
- `reflection_coefficient` (query, optional, string) — Reflection coefficient |Γ| (0–1) Example: `0.2`
- `load_impedance` (query, optional, string) — Load impedance ZL (Ω) Example: `75`
- `source_impedance` (query, optional, string) — Line impedance Z0 (Ω, default 50) Example: `50`
- `forward_power` (query, optional, string) — Forward power
- `reflected_power` (query, optional, string) — Reflected power

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vswr-api/v1/vswr?reflection_coefficient=0.2&load_impedance=75&source_impedance=50"
```

**Response:**
```json
{
    "data": {
        "note": "VSWR = (1+|Γ|)/(1−|Γ|). Γ = (ZL−Z0)/(ZL+Z0) = √(Pr/Pf). Return loss = −20·log₁₀|Γ| dB.",
        "vswr": 1.5,
        "inputs": {
            "from": "reflection_coefficient",
            "load_impedance": 75,
            "source_impedance": 50
        },
        "return_loss_db": 13.9794,
        "mismatch_loss_db": 0.17729,
        "reflection_coefficient": 0.2,
        "power_reflected_percent": 4,
        "power_transmitted_percent": 96
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:11.908Z",
        "request_id": "5fb0b477-8700-4679-8cae-00e8f8403867"
    },
    "status": "ok",
    "message": "VSWR",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Impedances in ohms (Z0 default 50 Ω), power in any consistent unit. Reflection coefficient magnitude 0–1. Assumes real (resistive) impedances; complex matching needs the full reflection vector.",
        "service": "vswr-api",
        "formulae": {
            "vswr": "VSWR = (1+|Γ|)/(1−|Γ|)",
            "gamma": "Γ = (ZL−Z0)/(ZL+Z0) = √(Pr/Pf)",
            "return_loss": "RL = −20·log₁₀|Γ| dB"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/vswr": "VSWR, return loss and mismatch loss from Γ, load/source impedance, or forward/reflected power.",
            "GET /v1/power": "Reflected and transmitted power from forward power and a VSWR or Γ.",
            "GET /v1/fromvswr": "Reflection coefficient, return loss and power split from a VSWR figure."
        },
        "description": "VSWR and impedance-match calculator for RF: VSWR, return loss and mismatch loss from a reflection coefficient, impedances or power; plus the forward/reflected power split."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:12.014Z",
        "request_id": "b56ef0d1-e376-4d15-a158-6b3a843e850f"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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