{"openapi":"3.1.0","info":{"title":"Hooke's Law & Spring API","version":"1.0.0","description":"Hooke's law and elastic potential energy as an API, computed locally and deterministically. The hooke endpoint applies F = k·x — the restoring force of a spring equals its spring constant times the extension — and solves for whichever of the force, the spring constant or the displacement you leave out, also returning the elastic potential energy ½·k·x². The energy endpoint computes the elastic potential energy E = ½·k·x² stored in a stretched or compressed spring, solves the extension from a stored energy, and finds the work done in stretching a spring from one extension to another, W = ½·k·(x2² − x1²). The combine endpoint combines springs: in series the assembly is softer, 1/k = Σ 1/kᵢ, and in parallel it is stiffer, k = Σ kᵢ — the spring equivalent of resistors in a circuit. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and mechanics-education tools, spring and suspension design, mechanism and gadget engineering, and simulation software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the force-extension law and elastic energy; for the spring rate of a helical coil from its geometry use a spring-coil API and for spring-mass natural frequency use a vibration API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/hooke-api","description":"oanor gateway"}],"tags":[{"name":"Spring"},{"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/combine":{"get":{"operationId":"get_v1_combine","tags":["Spring"],"summary":"Springs in series/parallel","description":"","parameters":[{"name":"spring_constants","in":"query","required":true,"description":"Spring constants, e.g. 200,300","schema":{"type":"string"},"example":"200,300"},{"name":"arrangement","in":"query","required":false,"description":"series | parallel (default series)","schema":{"type":"string"},"example":"series"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":2,"formula":"series: 1/k = Σ 1/kᵢ (softer than the softest spring).","arrangement":"series","spring_constants_n_m":[200,300],"combined_spring_constant_n_m":120},"meta":{"timestamp":"2026-06-04T10:18:43.577Z","request_id":"53ab19b5-5b81-43bc-aea6-c47299200778"},"status":"ok","message":"Springs in series/parallel","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/energy":{"get":{"operationId":"get_v1_energy","tags":["Spring"],"summary":"Elastic potential energy","description":"","parameters":[{"name":"spring_constant","in":"query","required":true,"description":"Spring constant k (N/m)","schema":{"type":"string"},"example":"200"},{"name":"displacement","in":"query","required":false,"description":"Displacement x (m)","schema":{"type":"string"},"example":"0.05"},{"name":"energy","in":"query","required":false,"description":"Or energy (J) to solve displacement","schema":{"type":"string"}},{"name":"initial_displacement","in":"query","required":false,"description":"Initial x for work done","schema":{"type":"string"}},{"name":"final_displacement","in":"query","required":false,"description":"Final x for work done","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"force_n":10,"formula":"E = ½·k·x².","displacement_m":0.05,"spring_constant_n_m":200,"elastic_potential_energy_j":0.25},"meta":{"timestamp":"2026-06-04T10:18:43.677Z","request_id":"dde23396-623a-4f0f-880f-9aebb3170ea8"},"status":"ok","message":"Elastic potential energy","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/hooke":{"get":{"operationId":"get_v1_hooke","tags":["Spring"],"summary":"Hooke's law F = k·x","description":"","parameters":[{"name":"force","in":"query","required":false,"description":"Force (N)","schema":{"type":"string"}},{"name":"spring_constant","in":"query","required":false,"description":"Spring constant k (N/m)","schema":{"type":"string"},"example":"200"},{"name":"displacement","in":"query","required":false,"description":"Displacement x (m)","schema":{"type":"string"},"example":"0.05"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"force_n":10,"formula":"F = k·x; elastic PE = ½·k·x².","displacement_m":0.05,"spring_constant_n_m":200,"elastic_potential_energy_j":0.25},"meta":{"timestamp":"2026-06-04T10:18:43.787Z","request_id":"9737269e-c107-486a-89dd-df59be54b277"},"status":"ok","message":"Hooke's law F = k·x","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":"hooke","note":"Hooke's law & elastic potential energy — computed locally and deterministically, no key, no third-party service.","endpoints":["/v1/hooke","/v1/energy","/v1/combine","/v1/meta"]},"meta":{"timestamp":"2026-06-04T10:18:43.882Z","request_id":"5073e7ae-e2f1-4cb1-9a91-b807d016565d"},"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":3000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":250000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1509000,"rps_limit":60,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/hooke-api"}