{"openapi":"3.1.0","info":{"title":"Slider-Crank Mechanism API","version":"1.0.0","description":"Slider-crank (piston-crank) mechanism kinematics as an API, computed locally and deterministically. The position endpoint takes the crank radius, the connecting-rod length and the crank angle from top dead centre and returns the exact piston displacement from TDC, x = r(1−cosθ) + l(1 − √(1−λ²sin²θ)) with λ = r/l, the piston-pin distance from the crank axis, the connecting-rod swing angle φ = asin(λ·sinθ), the stroke (2r), the rod ratio n = l/r and the fraction of stroke travelled. The velocity endpoint adds the crank speed (as rpm or angular velocity) and returns the exact piston velocity, v = ω·[r·sinθ + r·λ·sinθcosθ/√(1−λ²sin²θ)], and the piston acceleration from the standard two-term approximation a ≈ r·ω²·(cosθ + λ·cos2θ) — the inertia term engine designers use for balancing. The geometry endpoint summarises the whole mechanism: the stroke, the rod ratio, the top- and bottom-dead-centre positions, the maximum connecting-rod angle asin(λ), and — with a speed — the mean piston speed 2·stroke·(rev/s). Everything is computed locally and deterministically, so it is instant and private. Ideal for engine, compressor and pump-mechanism design tools, robotics and linkage simulation, CNC and animation, and mechanical-engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is slider-crank linkage kinematics; for rotational energy use a flywheel API and for shaft torsion use a torsion API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/crankslider-api","description":"oanor gateway"}],"tags":[{"name":"Slider-Crank"},{"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/geometry":{"get":{"operationId":"get_v1_geometry","tags":["Slider-Crank"],"summary":"Mechanism geometry","description":"","parameters":[{"name":"crank_radius","in":"query","required":true,"description":"Crank radius r (m)","schema":{"type":"string"},"example":"0.05"},{"name":"rod_length","in":"query","required":true,"description":"Connecting-rod length l (m)","schema":{"type":"string"},"example":"0.2"},{"name":"rpm","in":"query","required":false,"description":"Crank speed (rpm) for mean speed","schema":{"type":"string"},"example":"3000"},{"name":"angular_velocity","in":"query","required":false,"description":"Or angular velocity (rad/s)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"rpm":3000,"note":"Stroke = 2·crank_radius. Mean piston speed = 2·stroke·(rev/s). Larger rod ratio n = less secondary (obliquity) motion.","inputs":{"rod_length":0.2,"crank_radius":0.05},"stroke":0.1,"rod_ratio_n":4,"angular_velocity":314.159265,"obliquity_lambda":0.25,"max_rod_angle_deg":14.477512,"mean_piston_speed":10,"bdc_distance_from_crank_axis":0.15,"tdc_distance_from_crank_axis":0.25},"meta":{"timestamp":"2026-06-04T10:18:36.071Z","request_id":"0c06a569-0730-4922-9784-1819f8d632bb"},"status":"ok","message":"Mechanism geometry","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/position":{"get":{"operationId":"get_v1_position","tags":["Slider-Crank"],"summary":"Piston position","description":"","parameters":[{"name":"crank_radius","in":"query","required":true,"description":"Crank radius r (m)","schema":{"type":"string"},"example":"0.05"},{"name":"rod_length","in":"query","required":true,"description":"Connecting-rod length l (m)","schema":{"type":"string"},"example":"0.2"},{"name":"angle","in":"query","required":true,"description":"Crank angle from TDC (degrees)","schema":{"type":"string"},"example":"90"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Displacement measured from top dead centre (θ=0). Distance-from-crank-axis is the piston-pin to crank-centre length.","inputs":{"angle_deg":90,"rod_length":0.2,"crank_radius":0.05},"stroke":0.1,"rod_ratio_n":4,"rod_angle_deg":14.477512,"obliquity_lambda":0.25,"fraction_of_stroke":0.563508,"displacement_from_tdc":0.056351,"distance_from_crank_axis":0.193649},"meta":{"timestamp":"2026-06-04T10:18:36.176Z","request_id":"50076448-d2ba-4492-83ba-43c9be36ca9f"},"status":"ok","message":"Piston position","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/velocity":{"get":{"operationId":"get_v1_velocity","tags":["Slider-Crank"],"summary":"Piston velocity & acceleration","description":"","parameters":[{"name":"crank_radius","in":"query","required":true,"description":"Crank radius r (m)","schema":{"type":"string"},"example":"0.05"},{"name":"rod_length","in":"query","required":true,"description":"Connecting-rod length l (m)","schema":{"type":"string"},"example":"0.2"},{"name":"angle","in":"query","required":true,"description":"Crank angle from TDC (degrees)","schema":{"type":"string"},"example":"90"},{"name":"rpm","in":"query","required":false,"description":"Crank speed (rpm)","schema":{"type":"string"},"example":"3000"},{"name":"angular_velocity","in":"query","required":false,"description":"Or angular velocity (rad/s)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"inputs":{"angle_deg":90,"rod_length":0.2,"crank_radius":0.05,"angular_velocity":314.159265},"velocity_note":"Exact velocity v = ω·[r·sinθ + r·λ·sinθcosθ/√(1−λ²sin²θ)]; positive = moving from TDC toward BDC.","piston_velocity":15.707963,"acceleration_note":"Standard 2-term approximation a ≈ r·ω²·(cosθ + λ·cos2θ).","piston_acceleration":-1233.70055},"meta":{"timestamp":"2026-06-04T10:18:36.285Z","request_id":"cb0f28fd-b127-495c-8d01-ac239f0bd678"},"status":"ok","message":"Piston velocity & accel","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":"Lengths in metres, angle in degrees from top dead centre, speed as rpm or angular_velocity (rad/s). Acceleration is the standard two-term approximation.","service":"crankslider-api","formulae":{"stroke":"2·r,  max rod angle = asin(λ)","velocity":"v = ω·[r·sinθ + r·λ·sinθcosθ/√(1−λ²sin²θ)]","acceleration":"a ≈ r·ω²·(cosθ + λ·cos2θ)","displacement":"x = r(1−cosθ) + l(1 − √(1−λ²sin²θ)),  λ = r/l"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/geometry":"Stroke, rod ratio, dead-centre positions, maximum rod angle and mean piston speed.","GET /v1/position":"Piston displacement from TDC, distance from crank axis and connecting-rod angle at a crank angle.","GET /v1/velocity":"Exact piston velocity and approximate acceleration at a crank angle for a given crank speed."},"description":"Slider-crank (piston-crank) mechanism kinematics: piston position, velocity, acceleration and mechanism geometry from crank radius, rod length and angle."},"meta":{"timestamp":"2026-06-04T10:18:36.383Z","request_id":"cdb7b288-c7bc-42dc-a5b7-a68a23824ef1"},"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":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2400,"monthly_call_quota":150000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7400,"monthly_call_quota":750000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/crankslider-api"}