{"openapi":"3.1.0","info":{"title":"Roof Pitch API","version":"1.0.0","description":"Roofing geometry as an API, computed locally and deterministically. The pitch endpoint converts freely between the three ways trades describe a roof slope — the pitch as rise per 12 of run (the X:12 notation), the angle in degrees and the slope as a percentage — using angle = atan(pitch/12); a 6:12 roof is 26.57° and a 50 % slope, and it also returns the pitch multiplier √(1 + tan²) that scales a flat plan length to the true along-slope length. The rafter endpoint computes the common rafter length from the horizontal run and the pitch, rafter = √(run² + rise²) with rise = run·tan(angle), and adds the along-slope length of an optional horizontal overhang — a 12-unit run at 6:12 needs a 13.42-unit rafter. The area endpoint converts a flat building footprint into the actual sloped roof surface area, footprint / cos(angle), the figure you need to order shingles, membrane or underlay; a 100 m² footprint under a 6:12 roof is about 111.8 m². Lengths are unit-agnostic — use a consistent unit. Everything is computed locally and deterministically, so it is instant and private. Ideal for roofing, construction, contractor-estimating, home-improvement, solar-install and architecture app developers, take-off and material-ordering tools, and trade software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is roofing-specific geometry; for a general grade or gradient use a slope API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/roofpitch-api","description":"oanor gateway"}],"tags":[{"name":"Roof"},{"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/area":{"get":{"operationId":"get_v1_area","tags":["Roof"],"summary":"Sloped roof area","description":"","parameters":[{"name":"footprint_area","in":"query","required":true,"description":"Flat footprint area","schema":{"type":"string"},"example":"100"},{"name":"pitch","in":"query","required":false,"description":"Pitch (X:12)","schema":{"type":"string"},"example":"6"},{"name":"angle","in":"query","required":false,"description":"Or angle (deg)","schema":{"type":"string"}},{"name":"slope_percent","in":"query","required":false,"description":"Or slope (%)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Sloped roof area = footprint / cos(angle). The footprint is the flat plan area covered by the roof; multiply by the pitch multiplier to get the true surface area for materials.","inputs":{"angle_deg":26.565051,"footprint_area":100},"roof_area":111.803399,"pitch_multiplier":1.11803399},"meta":{"timestamp":"2026-06-05T19:50:23.277Z","request_id":"9891adef-94b4-4bda-a30b-1d26f78e7ac6"},"status":"ok","message":"Roof area","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/pitch":{"get":{"operationId":"get_v1_pitch","tags":["Roof"],"summary":"Pitch / angle / slope","description":"","parameters":[{"name":"pitch","in":"query","required":false,"description":"Rise per 12 of run (X:12)","schema":{"type":"string"},"example":"6"},{"name":"angle","in":"query","required":false,"description":"Roof angle (degrees)","schema":{"type":"string"}},{"name":"slope_percent","in":"query","required":false,"description":"Slope (%)","schema":{"type":"string"}},{"name":"rise","in":"query","required":false,"description":"Rise","schema":{"type":"string"}},{"name":"run","in":"query","required":false,"description":"Run","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Roof pitch as the rise per 12 of run (X:12), the angle and the slope %. angle = atan(pitch/12). The pitch multiplier √(1+tan²) scales plan length to along-slope length.","inputs":{"pitch":6},"angle_deg":26.565051,"pitch_label":"6:12","pitch_x_in_12":6,"slope_percent":50,"pitch_multiplier":1.11803399},"meta":{"timestamp":"2026-06-05T19:50:23.388Z","request_id":"347fd5c1-7d80-4413-8a83-42ed1133199c"},"status":"ok","message":"Roof pitch conversion","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/rafter":{"get":{"operationId":"get_v1_rafter","tags":["Roof"],"summary":"Common rafter length","description":"","parameters":[{"name":"run","in":"query","required":true,"description":"Horizontal run","schema":{"type":"string"},"example":"12"},{"name":"pitch","in":"query","required":false,"description":"Pitch (X:12)","schema":{"type":"string"},"example":"6"},{"name":"angle","in":"query","required":false,"description":"Or angle (deg)","schema":{"type":"string"}},{"name":"rise","in":"query","required":false,"description":"Or rise","schema":{"type":"string"}},{"name":"overhang","in":"query","required":false,"description":"Horizontal overhang","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Common rafter = √(run² + rise²), with rise = run·tan(angle). The overhang is measured horizontally and extended along the slope. Use the same length unit for run and overhang.","rise":6,"inputs":{"run":12,"angle_deg":26.565051},"rafter_length":13.416408,"overhang_length":0,"total_rafter_length":13.416408},"meta":{"timestamp":"2026-06-05T19:50:23.499Z","request_id":"69b92462-f159-42d0-96af-ba5c8a5b2e12"},"status":"ok","message":"Rafter 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":"Pitch is the rise per 12 units of run (X:12). Lengths are unit-agnostic — use a consistent unit. Roofing-specific geometry; for a general grade/gradient use a slope API.","service":"roofpitch-api","endpoints":{"GET /v1/area":"Actual sloped roof area from the footprint and pitch.","GET /v1/meta":"This document.","GET /v1/pitch":"Convert between roof pitch (X:12), angle and slope percent.","GET /v1/rafter":"Common rafter length from run and pitch, with overhang."},"description":"Roofing geometry: roof pitch (X:12) ↔ angle ↔ slope, common rafter length, and sloped roof area from the footprint."},"meta":{"timestamp":"2026-06-05T19:50:23.604Z","request_id":"16337190-e830-46ee-9bd9-e714cd76afaa"},"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":5800,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":490,"monthly_call_quota":58000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1300,"monthly_call_quota":255000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4100,"monthly_call_quota":1450000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/roofpitch-api"}