Naar de inhoud
GET /v1/parse

Parse an ISO-8601 duration

Probeer het live

10 gratis calls per dag — geen registratie, geen API-key. Loopt via de oanor-gateway.

Aangepaste headers (optioneel)
api.oanor.com/duration-api

Het werkt. Haal een API-key op en gebruik hem in je project.

Verkrijg een API-sleutel

Codefragmenten

curl "https://api.oanor.com/duration-api/v1/parse" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/duration-api/v1/parse", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/duration-api/v1/parse");
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/parse",
    headers={"x-oanor-key": "oanor_test_..."}
)

Voorbeeldrespons

Een echte respons van dit endpoint, vastgelegd bij de laatste health check.

{
    "data": {
        "note": "total_seconds uses calendar averages (1 month = 30.436875 days, 1 year = 365.2425 days)",
        "sign": "+",
        "input": "P3Y6M4DT12H30M5S",
        "humanized": "3 years, 6 months, 4 days, 12 hours, 30 minutes and 5 seconds",
        "components": {
            "days": 4,
            "hours": 12,
            "weeks": 0,
            "years": 3,
            "months": 6,
            "minutes": 30,
            "seconds": 5
        },
        "approximate": true,
        "total_seconds": 110839937,
        "total_milliseconds": 110839937000
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:50.314Z",
        "request_id": "d309e54b-1578-497a-8008-bca2f73538fc"
    },
    "status": "ok",
    "message": "Parse an ISO-8601 duration",
    "success": true
}