{"openapi":"3.1.0","info":{"title":"Tank Volume API","version":"1.0.0","description":"Tank volume and fill-level maths as an API, computed locally and deterministically. The volume endpoint gives the total capacity — in litres, US gallons and cubic metres — of a vertical cylinder, horizontal cylinder, rectangular tank, sphere or capsule, from its dimensions in metres, centimetres, millimetres, feet or inches. The fill endpoint computes the volume of liquid and the percent full at a given fill depth, using the exact geometry for each shape — including the circular-segment formula for a horizontal cylinder (where the level is famously non-linear) and the spherical-cap formula for a sphere. The level endpoint is the inverse \"dipstick\" calculation: it finds the depth that corresponds to a target volume or a target percentage, solving the segment geometry by bisection. Everything is computed locally and deterministically, so it is instant and private. Ideal for fuel, water, oil and chemical tank monitoring, agriculture and irrigation, process and industrial tooling, and tank-gauging and dipstick apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is tank-gauging geometry; for swimming-pool volume and chemical dosing use a pool API, and for plain unit conversion use a unit-conversion API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/tank-api","description":"oanor gateway"}],"tags":[{"name":"Tank"},{"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/fill":{"get":{"operationId":"get_v1_fill","tags":["Tank"],"summary":"Volume & % full at a depth","description":"","parameters":[{"name":"shape","in":"query","required":true,"description":"Tank shape","schema":{"type":"string"},"example":"horizontal-cylinder"},{"name":"diameter","in":"query","required":false,"description":"Diameter (or radius)","schema":{"type":"string"},"example":"2"},{"name":"length","in":"query","required":false,"description":"Length","schema":{"type":"string"},"example":"5"},{"name":"depth","in":"query","required":true,"description":"Fill depth","schema":{"type":"string"},"example":"1"},{"name":"unit","in":"query","required":false,"description":"m|cm|mm|ft|in","schema":{"type":"string"},"example":"m"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Filled volume at the given depth. Horizontal cylinders and spheres use the exact circular-segment / spherical-cap formulas.","input":{"unit":"m","depth":1,"shape":"horizontalcylinder","length":5,"radius":1},"filled":{"m3":7.85398,"litres":7853.98,"us_gallons":2074.8},"capacity":{"m3":15.70796,"litres":15707.96,"us_gallons":4149.6},"remaining":{"m3":7.85398,"litres":7853.98,"us_gallons":2074.8},"percent_full":50},"meta":{"timestamp":"2026-06-03T17:41:57.364Z","request_id":"306a4a6f-72c9-451b-ae1c-bc0d9fa1e9be"},"status":"ok","message":"Filled volume at depth","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/level":{"get":{"operationId":"get_v1_level","tags":["Tank"],"summary":"Dipstick depth for a target","description":"","parameters":[{"name":"shape","in":"query","required":true,"description":"Tank shape","schema":{"type":"string"},"example":"horizontal-cylinder"},{"name":"diameter","in":"query","required":false,"description":"Diameter (or radius)","schema":{"type":"string"},"example":"2"},{"name":"length","in":"query","required":false,"description":"Length","schema":{"type":"string"},"example":"5"},{"name":"percent","in":"query","required":false,"description":"Target % full","schema":{"type":"string"},"example":"75"},{"name":"litres","in":"query","required":false,"description":"Or target litres","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"m|cm|mm|ft|in","schema":{"type":"string"},"example":"m"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Dipstick depth for the target fill, found by bisection (exact for the linear shapes).","depth":1.404,"input":{"unit":"m","shape":"horizontalcylinder","length":5,"radius":1},"target":{"m3":11.78097,"litres":11780.97,"us_gallons":3112.2},"depth_m":1.40397,"depth_unit":"m","percent_full":75},"meta":{"timestamp":"2026-06-03T17:41:57.470Z","request_id":"3eef9a21-bdeb-42e5-b6ba-33525c8f24ab"},"status":"ok","message":"Dipstick depth for target","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/volume":{"get":{"operationId":"get_v1_volume","tags":["Tank"],"summary":"Total tank capacity","description":"","parameters":[{"name":"shape","in":"query","required":true,"description":"vertical-cylinder|horizontal-cylinder|rectangle|sphere|capsule","schema":{"type":"string"},"example":"horizontal-cylinder"},{"name":"diameter","in":"query","required":false,"description":"Diameter (or radius)","schema":{"type":"string"},"example":"2"},{"name":"radius","in":"query","required":false,"description":"Radius","schema":{"type":"string"}},{"name":"length","in":"query","required":false,"description":"Length (h-cyl/capsule/rect)","schema":{"type":"string"},"example":"5"},{"name":"width","in":"query","required":false,"description":"Width (rect)","schema":{"type":"string"}},{"name":"height","in":"query","required":false,"description":"Height (v-cyl/rect)","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"m|cm|mm|ft|in (default m)","schema":{"type":"string"},"example":"m"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Total tank capacity. Use /v1/fill for the volume at a given depth.","input":{"unit":"m","shape":"horizontalcylinder","length":5,"radius":1},"capacity":{"m3":15.70796,"litres":15707.96,"us_gallons":4149.6},"max_depth_m":2},"meta":{"timestamp":"2026-06-03T17:41:57.573Z","request_id":"311544b8-4b7d-42e7-8af1-058b3c43bacd"},"status":"ok","message":"Tank capacity","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":"Dimensions in your chosen unit (m default). Volumes returned in m³, litres and US gallons.","units":["m","cm","mm","ft","in"],"shapes":["vertical-cylinder","horizontal-cylinder","rectangle","sphere","capsule"],"service":"tank","endpoints":{"/v1/fill":"Filled volume and percent full at a given depth (exact circular-segment / spherical-cap maths).","/v1/level":"Inverse dipstick: the depth that gives a target volume or percent.","/v1/volume":"Total capacity (litres/US gallons/m³) for vertical/horizontal cylinder, rectangle, sphere or capsule."},"description":"Tank volume and fill-level maths: capacity by shape, volume at a depth, and the dipstick depth for a target fill."},"meta":{"timestamp":"2026-06-03T17:41:57.653Z","request_id":"8dd722c9-e276-4f49-8157-b7368e0bc9cb"},"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":9835,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1135,"monthly_call_quota":19450,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3125,"monthly_call_quota":244500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6925,"monthly_call_quota":1265000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/tank-api"}