/v1/yield
Yield to maturity
Try it live
10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.
It works. Grab an API key and use it in your project.
Get an API keyCode snippets
curl "https://api.oanor.com/bond-api/v1/yield" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/bond-api/v1/yield", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/bond-api/v1/yield");
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/yield",
headers={"x-oanor-key": "oanor_test_..."}
)
Example response
A real response from this endpoint, captured by the latest health check.
{
"data": {
"note": "YTM is the annualised discount rate that makes the present value of the cash flows equal the price (by bisection).",
"inputs": {
"price": 925.61,
"frequency": 2,
"face_value": 1000,
"maturity_years": 10,
"coupon_rate_pct": 5
},
"current_yield_pct": 5.401843,
"yield_to_maturity_pct": 6.000037
},
"meta": {
"timestamp": "2026-06-05T03:09:00.416Z",
"request_id": "f95d1ef4-0352-4034-a78e-8ba7e3b5e7b8"
},
"status": "ok",
"message": "Yield to maturity",
"success": true
}