{"openapi":"3.1.0","info":{"title":"Bond Pricing API","version":"1.0.0","description":"Fixed-income bond maths as an API, computed locally and deterministically. The price endpoint computes a bond's price from its face value, coupon rate, yield to maturity, years to maturity and coupon frequency — Price = Σ coupon/(1+y)ᵗ + face/(1+y)ⁿ with y the periodic yield — and reports the clean price as a percent of par, the annual coupon, the current yield and whether the bond trades at a premium, discount or par. The yield endpoint inverts this, solving for the yield to maturity that matches a given market price by bisection, with the current yield. The duration endpoint computes the Macaulay duration (the cash-flow-weighted average time), the modified duration (which approximates the percent price change per 1 % yield move), the convexity and the DV01 (the price change per basis point). A zero-coupon bond is just coupon rate 0. Everything is computed locally and deterministically, so it is instant and private. Ideal for fintech, fixed-income, treasury and portfolio app developers, bond-analytics and risk tools, and finance education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is bond analytics; for option pricing use an options API and for NPV and IRR an NPV API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/bond-api","description":"oanor gateway"}],"tags":[{"name":"Bond"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/duration":{"get":{"operationId":"get_v1_duration","tags":["Bond"],"summary":"Duration & convexity","description":"","parameters":[{"name":"face_value","in":"query","required":false,"description":"Face value","schema":{"type":"string"},"example":"1000"},{"name":"coupon_rate","in":"query","required":true,"description":"Annual coupon rate (%)","schema":{"type":"string"},"example":"5"},{"name":"maturity","in":"query","required":true,"description":"Years to maturity","schema":{"type":"string"},"example":"10"},{"name":"frequency","in":"query","required":false,"description":"Coupons per year","schema":{"type":"string"},"example":"2"},{"name":"ytm","in":"query","required":true,"description":"Yield to maturity (%)","schema":{"type":"string"},"example":"6"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"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}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/price":{"get":{"operationId":"get_v1_price","tags":["Bond"],"summary":"Bond price","description":"","parameters":[{"name":"face_value","in":"query","required":false,"description":"Face value","schema":{"type":"string"},"example":"1000"},{"name":"coupon_rate","in":"query","required":true,"description":"Annual coupon rate (%)","schema":{"type":"string"},"example":"5"},{"name":"maturity","in":"query","required":true,"description":"Years to maturity","schema":{"type":"string"},"example":"10"},{"name":"frequency","in":"query","required":false,"description":"Coupons per year","schema":{"type":"string"},"example":"2"},{"name":"ytm","in":"query","required":true,"description":"Yield to maturity (%)","schema":{"type":"string"},"example":"6"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Price = Σ coupon/(1+y)ᵗ + face/(1+y)ⁿ with y the periodic yield. Above par = premium (coupon > YTM).","price":925.612626,"inputs":{"ytm_pct":6,"frequency":2,"face_value":1000,"maturity_years":10,"coupon_rate_pct":5},"annual_coupon":50,"current_yield_pct":5.401828,"premium_or_discount":"discount","clean_price_percent_of_par":92.561263},"meta":{"timestamp":"2026-06-05T03:09:00.322Z","request_id":"0c1269aa-6f02-4007-b0da-9713d70a605b"},"status":"ok","message":"Bond price","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/yield":{"get":{"operationId":"get_v1_yield","tags":["Bond"],"summary":"Yield to maturity","description":"","parameters":[{"name":"face_value","in":"query","required":false,"description":"Face value","schema":{"type":"string"},"example":"1000"},{"name":"coupon_rate","in":"query","required":true,"description":"Annual coupon rate (%)","schema":{"type":"string"},"example":"5"},{"name":"maturity","in":"query","required":true,"description":"Years to maturity","schema":{"type":"string"},"example":"10"},{"name":"frequency","in":"query","required":false,"description":"Coupons per year","schema":{"type":"string"},"example":"2"},{"name":"price","in":"query","required":true,"description":"Market price","schema":{"type":"string"},"example":"925.61"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"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}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Face value defaults to 1000; coupon_rate and ytm are annual percents; maturity in years; frequency is coupons per year (default 2). Zero-coupon = coupon_rate 0.","service":"bond-api","formulae":{"price":"Σ c/(1+y)ᵗ + F/(1+y)ⁿ","convexity":"Σ t(t+1)·CF/(1+y)^(t+2) / price","modified_duration":"Macaulay / (1 + y)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/price":"Bond price, clean price, current yield and premium/discount from the YTM.","GET /v1/yield":"Yield to maturity and current yield from a market price.","GET /v1/duration":"Macaulay and modified duration, convexity and DV01."},"description":"Bond analytics: price from yield, yield to maturity from price, and Macaulay/modified duration with convexity."},"meta":{"timestamp":"2026-06-05T03:09:00.502Z","request_id":"6482e1ac-3a62-482f-8436-cc9bc8f62886"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1500,"monthly_call_quota":40000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3900,"monthly_call_quota":250000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":11900,"monthly_call_quota":1500000,"rps_limit":60,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/bond-api"}