{"openapi":"3.1.0","info":{"title":"Staircase Calculator API","version":"1.0.0","description":"Staircase geometry as an API, computed locally and deterministically. The calc endpoint takes the total rise (floor-to-floor height) and works out the number of steps, the exact riser height, the tread depth, the total run, the stringer (hypotenuse) length and the stair angle, and checks the result against building-code limits and the Blondel comfort rule (2 × riser + tread ≈ 24–25 in). The check endpoint validates a given riser and tread against typical US IRC limits — maximum riser 7.75 in, minimum tread 10 in — and reports the angle and comfort. The stringer endpoint returns the stringer length and angle from a total rise and total run. Dimensions are handled internally in inches but accept inches, centimetres, millimetres and metres. Everything is computed locally and deterministically, so it is instant and private. Code limits are typical US IRC values — always confirm your local building code. Ideal for construction and carpentry tools, deck and home-improvement apps, and architecture and CAD software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is staircase geometry; for paint, tile and concrete quantities use a construction-calculator API and for roof pitch use a roofing API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/stair-api","description":"oanor gateway"}],"tags":[{"name":"Stairs"},{"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/calc":{"get":{"operationId":"get_v1_calc","tags":["Stairs"],"summary":"Steps, riser, tread, stringer, angle","description":"","parameters":[{"name":"total_rise","in":"query","required":true,"description":"Floor-to-floor rise","schema":{"type":"string"},"example":"108"},{"name":"unit","in":"query","required":false,"description":"in|cm|mm|m (default in)","schema":{"type":"string"},"example":"in"},{"name":"target_riser","in":"query","required":false,"description":"Preferred riser (default 7)","schema":{"type":"string"},"example":"7"},{"name":"tread","in":"query","required":false,"description":"Tread depth (default 10)","schema":{"type":"string"},"example":"10"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Steps = round(total rise ÷ target riser); actual riser = total rise ÷ steps. There is one fewer tread than risers. Blondel 2R+T should be 24–25 in.","input":{"unit":"in","tread_in":10,"total_rise_in":108,"target_riser_in":7},"steps":15,"issues":[],"risers":15,"treads":14,"total_run":{"cm":355.6,"mm":3556,"feet":11.6667,"inches":140},"tread_depth":{"cm":25.4,"mm":254,"feet":0.8333,"inches":10},"riser_height":{"cm":18.29,"mm":182.9,"feet":0.6,"inches":7.2},"angle_degrees":35.75,"code_compliant":true,"stringer_length":{"cm":449.11,"mm":4491.1,"feet":14.7347,"inches":176.816},"blondel_2r_plus_t":24.4,"comfortable_blondel":true},"meta":{"timestamp":"2026-06-04T01:59:15.879Z","request_id":"5b73c77d-69dc-455c-b857-a460606ddf91"},"status":"ok","message":"Staircase calculation","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/check":{"get":{"operationId":"get_v1_check","tags":["Stairs"],"summary":"Code compliance of a riser/tread","description":"","parameters":[{"name":"riser","in":"query","required":true,"description":"Riser height","schema":{"type":"string"},"example":"7"},{"name":"tread","in":"query","required":true,"description":"Tread depth","schema":{"type":"string"},"example":"11"},{"name":"unit","in":"query","required":false,"description":"in|cm|mm|m","schema":{"type":"string"},"example":"in"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Checks a riser/tread against typical US IRC limits and the Blondel comfort rule (2·riser + tread).","input":{"unit":"in","riser_in":7,"tread_in":11},"issues":[],"limits":{"max_riser_in":7.75,"min_tread_in":10,"blondel_range":[24,25]},"angle_degrees":32.47,"code_compliant":true,"blondel_2r_plus_t":25,"comfortable_blondel":true},"meta":{"timestamp":"2026-06-04T01:59:15.973Z","request_id":"51690354-fc84-4f6a-967a-03143bd09338"},"status":"ok","message":"Code compliance check","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/stringer":{"get":{"operationId":"get_v1_stringer","tags":["Stairs"],"summary":"Stringer length from rise & run","description":"","parameters":[{"name":"total_rise","in":"query","required":true,"description":"Total rise","schema":{"type":"string"},"example":"108"},{"name":"total_run","in":"query","required":true,"description":"Total run","schema":{"type":"string"},"example":"140"},{"name":"unit","in":"query","required":false,"description":"in|cm|mm|m","schema":{"type":"string"},"example":"in"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Stringer length = √(total rise² + total run²) (the hypotenuse of the staircase).","input":{"unit":"in","total_run_in":140,"total_rise_in":108},"angle_degrees":37.65,"stringer_length":{"cm":449.11,"mm":4491.1,"feet":14.7347,"inches":176.816}},"meta":{"timestamp":"2026-06-04T01:59:16.056Z","request_id":"b08f1f4b-641e-40a1-a9d1-e07277021ea8"},"status":"ok","message":"Stringer 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":{"note":"Internally inches (accepts in/cm/mm/m). Limits are typical US IRC values — confirm your local code.","limits":{"max_riser_in":7.75,"min_tread_in":10,"blondel_range":[24,25]},"service":"stair","endpoints":{"/v1/calc":"Number of steps, riser, tread, total run, stringer length, angle and code check from a total rise.","/v1/check":"Validate a riser/tread against IRC limits and the Blondel comfort rule.","/v1/stringer":"Stringer (hypotenuse) length and angle from total rise and total run."},"description":"Staircase maths: steps/riser/tread from a total rise, code compliance check, and stringer length."},"meta":{"timestamp":"2026-06-04T01:59:16.154Z","request_id":"eae2985d-a27f-401c-a8ea-c5b7322c207c"},"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":11835,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1335,"monthly_call_quota":21450,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3325,"monthly_call_quota":264500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7125,"monthly_call_quota":1365000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/stair-api"}