{"openapi":"3.1.0","info":{"title":"Plant Spacing API","version":"1.0.0","description":"Plant-spacing and planting-density maths as an API, computed locally and deterministically. The grid endpoint works out how many plants fill an area in a square (rectangular) layout: from a spacing (one value, or separate row and in-row spacings) and either an area or a length and width, it returns the planting density per square metre, square foot, 1,000 ft², acre and hectare, an area-based plant estimate, and — when you give length and width — an exact edge-inclusive grid count with the number of rows and plants per row. The triangular endpoint does the same for an offset (hexagonal) layout, where rows sit spacing × √3/2 apart and fit about 15.47 % more plants than a square grid at the same spacing, and it reports the gain. The density endpoint converts a spacing into a planting density in several units, or works in reverse: give a number of plants and an area and it recommends the spacing that fills it. Lengths accept millimetres, centimetres, metres, inches or feet; area accepts m², ft², acres or hectares. Everything is computed locally and deterministically, so it is instant and private. Ideal for gardening and landscaping apps, agriculture and horticulture tools, nursery and farm planners, and reforestation calculators. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is planting layout and density; for fertilizer application rates use a fertilizer API and for mulch, soil and gravel quantities use a landscaping API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/plantspacing-api","description":"oanor gateway"}],"tags":[{"name":"Spacing"},{"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/density":{"get":{"operationId":"get_v1_density","tags":["Spacing"],"summary":"Spacing <-> density (and reverse)","description":"","parameters":[{"name":"spacing","in":"query","required":false,"description":"Spacing (forward)","schema":{"type":"string"},"example":"0.3"},{"name":"row_spacing","in":"query","required":false,"description":"Row spacing","schema":{"type":"string"}},{"name":"plant_spacing","in":"query","required":false,"description":"Plant spacing","schema":{"type":"string"}},{"name":"layout","in":"query","required":false,"description":"square|triangular","schema":{"type":"string"},"example":"square"},{"name":"plants","in":"query","required":false,"description":"Plants (reverse mode)","schema":{"type":"string"}},{"name":"area","in":"query","required":false,"description":"Area (reverse mode)","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"mm|cm|m|in|ft","schema":{"type":"string"},"example":"m"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"forward","note":"Planting density from spacing. For triangular, density uses the plant spacing equally in all directions.","unit":"m","layout":"square","density":{"per_m2":11.1111,"per_ft2":1.03226,"per_acre":44965.1,"per_hectare":111111.1,"per_1000_sqft":1032.26},"row_spacing_m":0.3,"plant_spacing_m":0.3},"meta":{"timestamp":"2026-06-04T01:59:09.644Z","request_id":"ffe81629-e1d9-432b-b72d-3bf206c640a6"},"status":"ok","message":"Spacing <-> density, and reverse","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/grid":{"get":{"operationId":"get_v1_grid","tags":["Spacing"],"summary":"Square-grid plant count & density","description":"","parameters":[{"name":"spacing","in":"query","required":false,"description":"Equal spacing (or row+plant)","schema":{"type":"string"},"example":"0.5"},{"name":"row_spacing","in":"query","required":false,"description":"Between-row spacing","schema":{"type":"string"}},{"name":"plant_spacing","in":"query","required":false,"description":"In-row spacing","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"mm|cm|m|in|ft (default m)","schema":{"type":"string"},"example":"m"},{"name":"area","in":"query","required":false,"description":"Area (or length+width)","schema":{"type":"string"}},{"name":"area_unit","in":"query","required":false,"description":"m2|ft2|acre|ha","schema":{"type":"string"},"example":"m2"},{"name":"length","in":"query","required":false,"description":"Bed length","schema":{"type":"string"},"example":"10"},{"name":"width","in":"query","required":false,"description":"Bed width","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"grid":{"rows":11,"total_plants":231,"plants_per_row":21},"note":"estimated_plants = area × density (no edges). grid.total_plants counts whole plants that fit with edge rows included.","unit":"m","layout":"square","area_m2":50,"density":{"per_m2":4,"per_ft2":0.37161,"per_acre":16187.4,"per_hectare":40000,"per_1000_sqft":371.61},"row_spacing_m":0.5,"plant_spacing_m":0.5,"estimated_plants":200},"meta":{"timestamp":"2026-06-04T01:59:09.736Z","request_id":"1655fa99-aa08-4707-8cf8-183488774a9c"},"status":"ok","message":"Square-grid plant count & density","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/triangular":{"get":{"operationId":"get_v1_triangular","tags":["Spacing"],"summary":"Triangular (offset) layout","description":"","parameters":[{"name":"spacing","in":"query","required":true,"description":"Equal spacing","schema":{"type":"string"},"example":"0.5"},{"name":"unit","in":"query","required":false,"description":"mm|cm|m|in|ft","schema":{"type":"string"},"example":"m"},{"name":"area","in":"query","required":false,"description":"Area (or length+width)","schema":{"type":"string"},"example":"100"},{"name":"area_unit","in":"query","required":false,"description":"m2|ft2|acre|ha","schema":{"type":"string"},"example":"m2"},{"name":"length","in":"query","required":false,"description":"Bed length","schema":{"type":"string"}},{"name":"width","in":"query","required":false,"description":"Bed width","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Triangular (offset) rows are spacing × √3/2 apart, fitting ~15.47% more plants than a square grid at the same spacing.","unit":"m","layout":"triangular","area_m2":100,"density":{"per_m2":4.6188,"per_ft2":0.4291,"per_acre":18691.6,"per_hectare":46188,"per_1000_sqft":429.1},"spacing_m":0.5,"row_spacing_m":0.433,"vs_square_grid":{"extra_percent":15.47,"square_per_m2":4},"estimated_plants":462},"meta":{"timestamp":"2026-06-04T01:59:09.840Z","request_id":"ede8f7ca-f86f-4fe6-8e16-12c6f1545523"},"status":"ok","message":"Triangular (offset) layout","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":{"api":"plantspacing","note":"Plant-spacing & density maths — computed locally and deterministically, no key, no third-party service.","constants":{"m2_per_acre":4046.8564224,"m2_per_hectare":10000},"endpoints":["/v1/grid","/v1/triangular","/v1/density","/v1/meta"],"length_units":["mm","cm","m","in","inch","ft","feet"]},"meta":{"timestamp":"2026-06-04T01:59:09.932Z","request_id":"54cdde9d-4560-4c9b-acce-09dc4d921f9a"},"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":13435,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1495,"monthly_call_quota":23050,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3485,"monthly_call_quota":280500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7285,"monthly_call_quota":1445000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/plantspacing-api"}