Aller au contenu
GET /v1/between

Duration between two instants

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/duration-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/duration-api/v1/between" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/duration-api/v1/between", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/duration-api/v1/between");
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/duration-api/v1/between",
    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": {
        "end": "2026-01-02T03:04:05.000Z",
        "start": "2026-01-01T00:00:00.000Z",
        "iso8601": "P1DT3H4M5S",
        "direction": "end after start",
        "humanized": "1 day, 3 hours, 4 minutes and 5 seconds",
        "components": {
            "days": 1,
            "hours": 3,
            "weeks": 0,
            "years": 0,
            "months": 0,
            "minutes": 4,
            "seconds": 5
        },
        "total_seconds": 97445,
        "total_milliseconds": 97445000
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:50.004Z",
        "request_id": "d61a2d5d-14cb-4610-813d-ff77c7b9d490"
    },
    "status": "ok",
    "message": "Duration between two instants",
    "success": true
}