/v1/duration
Duration & convexity
Pruébalo en vivo
10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.
Funciona. Consigue una clave API y úsala en tu proyecto.
Obtener una clave APIFragmentos de código
curl "https://api.oanor.com/bond-api/v1/duration" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/bond-api/v1/duration", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/bond-api/v1/duration");
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/bond-api/v1/duration",
headers={"x-oanor-key": "oanor_test_..."}
)
Respuesta de ejemplo
Una respuesta real de este endpoint, capturada en la última comprobación de estado.
{
"data": {
"dv01": 0.709486,
"note": "Macaulay duration is the cash-flow-weighted average time; modified = Macaulay/(1+y) and approximates % price change per 1 % yield move. DV01 is the price change per 1 bp.",
"price": 925.612626,
"inputs": {
"ytm_pct": 6,
"frequency": 2,
"face_value": 1000,
"maturity_years": 10,
"coupon_rate_pct": 5
},
"convexity": 71.785398,
"macaulay_duration_years": 7.894997,
"modified_duration_years": 7.665046
},
"meta": {
"timestamp": "2026-06-05T03:09:00.249Z",
"request_id": "1adf4cf0-cece-4671-ab22-d9149843837a"
},
"status": "ok",
"message": "Duration & convexity",
"success": true
}