{"openapi":"3.1.0","info":{"title":"Star Magnitude & Distance API","version":"1.0.0","description":"Stellar magnitude and distance maths as an API, computed locally and deterministically. The magnitude endpoint works the distance modulus, m − M = 5·log₁₀(d/pc) − 5 — give any two of the apparent magnitude m, the absolute magnitude M and the distance and it returns the third, with the distance in parsecs, light-years and astronomical units (the absolute magnitude is the apparent magnitude a star would have at 10 parsecs). The flux endpoint applies Pogson's relation to turn a magnitude difference into a brightness ratio, F₁/F₂ = 10^(0.4·(m₂ − m₁)), where five magnitudes is exactly a hundredfold change in brightness — from two magnitudes, a magnitude difference or a ratio. The parallax endpoint converts a parallax angle into a distance, d(pc) = 1 ÷ p(arcseconds), and back, the geometric method behind the parsec itself. Everything is computed locally and deterministically, so it is instant and private. Ideal for astronomy-education, planetarium, stargazing and science app developers, observing and astrophysics tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is stellar magnitude and distance; for orbital mechanics use an orbital API and for great-circle distances on Earth a geo-distance API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/starmagnitude-api","description":"oanor gateway"}],"tags":[{"name":"Astronomy"},{"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/flux":{"get":{"operationId":"get_v1_flux","tags":["Astronomy"],"summary":"Brightness ratio","description":"","parameters":[{"name":"magnitude1","in":"query","required":false,"description":"Magnitude of object 1","schema":{"type":"string"},"example":"1"},{"name":"magnitude2","in":"query","required":false,"description":"Magnitude of object 2","schema":{"type":"string"},"example":"6"},{"name":"delta_mag","in":"query","required":false,"description":"Or a magnitude difference","schema":{"type":"string"}},{"name":"ratio","in":"query","required":false,"description":"Or a brightness ratio","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Pogson: a difference of 5 magnitudes is exactly a 100× brightness ratio. F₁/F₂ = 10^(0.4·(m₂−m₁)).","inputs":{"source":"two_magnitudes","magnitude_difference":5},"brightness_ratio":100,"magnitude_difference":5},"meta":{"timestamp":"2026-06-04T18:38:02.891Z","request_id":"c89b0dff-7b86-4b08-9387-a69018f8c3de"},"status":"ok","message":"Brightness 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/magnitude":{"get":{"operationId":"get_v1_magnitude","tags":["Astronomy"],"summary":"Distance modulus","description":"","parameters":[{"name":"apparent","in":"query","required":false,"description":"Apparent magnitude m","schema":{"type":"string"},"example":"10"},{"name":"absolute","in":"query","required":false,"description":"Absolute magnitude M","schema":{"type":"string"},"example":"5"},{"name":"distance","in":"query","required":false,"description":"Distance (parsecs)","schema":{"type":"string"}},{"name":"distance_ly","in":"query","required":false,"description":"Or distance (light-years)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Distance modulus: m − M = 5·log₁₀(d/pc) − 5. Absolute magnitude is the apparent magnitude at 10 pc.","inputs":{"solved_for":"distance"},"distance_au":20626480.6,"distance_ly":326.15637769,"distance_pc":100,"distance_modulus":5,"absolute_magnitude":5,"apparent_magnitude":10},"meta":{"timestamp":"2026-06-04T18:38:03.008Z","request_id":"6f92dff5-775d-434a-93ee-d0e2dcd91ae0"},"status":"ok","message":"Distance modulus","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/parallax":{"get":{"operationId":"get_v1_parallax","tags":["Astronomy"],"summary":"Parallax distance","description":"","parameters":[{"name":"parallax","in":"query","required":false,"description":"Parallax (arcseconds)","schema":{"type":"string"},"example":"0.7687"},{"name":"parallax_mas","in":"query","required":false,"description":"Or parallax (milliarcseconds)","schema":{"type":"string"}},{"name":"distance","in":"query","required":false,"description":"Or distance (pc) for the parallax","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Distance (pc) = 1 / parallax (arcseconds). 1 parsec is the distance at which 1 AU subtends 1 arcsecond.","inputs":{"parallax_mas":768.7,"parallax_arcsec":0.7687},"distance_au":268329.395,"distance_ly":4.242960553,"distance_pc":1.300897619},"meta":{"timestamp":"2026-06-04T18:38:03.115Z","request_id":"d515db9a-c1f4-4e4b-baac-648268361fbf"},"status":"ok","message":"Parallax distance","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":"Magnitudes are dimensionless (smaller = brighter); distance in parsecs (also reported in light-years and AU). 1 pc = 3.26156 ly = 206264.8 AU.","service":"starmagnitude-api","formulae":{"parallax":"d(pc) = 1 / p(arcsec)","brightness_ratio":"F₁/F₂ = 10^(0.4·(m₂−m₁))","distance_modulus":"m − M = 5·log₁₀(d/pc) − 5"},"endpoints":{"GET /v1/flux":"Brightness ratio from a magnitude difference (or the difference from a ratio).","GET /v1/meta":"This document.","GET /v1/parallax":"Distance from a parallax angle, or the parallax for a distance.","GET /v1/magnitude":"Distance modulus — any two of apparent m, absolute M and distance give the third."},"description":"Stellar magnitude and distance calculator: the distance modulus relating apparent magnitude, absolute magnitude and distance; the brightness ratio between two magnitudes (Pogson); and the distance from a parallax angle."},"meta":{"timestamp":"2026-06-04T18:38:03.215Z","request_id":"ec62c3c0-0478-4816-9d6a-b5d9f4635be4"},"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":250500,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1608000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/starmagnitude-api"}