# Standing Wave API
> Standing-wave and resonance maths for strings and air columns as an API, computed locally and deterministically. The string endpoint models a string fixed at both ends: from its length and the wave speed — given directly or as the tension and the linear mass density (which you can supply directly, or have computed from a mass and length, or from a wire diameter and material density) — it returns the wave speed v = √(T/μ), the fundamental frequency f₁ = v/(2L) and the harmonic series f_n = n·f₁, each with its wavelength and node and antinode count; it can also solve the tension needed to tune the string to a target fundamental. The pipe endpoint does the same for an air column: an open pipe (both ends open) resonates at all harmonics f_n = n·v/(2L) while a closed (stopped) pipe resonates only at the odd harmonics f_n = (2n−1)·v/(4L), with the speed of sound given directly or worked out from the air temperature, v = 331.3·√(1 + θ/273.15). The harmonics endpoint generates the harmonic series from a fundamental frequency, or from a wave speed and a length, for a string, an open pipe or a closed pipe. Everything is computed locally and deterministically, so it is instant and private. Ideal for musical-instrument and luthier tools, acoustics and audio apps, organ-pipe and wind-instrument design, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is mechanical standing waves and resonance; for note-to-frequency music theory use a music-note API and for electromagnetic wavelength λ = c/f use a wavelength 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/standingwave-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($15/Mo) — 200,000 calls/Mo, 15 req/s
- **Mega** ($49/Mo) — 1,500,000 calls/Mo, 40 req/s

## Endpoints

### Standing Wave

#### `GET /v1/harmonics` — Harmonic series

**Parameters:**
- `fundamental` (query, optional, string) — Fundamental frequency (Hz) Example: `100`
- `wave_speed` (query, optional, string) — Or wave speed (m/s) with length
- `length` (query, optional, string) — Length (m)
- `system` (query, optional, string) — string | open | closed Example: `string`
- `harmonics` (query, optional, string) — Number of harmonics (default 6) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/standingwave-api/v1/harmonics?fundamental=100&system=string&harmonics=6"
```

**Response:**
```json
{
    "data": {
        "system": "string / open pipe (all harmonics)",
        "formula": "f_n = n·f₁ (all harmonics).",
        "harmonics": [
            {
                "index": 1,
                "frequency_hz": 100,
                "harmonic_number": 1
            },
            {
                "index": 2,
                "frequency_hz": 200,
                "harmonic_number": 2
            },
            {
                "index": 3,
                "frequency_hz": 300,
                "harmonic_number": 3
            },
            {
                "index": 4,
                "frequency_hz": 400,
                "harmonic_number": 4
            },
            {
                "index": 5,
                "frequency_hz": 500,
                "harmonic_number": 5
            },
            {
                "index": 6,
                "frequency_hz": 600,
                "harmonic_number": 6
            }
        ],
        "wave_speed_ms": null,
        "fundamental_frequency_hz": 100
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.501Z",
        "request_id": "2965a633-c33b-4256-babf-b642b92e1540"
    },
    "status": "ok",
    "message": "Harmonic series",
    "success": true
}
```

#### `GET /v1/pipe` — Air-column resonance

**Parameters:**
- `length` (query, required, string) — Pipe length (m) Example: `0.5`
- `type` (query, optional, string) — open (open-open) or closed (stopped) Example: `open`
- `speed_of_sound` (query, optional, string) — Speed of sound (m/s)
- `temperature` (query, optional, string) — Or air temperature (°C) → speed Example: `20`
- `harmonics` (query, optional, string) — Number of harmonics (default 6) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/standingwave-api/v1/pipe?length=0.5&type=open&temperature=20&harmonics=6"
```

**Response:**
```json
{
    "data": {
        "system": "open pipe (both ends open — all harmonics)",
        "formula": "f_n = n·v/(2L); open pipes resonate at all harmonics.",
        "length_m": 0.5,
        "harmonics": [
            {
                "index": 1,
                "nodes": 2,
                "antinodes": 1,
                "frequency_hz": 343.214623,
                "wavelength_m": 1,
                "harmonic_number": 1
            },
            {
                "index": 2,
                "nodes": 3,
                "antinodes": 2,
                "frequency_hz": 686.429245,
                "wavelength_m": 0.5,
                "harmonic_number": 2
            },
            {
                "index": 3,
                "nodes": 4,
                "antinodes": 3,
                "frequency_hz": 1029.643868,
                "wavelength_m": 0.33333333,
                "harmonic_number": 3
            },
            {
                "index": 4,
                "nodes": 5,
                "antinodes": 4,
                "frequency_hz": 1372.858491,
                "wavelength_m": 0.25,
                "harmonic_number": 4
            },
            {
                "index": 5,
                "nodes": 6,
                "antinodes": 5,
                "frequency_hz": 1716.073113,
                "wavelength_m": 0.2,
                "harmonic_number": 5
            },
            {
                "index": 6,
                "nodes": 7,
                "antinodes": 6,
       
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/string` — Vibrating-string harmonics

**Parameters:**
- `length` (query, required, string) — String length (m) Example: `0.65`
- `tension` (query, optional, string) — Tension (N) Example: `80`
- `linear_density` (query, optional, string) — Linear mass density μ (kg/m) Example: `0.0005`
- `mass` (query, optional, string) — Or mass to derive μ (kg)
- `diameter` (query, optional, string) — Or wire diameter (m) with density
- `material_density` (query, optional, string) — Material density (kg/m³)
- `target_frequency` (query, optional, string) — Solve tension for this fundamental (Hz)
- `harmonics` (query, optional, string) — Number of harmonics (default 6) Example: `6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/standingwave-api/v1/string?length=0.65&tension=80&linear_density=0.0005&harmonics=6"
```

**Response:**
```json
{
    "data": {
        "system": "string (fixed at both ends)",
        "formula": "v = √(T/μ); f_n = n·v/(2L); λ_n = 2L/n.",
        "length_m": 0.65,
        "harmonics": [
            {
                "index": 1,
                "nodes": 2,
                "antinodes": 1,
                "frequency_hz": 307.692308,
                "wavelength_m": 1.3,
                "harmonic_number": 1
            },
            {
                "index": 2,
                "nodes": 3,
                "antinodes": 2,
                "frequency_hz": 615.384615,
                "wavelength_m": 0.65,
                "harmonic_number": 2
            },
            {
                "index": 3,
                "nodes": 4,
                "antinodes": 3,
                "frequency_hz": 923.076923,
                "wavelength_m": 0.43333333,
                "harmonic_number": 3
            },
            {
                "index": 4,
                "nodes": 5,
                "antinodes": 4,
                "frequency_hz": 1230.769231,
                "wavelength_m": 0.325,
                "harmonic_number": 4
            },
            {
                "index": 5,
                "nodes": 6,
                "antinodes": 5,
                "frequency_hz": 1538.461538,
                "wavelength_m": 0.26,
                "harmonic_number": 5
            },
            {
                "index": 6,
                "nodes": 7,
                "antinodes": 6,
                "frequency_hz
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "standingwave",
        "note": "Standing-wave / resonance maths (strings & air columns) — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/string",
            "/v1/pipe",
            "/v1/harmonics",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.804Z",
        "request_id": "a4b609a0-0c54-467d-819d-bcd12da16a3a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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