{"openapi":"3.1.0","info":{"title":"Light Travel Time API","version":"1.0.0","description":"Light-travel-time astronomy maths as an API, computed locally and deterministically. The travel-time endpoint computes how long light takes to cross a distance, t = d/c with c = 299,792,458 m/s exactly, accepting the distance in metres, kilometres, miles, astronomical units, light-years, parsecs or light-seconds/minutes and returning the time in seconds, minutes, hours, days and years — light from the Sun reaches Earth in about 8.3 minutes and the nearest star is about 4.2 light-years away. The distance endpoint inverts the relation, d = c·t, to give how far light travels in a time, returning the distance in metres, kilometres, astronomical units, light-years and parsecs — one light-year is about 9.461×10¹⁵ m. The round-trip endpoint computes the one-way and round-trip communication delay to a target, d/c and 2·d/c, the light-speed latency that makes distant spacecraft control so slow and Mars rovers largely autonomous. Distance units include light-second and light-minute and time units run from seconds to years. Everything is computed locally and deterministically, so it is instant and private. Ideal for astronomy, space-mission, education, science-communication and simulation app developers, communication-delay and cosmic-distance tools, and physics teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is light travel time; for an object's angular size use an angular-size API and for sidereal time a sidereal API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/lighttime-api","description":"oanor gateway"}],"tags":[{"name":"LightTime"},{"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/distance":{"get":{"operationId":"get_v1_distance","tags":["LightTime"],"summary":"Distance from time","description":"","parameters":[{"name":"time","in":"query","required":true,"description":"Time","schema":{"type":"string"},"example":"1"},{"name":"unit","in":"query","required":false,"description":"s, min, h, day, year","schema":{"type":"string"},"example":"year"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Distance light covers d = c·t. One light-year is the distance light travels in a Julian year ≈ 9.461×10¹⁵ m.","inputs":{"time":1,"unit":"year"},"distance":{"au":63241.0770842663,"meters":9460730472580800,"parsecs":0.30660139378555,"kilometers":9460730472580.8,"light_years":1},"time_seconds":31557600},"meta":{"timestamp":"2026-06-05T19:50:33.116Z","request_id":"15d76aae-1f39-4414-8910-936da34c7f9b"},"status":"ok","message":"Distance from time","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/round-trip":{"get":{"operationId":"get_v1_round_trip","tags":["LightTime"],"summary":"Round-trip delay","description":"","parameters":[{"name":"distance","in":"query","required":true,"description":"Distance","schema":{"type":"string"},"example":"150000000"},{"name":"unit","in":"query","required":false,"description":"m, km, mi, au, ly, pc, ls, lm","schema":{"type":"string"},"example":"km"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Communication delay: a signal travels at light speed, so the one-way latency is d/c and a command-and-acknowledge round trip is 2·d/c — the reason Mars rovers are largely autonomous.","inputs":{"unit":"km","distance":150000000},"distance_m":150000000000,"one_way_delay":{"days":0.0057910433,"hours":0.13898504,"years":1.5855013e-5,"minutes":8.33910238,"seconds":500.346143},"round_trip_delay":{"days":0.0115820866,"hours":0.277970079,"years":3.1710025e-5,"minutes":16.67820476,"seconds":1000.692286}},"meta":{"timestamp":"2026-06-05T19:50:33.213Z","request_id":"c8acf156-39d5-4a29-b37f-200e69a8a2e1"},"status":"ok","message":"Round-trip delay","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/travel-time":{"get":{"operationId":"get_v1_travel_time","tags":["LightTime"],"summary":"Light travel time","description":"","parameters":[{"name":"distance","in":"query","required":true,"description":"Distance","schema":{"type":"string"},"example":"1"},{"name":"unit","in":"query","required":false,"description":"m, km, mi, au, ly, pc, ls, lm","schema":{"type":"string"},"example":"au"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Light travel time t = d/c (c = 299,792,458 m/s). Light from the Sun reaches Earth in about 8.3 minutes; the nearest star is ~4.2 light-years away.","inputs":{"unit":"au","distance":1},"distance_m":149597870700,"travel_time":{"days":0.0057755183,"hours":0.13861244,"years":1.5812507e-5,"minutes":8.3167464,"seconds":499.004784}},"meta":{"timestamp":"2026-06-05T19:50:33.316Z","request_id":"9a63faa3-e7c6-466c-8c01-3363af508750"},"status":"ok","message":"Light travel time","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":"Distance units: m, km, mi, au, ly (light-year), pc (parsec), ls (light-second), lm (light-minute). Time units: s, min, h, day, year. c = 299,792,458 m/s exactly.","service":"lighttime-api","constants":{"speed_of_light_ms":299792458},"endpoints":{"GET /v1/meta":"This document.","GET /v1/distance":"Distance light covers in a time (s, min, h, day, year).","GET /v1/round-trip":"One-way and round-trip light/communication delay to a target.","GET /v1/travel-time":"Light travel time from a distance (m, km, mi, au, ly, pc, light-second/minute)."},"description":"Light-travel-time calculator: the time light takes to cross a distance, the distance light covers in a time, and the one-way and round-trip communication delay to a target."},"meta":{"timestamp":"2026-06-05T19:50:33.447Z","request_id":"694f9a85-fc14-43f1-8ca3-852d0cd42eef"},"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":4800,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":400,"monthly_call_quota":47500,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1100,"monthly_call_quota":222000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3700,"monthly_call_quota":1310000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/lighttime-api"}