{"openapi":"3.1.0","info":{"title":"Fence Calculator API","version":"1.0.0","description":"Fencing material estimating as an API, computed locally and deterministically. The posts endpoint works out the number of fence sections, line posts and rails for a run from its length and the post spacing, plus the total rail length. The pickets endpoint computes how many pickets or boards a length needs from the picket width and the gap between boards (set the gap to zero for a privacy fence). The materials endpoint produces a full bill of materials in one call — posts, rails, pickets and the concrete for the post holes, in cubic feet and metres and in 80 lb pre-mix bags — from the fence dimensions and the hole size and post depth. Everything is computed locally and deterministically, so it is instant and private. These are estimates: allow extra for waste, gates and corner posts, and follow your local building code for post depth and footing size. Picket width and gap are in inches; length can be feet, yards or metres. Ideal for fencing contractors and estimators, DIY and home-improvement tools, and landscaping and quoting software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is fencing materials; for paint, tile and concrete use a construction-calculator API and for mulch and gravel use a landscaping API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/fence-api","description":"oanor gateway"}],"tags":[{"name":"Fence"},{"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/materials":{"get":{"operationId":"get_v1_materials","tags":["Fence"],"summary":"Full material bill + concrete","description":"","parameters":[{"name":"length","in":"query","required":true,"description":"Fence length","schema":{"type":"string"},"example":"100"},{"name":"post_spacing","in":"query","required":false,"description":"ft (default 8)","schema":{"type":"string"},"example":"8"},{"name":"rails_per_section","in":"query","required":false,"description":"default 2","schema":{"type":"string"},"example":"2"},{"name":"picket_width","in":"query","required":false,"description":"in (default 5.5)","schema":{"type":"string"},"example":"5.5"},{"name":"gap","in":"query","required":false,"description":"in (default 0.5)","schema":{"type":"string"},"example":"0.5"},{"name":"hole_diameter_in","in":"query","required":false,"description":"default 8","schema":{"type":"string"},"example":"8"},{"name":"post_depth_in","in":"query","required":false,"description":"default 24","schema":{"type":"string"},"example":"24"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Full bill of materials. Concrete assumes a cylindrical hole minus the post; 80 lb pre-mix bag ≈ 0.6 ft³. Add waste, gates and corner posts.","input":{"gap_in":0.5,"length_ft":100,"picket_width_in":5.5,"post_spacing_ft":8,"rails_per_section":2},"posts":14,"rails":26,"pickets":200,"concrete":{"bags":13,"total_m3":0.2093,"total_ft3":7.392,"per_post_ft3":0.528},"sections":13,"rail_total_length_ft":208},"meta":{"timestamp":"2026-06-04T01:59:17.765Z","request_id":"fdbcb722-2521-40c1-89f1-3859a882835b"},"status":"ok","message":"Full material bill","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/pickets":{"get":{"operationId":"get_v1_pickets","tags":["Fence"],"summary":"Pickets / boards needed","description":"","parameters":[{"name":"length","in":"query","required":true,"description":"Fence length","schema":{"type":"string"},"example":"100"},{"name":"length_unit","in":"query","required":false,"description":"ft|yd|m","schema":{"type":"string"},"example":"ft"},{"name":"picket_width","in":"query","required":false,"description":"Picket width (in, default 5.5)","schema":{"type":"string"},"example":"5.5"},{"name":"gap","in":"query","required":false,"description":"Gap between boards (in, default 0.5)","schema":{"type":"string"},"example":"0.5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Pickets = ceil(length ÷ (picket width + gap)). For privacy fences set the gap to 0.","input":{"gap_in":0.5,"length_ft":100,"picket_width_in":5.5},"pickets":200,"pitch_in":6,"coverage_ft":100},"meta":{"timestamp":"2026-06-04T01:59:17.864Z","request_id":"d2ddf443-fb20-49a6-8fb4-c40919e9f199"},"status":"ok","message":"Pickets / boards","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/posts":{"get":{"operationId":"get_v1_posts","tags":["Fence"],"summary":"Posts, sections & rails","description":"","parameters":[{"name":"length","in":"query","required":true,"description":"Fence length","schema":{"type":"string"},"example":"100"},{"name":"length_unit","in":"query","required":false,"description":"ft|yd|m (default ft)","schema":{"type":"string"},"example":"ft"},{"name":"post_spacing","in":"query","required":false,"description":"Post spacing ft (default 8)","schema":{"type":"string"},"example":"8"},{"name":"rails_per_section","in":"query","required":false,"description":"default 2","schema":{"type":"string"},"example":"2"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Line posts = sections + 1 (a post at each section boundary plus the ends). Add posts for gates and corners.","input":{"length_ft":100,"post_spacing_ft":8,"rails_per_section":2},"posts":14,"rails":26,"sections":13,"rail_total_length_ft":208},"meta":{"timestamp":"2026-06-04T01:59:17.940Z","request_id":"8543d3e6-7c20-4c98-9377-e6b667f32681"},"status":"ok","message":"Posts & sections","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":"Estimates only — allow extra for waste, gates and corners; follow local code for post depth.","service":"fence","endpoints":{"/v1/posts":"Posts, sections and rails for a fence run from length and post spacing.","/v1/pickets":"Number of pickets/boards for a length from picket width and gap.","/v1/materials":"Full bill: posts, rails, pickets and concrete (ft³/m³ and bags)."},"description":"Fencing material maths: posts and sections, pickets/boards, and a full material bill with concrete for the post holes."},"meta":{"timestamp":"2026-06-04T01:59:18.040Z","request_id":"7d88b82c-a1af-4f7c-ac89-a5f058be56fd"},"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":11335,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1285,"monthly_call_quota":20950,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3275,"monthly_call_quota":259500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7075,"monthly_call_quota":1340000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/fence-api"}