Catalog/space-magnitude-distance

Space

Magnitude & distance modulus API

Solves the distance-modulus relation m-M=5*log10(d/10pc): give any two of apparent magnitude, absolute magnitude, or distance and it returns the third plus the distance modulus. Answers 'Absolute magnitude from apparent magnitude and distance?', 'Distance from the distance modulus?'.

Price$0.04per request
MethodPOST
Route/v1/space/magnitude-distance
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
spaceastronomymagnitudedistance-modulusapparent-magnitudeabsolute-magnitudephotometrystellar
API URLhttps://x402.hexl.dev/v1/space/magnitude-distance
Integration docs
Example request
{
  "apparentMagnitude": 0,
  "distancePc": 100
}
Example response
{
  "apparentMagnitude": 0,
  "absoluteMagnitude": -5,
  "distanceModulus": 5,
  "distancePc": 100,
  "distanceLy": 326.156377717,
  "solvedFor": "absoluteMagnitude",
  "interpretation": "Distance modulus 5 → 100 pc (326.2 ly)."
}
Input schema
{
  "type": "object",
  "properties": {
    "apparentMagnitude": {
      "type": "number",
      "examples": [
        0
      ]
    },
    "absoluteMagnitude": {
      "type": "number"
    },
    "distancePc": {
      "type": "number",
      "examples": [
        100
      ]
    },
    "distanceLy": {
      "type": "number"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}