Aller au contenu
GET /v1/travel-time

Light travel time

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/lighttime-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/lighttime-api/v1/travel-time" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/lighttime-api/v1/travel-time", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/lighttime-api/v1/travel-time");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/lighttime-api/v1/travel-time",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "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
}