Catalog/space-light-travel

Space

Light travel time & distance units API

Converts an astronomical distance between m/km/AU/light-years/parsecs and returns the light travel time in s/min/hours/years. Answers 'How long does light take to cross this distance?', 'Convert light-years to parsecs.'.

Price$0.04per request
MethodPOST
Route/v1/space/light-travel
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
spaceastronomylight-travel-timeparseclight-yearastronomical-unitdistance-conversionspeed-of-light
API URLhttps://x402.hexl.dev/v1/space/light-travel
Integration docs
Example request
{
  "distanceLy": 4.2465
}
Example response
{
  "distanceM": 40174991951814370,
  "distanceKm": 40174991951814.37,
  "distanceAU": 268553.233838337,
  "distanceLy": 4.2465,
  "distancePc": 1.30198281871,
  "lightTravelTimeS": 134009348.4,
  "lightTravelTimeMin": 2233489.14,
  "lightTravelTimeHours": 37224.819,
  "lightTravelTimeYears": 4.2465,
  "interpretation": "Light covers this distance in 4.247 yr."
}
Input schema
{
  "type": "object",
  "properties": {
    "distanceM": {
      "type": "number"
    },
    "distanceKm": {
      "type": "number"
    },
    "distanceAU": {
      "type": "number"
    },
    "distanceLy": {
      "type": "number",
      "examples": [
        4.2465
      ]
    },
    "distancePc": {
      "type": "number"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}