{"openapi":"3.1.0","info":{"title":"Tank Volume API","version":"1.0.0","description":"Tank-gauging geometry as an API, computed locally and deterministically. The horizontal-cylinder endpoint computes the liquid volume in a partially-filled horizontal cylindrical tank from the fill height, the radius (or diameter) and the length, V = L·[r²·acos((r−h)/r) − (r−h)·√(2rh−h²)] — the non-linear relationship that makes a horizontal tank read so unintuitively, e.g. a tank filled to a quarter of its diameter holds only about 20 % of its capacity, while half height is exactly half full. The vertical-cylinder endpoint gives the straightforward V = π·r²·h for an upright tank. The sphere endpoint computes the volume in a spherical tank filled to a height h as the spherical cap V = π·h²·(3r−h)/3, exactly half the sphere at h = r. Every response returns the liquid volume in cubic metres and litres, the full capacity, and the fill percentage. All lengths are in metres. Everything is computed locally and deterministically, so it is instant and private. Ideal for industrial, fuel-station, agriculture, water-utility, chemical-storage and process app developers, tank-gauging, dipstick-to-volume and inventory tools, and IoT level sensors. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is tank volume by geometry; for flow rate through a pipe use a flow-rate API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/tankvolume-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/horizontal-cylinder":{"get":{"operationId":"get_v1_horizontal_cylinder","tags":["Tank"],"summary":"Horizontal cylinder volume","description":"","parameters":[{"name":"radius","in":"query","required":false,"description":"Radius (m)","schema":{"type":"string"},"example":"1"},{"name":"diameter","in":"query","required":false,"description":"Diameter (m)","schema":{"type":"string"}},{"name":"length","in":"query","required":true,"description":"Cylinder length (m)","schema":{"type":"string"},"example":"2"},{"name":"fill_height","in":"query","required":true,"description":"Liquid fill height (m)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Partially-filled horizontal cylinder: V = L·[r²·acos((r−h)/r) − (r−h)·√(2rh−h²)]. At half full (h=r) the volume is exactly half the cylinder.","inputs":{"length":2,"radius":1,"fill_height":1},"fill_percent":50,"full_volume_m3":6.28318531,"liquid_volume_m3":3.14159265,"full_volume_liters":6283.1853,"liquid_volume_liters":3141.5927},"meta":{"timestamp":"2026-06-05T19:50:27.405Z","request_id":"ae64c09a-4a29-4113-9064-4993eb381ce0"},"status":"ok","message":"Horizontal cylinder volume","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/sphere":{"get":{"operationId":"get_v1_sphere","tags":["Tank"],"summary":"Spherical tank volume","description":"","parameters":[{"name":"radius","in":"query","required":false,"description":"Radius (m)","schema":{"type":"string"},"example":"1"},{"name":"diameter","in":"query","required":false,"description":"Diameter (m)","schema":{"type":"string"}},{"name":"fill_height","in":"query","required":true,"description":"Liquid fill height (m)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Spherical tank filled to height h: V = π·h²·(3r−h)/3 (spherical cap). At h=r it is exactly half the sphere.","inputs":{"radius":1,"fill_height":1},"fill_percent":50,"full_volume_m3":4.1887902,"liquid_volume_m3":2.0943951,"full_volume_liters":4188.7902,"liquid_volume_liters":2094.3951},"meta":{"timestamp":"2026-06-05T19:50:27.514Z","request_id":"5fc6eb22-4756-4a10-8353-62bb9c9e507c"},"status":"ok","message":"Spherical tank volume","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/vertical-cylinder":{"get":{"operationId":"get_v1_vertical_cylinder","tags":["Tank"],"summary":"Vertical cylinder volume","description":"","parameters":[{"name":"radius","in":"query","required":false,"description":"Radius (m)","schema":{"type":"string"},"example":"1"},{"name":"diameter","in":"query","required":false,"description":"Diameter (m)","schema":{"type":"string"}},{"name":"height","in":"query","required":true,"description":"Total tank height (m)","schema":{"type":"string"},"example":"3"},{"name":"fill_height","in":"query","required":true,"description":"Liquid fill height (m)","schema":{"type":"string"},"example":"2"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Vertical cylinder: V = π·r²·h. Liquid scales linearly with fill height.","inputs":{"height":3,"radius":1,"fill_height":2},"fill_percent":66.666667,"full_volume_m3":9.42477796,"liquid_volume_m3":6.28318531,"full_volume_liters":9424.778,"liquid_volume_liters":6283.1853},"meta":{"timestamp":"2026-06-05T19:50:27.615Z","request_id":"03a44868-ea1a-4a17-8787-96adb41b0171"},"status":"ok","message":"Vertical cylinder volume","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":"All lengths in metres, volume in m³ and litres. Pass radius or diameter. This is tank gauging by geometry; for flow rate use a flow-rate API.","service":"tankvolume-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/sphere":"Liquid volume in a spherical tank at a fill height (spherical cap).","GET /v1/vertical-cylinder":"Liquid volume in a vertical cylindrical tank at a fill height.","GET /v1/horizontal-cylinder":"Liquid volume in a horizontal cylindrical tank at a fill height."},"description":"Liquid volume in partially-filled tanks: horizontal cylinder, vertical cylinder and spherical tank."},"meta":{"timestamp":"2026-06-05T19:50:27.727Z","request_id":"128cb1d4-266c-48a8-9b0e-dbef48cc5694"},"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":5500,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":480,"monthly_call_quota":54000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1380,"monthly_call_quota":245000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4300,"monthly_call_quota":1400000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/tankvolume-api"}