{"openapi":"3.1.0","info":{"title":"Engine Displacement API","version":"1.0.0","description":"Internal-combustion engine maths as an API, computed locally and deterministically. The displacement endpoint computes an engine's swept volume from the bore, the stroke and the number of cylinders, V = (π/4)·bore²·stroke per cylinder, in cubic centimetres, litres and cubic inches, and classifies the bore-to-stroke geometry as oversquare, square or undersquare. The compression endpoint relates the compression ratio and the clearance volume, CR = (swept + clearance)/clearance — give the clearance to get the ratio or the ratio to get the clearance — and, with a boost pressure, estimates the effective compression ratio of a forced-induction engine. The power-to-weight endpoint computes the power-to-weight ratio in horsepower per tonne, kilowatts per tonne and watts per kilogram, the weight per horsepower, and, with a displacement, the specific output in horsepower per litre. Bore and stroke are in millimetres, volumes in cc, weight in kilograms and power in horsepower or kilowatts. Everything is computed locally and deterministically, so it is instant and private. Ideal for automotive, motorsport, motorcycle and engine-builder app developers, build-spec and tuning tools, and mechanical education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is engine geometry and tuning; for EPA fuel-economy data use a fuel-economy API and for tyre sizes a tyre-calculator API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/engine-api","description":"oanor gateway"}],"tags":[{"name":"Engine"},{"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/compression":{"get":{"operationId":"get_v1_compression","tags":["Engine"],"summary":"Compression ratio","description":"","parameters":[{"name":"swept_volume","in":"query","required":false,"description":"Swept volume per cylinder (cc)","schema":{"type":"string"}},{"name":"bore","in":"query","required":false,"description":"Or bore (mm)","schema":{"type":"string"},"example":"86"},{"name":"stroke","in":"query","required":false,"description":"Stroke (mm)","schema":{"type":"string"},"example":"86"},{"name":"clearance_volume","in":"query","required":false,"description":"Clearance volume (cc)","schema":{"type":"string"}},{"name":"compression_ratio","in":"query","required":false,"description":"Or compression ratio","schema":{"type":"string"},"example":"10"},{"name":"boost","in":"query","required":false,"description":"Boost pressure (bar) for effective CR","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Compression ratio = (swept + clearance) / clearance. Higher CR raises efficiency but needs higher-octane fuel.","inputs":{"swept_volume_cc":499.5572},"compression_ratio":10,"clearance_volume_cc":55.5064,"compression_ratio_label":"10:1"},"meta":{"timestamp":"2026-06-05T03:09:03.151Z","request_id":"96c33e2c-b5ae-45b7-a092-7466081d1c91"},"status":"ok","message":"Compression ratio","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/displacement":{"get":{"operationId":"get_v1_displacement","tags":["Engine"],"summary":"Engine displacement","description":"","parameters":[{"name":"bore","in":"query","required":true,"description":"Bore (mm)","schema":{"type":"string"},"example":"86"},{"name":"stroke","in":"query","required":true,"description":"Stroke (mm)","schema":{"type":"string"},"example":"86"},{"name":"cylinders","in":"query","required":true,"description":"Number of cylinders","schema":{"type":"string"},"example":"4"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Swept volume V = (π/4)·bore²·stroke per cylinder × number of cylinders. Oversquare (bore > stroke) revs higher.","inputs":{"bore_mm":86,"cylinders":4,"stroke_mm":86},"geometry":"square","displacement_l":1.9982,"displacement_cc":1998.2289,"displacement_ci":121.9394,"per_cylinder_cc":499.5572,"bore_stroke_ratio":1},"meta":{"timestamp":"2026-06-05T03:09:03.222Z","request_id":"35c1807c-614c-4735-96c2-6a4a8d683f3e"},"status":"ok","message":"Displacement","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/power-to-weight":{"get":{"operationId":"get_v1_power_to_weight","tags":["Engine"],"summary":"Power to weight","description":"","parameters":[{"name":"power_hp","in":"query","required":false,"description":"Power (hp)","schema":{"type":"string"},"example":"200"},{"name":"power_kw","in":"query","required":false,"description":"Or power (kW)","schema":{"type":"string"}},{"name":"weight","in":"query","required":true,"description":"Weight (kg)","schema":{"type":"string"},"example":"1400"},{"name":"displacement","in":"query","required":false,"description":"Displacement (L) for specific output","schema":{"type":"string"},"example":"2.0"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Power-to-weight drives acceleration. Specific output (hp per litre) measures how hard an engine is tuned.","inputs":{"power_hp":200,"weight_kg":1400},"w_per_kg":106.5286,"hp_per_kg":0.142857,"hp_per_tonne":142.8571,"kw_per_tonne":106.5286,"displacement_l":2,"specific_output_hp_per_l":100,"weight_to_power_kg_per_hp":7},"meta":{"timestamp":"2026-06-05T03:09:03.297Z","request_id":"209101f6-4737-42e0-a4e1-adcfb730e86e"},"status":"ok","message":"Power to weight","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":"Bore and stroke in mm, volumes in cc, weight in kg, power in hp or kW, displacement in litres. 1 cubic inch = 16.387 cc.","service":"engine-api","formulae":{"compression":"CR = (V_swept + V_clearance)/V_clearance","displacement":"V = (π/4)·bore²·stroke·cylinders","specific_output":"power / displacement (hp per litre)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/compression":"Compression ratio ⇄ clearance volume, with optional boosted effective CR.","GET /v1/displacement":"Engine displacement (cc, L, ci) and bore/stroke geometry.","GET /v1/power-to-weight":"Power-to-weight ratios and specific output (hp per litre)."},"description":"Internal-combustion engine calculator: displacement from bore, stroke and cylinders; compression ratio and clearance volume (with optional boost); and power-to-weight and specific output."},"meta":{"timestamp":"2026-06-05T03:09:03.381Z","request_id":"fa55a5ee-60a7-46f9-8dcf-f21bc08ba774"},"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":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":900,"monthly_call_quota":25000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2400,"monthly_call_quota":150000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7400,"monthly_call_quota":764000,"rps_limit":60,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/engine-api"}