{"openapi":"3.1.0","info":{"title":"Fret Spacing API","version":"1.0.0","description":"Fretted-instrument lutherie maths as an API, computed locally and deterministically — the fret positions a guitar, bass, mandolin or ukulele builder slots a fingerboard to. This is instrument-building geometry, not music theory. The positions endpoint lays out a whole fingerboard from the scale length using the twelve-tone equal-temperament rule: the distance from the nut to fret n = scale length × (1 − 1 ÷ 2^(n/12)), so the 12th fret lands at exactly half the scale (the octave) and each gap shrinks by the constant ratio 2^(1/12) ≈ 1.0595 toward the bridge — a 25.5-inch Fender scale puts fret 1 at 1.431 inches and fret 12 at 12.75. The fret endpoint gives one fret’s distance from the nut, from the previous fret and to the bridge; the scalelength endpoint runs it backwards, recovering the scale length from a measured distance to a known fret (measure to the 12th and double it). It works in inches or millimetres — 25.5 Fender, 24.75 Gibson, 25.4 classical, 34 bass. Everything is computed locally and deterministically, so it is instant and private. Ideal for lutherie, guitar-building, instrument-design and maker app developers, fingerboard-slotting and fret-calculator tools, and CAD/CNC templates. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. For note names or frequencies use a music-theory API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/fretspacing-api","description":"oanor gateway"}],"tags":[{"name":"Fret"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/fret":{"get":{"operationId":"get_v1_fret","tags":["Fret"],"summary":"Single fret position","description":"","parameters":[{"name":"scale_length","in":"query","required":true,"description":"Scale length","schema":{"type":"string"},"example":"25.5"},{"name":"fret","in":"query","required":true,"description":"Fret number","schema":{"type":"string"},"example":"12"},{"name":"unit","in":"query","required":false,"description":"in or mm","schema":{"type":"string"},"example":"in"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"From the nut to fret n = scale × (1 − 1/2^(n/12)). The spacing shrinks geometrically toward the bridge — each fret is the same ratio (2^(1/12) ≈ 1.0595) closer than the last.","inputs":{"fret":12,"unit":"in","scale_length":25.5},"from_nut":12.75,"from_previous_fret":0.7582,"remaining_to_bridge":12.75},"meta":{"timestamp":"2026-06-06T07:13:56.847Z","request_id":"a749f37a-4648-4113-b56c-a4b15b94aac6"},"status":"ok","message":"Single fret","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/positions":{"get":{"operationId":"get_v1_positions","tags":["Fret"],"summary":"All fret positions","description":"","parameters":[{"name":"scale_length","in":"query","required":true,"description":"Scale length","schema":{"type":"string"},"example":"25.5"},{"name":"frets","in":"query","required":false,"description":"Number of frets (default 22)","schema":{"type":"string"},"example":"22"},{"name":"unit","in":"query","required":false,"description":"in or mm (default in)","schema":{"type":"string"},"example":"in"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Distance from the nut to fret n = scale length × (1 − 1 ÷ 2^(n/12)), equal temperament. The 12th fret lands at exactly half the scale (the octave). Measure to the centre of each fret slot from the nut, not fret-to-fret cumulatively.","frets":[{"fret":1,"from_nut":1.4312,"from_previous":1.4312},{"fret":2,"from_nut":2.7821,"from_previous":1.3509},{"fret":3,"from_nut":4.0571,"from_previous":1.2751},{"fret":4,"from_nut":5.2606,"from_previous":1.2035},{"fret":5,"from_nut":6.3966,"from_previous":1.1359},{"fret":6,"from_nut":7.4688,"from_previous":1.0722},{"fret":7,"from_nut":8.4808,"from_previous":1.012},{"fret":8,"from_nut":9.436,"from_previous":0.9552},{"fret":9,"from_nut":10.3376,"from_previous":0.9016},{"fret":10,"from_nut":11.1886,"from_previous":0.851},{"fret":11,"from_nut":11.9918,"from_previous":0.8032},{"fret":12,"from_nut":12.75,"from_previous":0.7582},{"fret":13,"from_nut":13.4656,"from_previous":0.7156},{"fret":14,"from_nut":14.141,"from_previous":0.6754},{"fret":15,"from_nut":14.7786,"from_previous":0.6375},{"fret":16,"from_nut":15.3803,"from_previous":0.6017},{"fret":17,"from_nut":15.9483,"from_previous":0.568},{"fret":18,"from_nut":16.4844,"from_previous":0.5361},{"fret":19,"from_nut":16.9904,"from_previous":0.506},{"fret":20,"from_nut":17.468,"from_previous":0.4776},{"fret":21,"from_nut":17.9188,"from_previous":0.4508},{"fret":22,"from_nut":18.3443,"from_previous":0.4255}],"inputs":{"unit":"in","frets":22,"scale_length":25.5},"octave_at_12th":12.75},"meta":{"timestamp":"2026-06-06T07:13:56.944Z","request_id":"c5bca0ca-736a-40bd-9ec2-a33585e302b2"},"status":"ok","message":"Fret positions","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/scalelength":{"get":{"operationId":"get_v1_scalelength","tags":["Fret"],"summary":"Scale length from a fret","description":"","parameters":[{"name":"distance_from_nut","in":"query","required":true,"description":"Measured distance from nut","schema":{"type":"string"},"example":"12.75"},{"name":"fret","in":"query","required":true,"description":"Fret number measured to","schema":{"type":"string"},"example":"12"},{"name":"unit","in":"query","required":false,"description":"in or mm","schema":{"type":"string"},"example":"in"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Scale length = distance ÷ (1 − 1/2^(fret/12)). Measuring to the 12th fret is easiest: the scale length is just twice that distance. Common scales: 25.5\" (Fender), 24.75\" (Gibson), 25.4\" classical, 34\" bass.","inputs":{"fret":12,"unit":"in","distance_from_nut":12.75},"scale_length":25.5},"meta":{"timestamp":"2026-06-06T07:13:57.039Z","request_id":"0e1d56ea-3ef2-40b1-a242-32a2b82d450e"},"status":"ok","message":"Scale length","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Equal temperament: distance to fret n = scale × (1 − 1/2^(n/12)); 12th fret = half the scale. Inches or millimetres. For note names, frequencies or chords use a music-theory API.","service":"fretspacing-api","endpoints":{"GET /v1/fret":"Position of one fret (from the nut and from the previous fret).","GET /v1/meta":"This document.","GET /v1/positions":"All fret positions from the nut for a scale length.","GET /v1/scalelength":"Scale length back-calculated from a measured distance to a fret."},"description":"Fretted-instrument lutherie maths: fret positions from a scale length, a single fret's position, and the scale length from a measured fret."},"meta":{"timestamp":"2026-06-06T07:13:57.146Z","request_id":"3ca00617-70f1-46cc-9e9d-3d59ec960706"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":6580,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":419,"monthly_call_quota":56900,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1172,"monthly_call_quota":234800,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3672,"monthly_call_quota":1349000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/fretspacing-api"}