{"openapi":"3.1.0","info":{"title":"Gravitation & Weight API","version":"1.0.0","description":"Newtonian gravitation as an API, computed locally and deterministically. The force endpoint applies Newton's law of universal gravitation, F = G·m1·m2/r² — the attractive force between two masses a distance apart, with G = 6.6743×10⁻¹¹ — and solves for whichever of the two masses, the separation or the force you leave out (the Earth and Moon pull on each other with about 2×10²⁰ newtons). The field endpoint gives the gravitational field strength g = G·M/r² at a distance from a mass, or the surface gravity of a built-in body (the Sun, the planets, the Moon and major moons), as a multiple of Earth gravity, and the weight of a test mass placed there. The weight endpoint tells you what something weighs on another world, W = m·g_body — your weight on the Moon, Mars or Jupiter — from a mass or your Earth weight, with the ratio to Earth. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and astronomy-education tools, space and planetary apps, science museums and games, and engineering. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is gravitational force, field and weight; for orbital speed, period and escape velocity use an orbital-mechanics API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gravitation-api","description":"oanor gateway"}],"tags":[{"name":"Gravitation"},{"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/field":{"get":{"operationId":"get_v1_field","tags":["Gravitation"],"summary":"Gravitational field strength","description":"","parameters":[{"name":"mass","in":"query","required":false,"description":"Central mass M (kg)","schema":{"type":"string"},"example":"5.972e24"},{"name":"distance","in":"query","required":false,"description":"Distance r (m)","schema":{"type":"string"},"example":"6.371e6"},{"name":"body","in":"query","required":false,"description":"Or a body (earth, moon, mars…)","schema":{"type":"string"}},{"name":"test_mass","in":"query","required":false,"description":"Test mass (kg) for its weight","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"formula":"g = G·M/r²; weight W = m·g.","g_force":1.001359,"field_source":"G·M/r²","gravitational_field_ms2":9.81997343},"meta":{"timestamp":"2026-06-04T10:18:41.129Z","request_id":"1ca5770b-de00-4b44-9386-ff0b53986b18"},"status":"ok","message":"Gravitational field strength","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/force":{"get":{"operationId":"get_v1_force","tags":["Gravitation"],"summary":"Newton's law of gravitation","description":"","parameters":[{"name":"mass1","in":"query","required":false,"description":"Mass 1 (kg)","schema":{"type":"string"},"example":"5.972e24"},{"name":"mass2","in":"query","required":false,"description":"Mass 2 (kg)","schema":{"type":"string"},"example":"7.348e22"},{"name":"distance","in":"query","required":false,"description":"Separation r (m)","schema":{"type":"string"},"example":"3.844e8"},{"name":"force","in":"query","required":false,"description":"Or force (N) to solve another","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"formula":"F = G·m1·m2/r²; G = 6.6743×10⁻¹¹ N·m²/kg².","mass1_kg":5.972e+24,"mass2_kg":7.348e+22,"distance_m":384400000,"gravitational_force_n":1.982110729079252e+20,"gravitational_constant":6.6743e-11},"meta":{"timestamp":"2026-06-04T10:18:41.217Z","request_id":"3680871f-7f33-4ec1-9a79-7d9a428c1345"},"status":"ok","message":"Gravitational force","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/weight":{"get":{"operationId":"get_v1_weight","tags":["Gravitation"],"summary":"Weight on a body","description":"","parameters":[{"name":"body","in":"query","required":true,"description":"Body (earth, moon, mars, jupiter…)","schema":{"type":"string"},"example":"mars"},{"name":"mass","in":"query","required":false,"description":"Mass (kg)","schema":{"type":"string"},"example":"70"},{"name":"earth_weight","in":"query","required":false,"description":"Or your weight on Earth (N)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"body":"mars","formula":"W = m·g_body; ratio = g_body/g_earth.","mass_kg":70,"weight_n":259.7,"weight_kgf":26.48203,"ratio_to_earth":0.378315,"weight_on_earth_n":686.4655,"surface_gravity_ms2":3.71},"meta":{"timestamp":"2026-06-04T10:18:41.308Z","request_id":"99494b52-88de-4382-a812-40e4d66e4111"},"status":"ok","message":"Weight on a body","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":"gravitation","note":"Newtonian gravitation (force, field, weight) — computed locally and deterministically, no key, no third-party service.","bodies":["sun","mercury","venus","earth","moon","mars","jupiter","saturn","uranus","neptune","pluto","ceres","europa","titan","io"],"constants":{"gravitational_constant":6.6743e-11},"endpoints":["/v1/force","/v1/field","/v1/weight","/v1/meta"]},"meta":{"timestamp":"2026-06-04T10:18:41.393Z","request_id":"89cf1575-9dec-434e-91e8-e251820f6c9d"},"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":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1535000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gravitation-api"}