Skip to content
GET /v1/duration

Duration & convexity

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/bond-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

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

Example response

A real response from this endpoint, captured by the latest health check.

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