Ir al contenido
GET /v1/between

Duration between two instants

Pruébalo en vivo

10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.

Encabezados personalizados (opcional)
api.oanor.com/duration-api

Funciona. Consigue una clave API y úsala en tu proyecto.

Obtener una clave API

Fragmentos de código

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_..."}
)

Respuesta de ejemplo

Una respuesta real de este endpoint, capturada en la última comprobación de estado.

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