# Guitar Luthier API
> Guitar and luthier maths as an API, computed locally and deterministically — the string-tension and fret numbers a player, builder or tech sets an instrument up with. The string-tension endpoint gives the tension a string pulls at pitch from the physics, tension = unit weight × (2 × scale length × frequency)² ÷ 386.4, where the unit weight (lb/in) comes from the string maker's chart — a .010 plain-steel high E on a 25.5-inch scale tuned to 329.6 Hz pulls about 16 lb. The fret-position endpoint gives the distance from the nut to any fret in equal temperament, scale × (1 − 2^(−fret/12)), so the 12th fret sits exactly halfway and the first fret of a 25.5-inch scale is 1.43 inches down — the maths behind every fretboard slot. The set-tension endpoint sums a whole string set into the total load on the neck (a typical six-string runs ~95–120 lb), the number that decides whether a gauge or tuning change needs a truss-rod re-setup. Everything is computed locally and deterministically, so it is instant and private. Ideal for luthier and guitar-tech apps, string-tension and fret-slotting calculators, setup and re-string tools, and music-gear sites. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. Get unit weights from the string maker's chart. For note↔frequency conversion use a music-theory 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/guitar-api/..."
```

## Pricing
- **Free** (Free) — 700 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 16,500 calls/Mo, 8 req/s
- **Pro** ($16/Mo) — 98,000 calls/Mo, 20 req/s
- **Mega** ($48/Mo) — 330,000 calls/Mo, 48 req/s

## Endpoints

### Guitar

#### `GET /v1/fret-position` — Fret distance from the nut

**Parameters:**
- `scale_length_in` (query, required, string) — Scale length in inches Example: `25.5`
- `fret_number` (query, required, string) — Fret number Example: `12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/guitar-api/v1/fret-position?scale_length_in=25.5&fret_number=12"
```

#### `GET /v1/set-tension` — Total neck tension of a set

**Parameters:**
- `unit_weights_lb_in` (query, required, string) — Comma-separated unit weights (lb/in) Example: `0.0003297,0.0001705,0.0000889,0.00006402,0.00003744,0.00002215`
- `frequencies_hz` (query, required, string) — Comma-separated frequencies (Hz) Example: `82.41,110,146.83,196,246.94,329.63`
- `scale_length_in` (query, required, string) — Scale length in inches Example: `25.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/guitar-api/v1/set-tension?unit_weights_lb_in=0.0003297%2C0.0001705%2C0.0000889%2C0.00006402%2C0.00003744%2C0.00002215&frequencies_hz=82.41%2C110%2C146.83%2C196%2C246.94%2C329.63&scale_length_in=25.5"
```

#### `GET /v1/string-tension` — Tension of one string

**Parameters:**
- `unit_weight_lb_in` (query, required, string) — Unit weight in lb/in (maker chart) Example: `0.00002215`
- `scale_length_in` (query, required, string) — Scale length in inches Example: `25.5`
- `frequency_hz` (query, required, string) — Tuned frequency in Hz Example: `329.63`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/guitar-api/v1/string-tension?unit_weight_lb_in=0.00002215&scale_length_in=25.5&frequency_hz=329.63"
```

### Meta

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

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


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