Mortgage calculator
The listing page's mortgage calculator, from MortgageCalculator and GET /v1/mortgage/estimate, with loan type, term, price, down payment and rate controls, a line-by-line monthly payment, est. badges and the required disclosures.
Under the property details, the listing page shows what the home could cost each month: principal
and interest, property taxes, home insurance, mortgage insurance and HOA dues, in a ring chart and a
list, at today's market rates. The visitor can change the loan type, the term, the price, the down
payment and the rate, and the figures follow. Every figure comes from
GET /v1/mortgage/estimate: the browser asks your
own listings route, which adds your secret key on your server, and shows the answer. The page carries
no key. ListingDetail shows the calculator when you pass apiBaseUrl="/api/idx".
Your listings route is one file, from the SDK:
// app/api/idx/[...path]/route.ts
import { createListingsRoute } from "@ruuster/idx/route";
export const GET = createListingsRoute({ basePath: "/api/idx" });
On a site builder with no server of its own, the calculator asks https://idx.ruuster.com/v1 with no
key instead, from an approved website address: No key in your
pages explains both ways.
What the visitor sees
<!--
The mortgage calculator with the first answer for the listing (its own tax and HOA figures, an estimated insurance line).
From the React component MortgageCalculator with initialEstimate. Generated by npm run idx:recipes-static from @ruuster/idx-recipes. Do not edit it by hand.
Fill each value from:
section.rw-mortgage[data-rw-base-url]: your own route made with @ruuster/idx/route, for example /api/idx (it adds your secret key on your server). On a site with no server, leave it out: the browser calls https://idx.ruuster.com/v1 with no key, from your approved website address
section.rw-mortgage[data-rw-mortgage-query]: the starting query as JSON: price (listing.price), downPaymentPercent 20, loanType and termYears null, state (listing.address.state), zip (the first five digits of listing.address.postalCode), hoaMonthly (associationFee with associationFeeFrequency from listing.details, as a monthly figure), propertyTaxAnnual (taxAnnualAmount), insuranceAnnual null
section.rw-mortgage[data-country]: data.country of the answer, else US (CA for a Canadian province in state)
select[data-rw-mortgage-field=loanType] and [term] options: data.options.loanTypes and data.options.terms (value and label); the selected ones are data.inputs.loanType and the term value ("30", or "30-arm" for an ARM)
inputs [data-rw-mortgage-field=price, downPayment, rate]: the price, the down payment percent (20) and data.rate.annualPercent; the range's min is the lower of 50,000 and the price, its max the higher of 2,500,000 and three times the price, in steps of 5,000
[data-rw-mortgage-out=downHint]: "{data.inputs.downPayment as $96,000} down"
[data-rw-mortgage-out=rateHint]: "Market rate on {data.rate.asOf as July 24, 2026}"
More options inputs: your own figures when the listing has them (propertyTaxAnnual, hoaMonthly), else empty; each placeholder is the answer's own figure (monthly.propertyTax times 12, monthly.homeInsurance times 12, monthly.hoa), in whole dollars with commas
circle[data-rw-mortgage-seg]: one arc per line in this order: principalAndInterest, propertyTax, homeInsurance, mortgageInsurance, hoa. On a circle of radius 54 (circumference 339.292), each arc's length is line divided by total times the circumference, stroke-dasharray is "{length} {circumference minus length}" and stroke-dashoffset minus the sum of the arcs before it, all with three decimals; a line at 0 has length 0
[data-rw-mortgage-out=total, principalAndInterest, propertyTax, homeInsurance, mortgageInsurance, hoa]: data.monthly, in whole dollars ($3,329)
[data-rw-mortgage-est]: the est. badge of propertyTax, homeInsurance and hoa: hidden unless data.monthly.provenance of that line is estimated
[data-rw-mortgage-out=note]: data.mortgageInsuranceNote; hidden when it is null
[data-rw-mortgage-out=reasons]: data.ineligibleReasons, one li each; hidden when data.eligible is true
[data-rw-mortgage-out=stale]: shown when data.stale is true
[data-rw-mortgage-out=disclosures] p: data.requiredDisclosures, one paragraph each, word for word
id, for, aria-labelledby, name: any values that are unique on the page
Every data-rw-* attribute is a hook for ruuster-idx.js; see ../HOOKS.md.
-->
<section class="rw-recipes rw-mortgage" aria-labelledby="mortgage-calculator-1-title" data-rw-mortgage="" data-rw-base-url="/api/idx" data-rw-mortgage-query="{"price":480000,"downPaymentPercent":20,"loanType":null,"termYears":null,"state":"GA","zip":"30127","hoaMonthly":125,"propertyTaxAnnual":5400,"insuranceAnnual":null}" data-country="US">
<h2 class="rw-mortgage__title" id="mortgage-calculator-1-title">Estimate your monthly payment</h2>
<div class="rw-mortgage__selects">
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-loan">Loan type</label>
<select class="rw-select" id="mortgage-calculator-1-loan" data-rw-mortgage-field="loanType">
<option value="conventional" selected="">Conventional</option>
<option value="fha">FHA</option>
<option value="va">VA</option>
<option value="usda">USDA</option>
<option value="jumbo">Jumbo</option>
</select>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-term">Term</label>
<select class="rw-select" id="mortgage-calculator-1-term" data-rw-mortgage-field="term">
<option value="30" selected="">30 years, fixed</option>
<option value="20">20 years, fixed</option>
<option value="15">15 years, fixed</option>
<option value="30-arm">5/6 ARM</option>
</select>
</div>
</div>
<div class="rw-mortgage__sliders">
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-1-price-label" for="mortgage-calculator-1-price">Home price</label>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-1-price" type="number" inputMode="decimal" min="50000" max="2500000" step="5000" data-rw-mortgage-field="price" value="480000"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-1-price-label" min="50000" max="2500000" step="5000" data-rw-mortgage-field="price" value="480000"/>
</div>
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-1-down-label" for="mortgage-calculator-1-down">Down payment</label>
<fieldset class="rw-mortgage__mode"><legend class="rw-visually-hidden">Down payment</legend><label class="rw-mortgage__mode-option"><input type="radio" name="mortgage-calculator-1-downmode" data-rw-mortgage-field="downMode" value="$"/><span>Dollars</span></label><label class="rw-mortgage__mode-option"><input type="radio" name="mortgage-calculator-1-downmode" data-rw-mortgage-field="downMode" checked="" value="%"/><span>Percent</span></label></fieldset>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-1-down" type="number" inputMode="decimal" min="0" max="100" step="0.5" data-rw-mortgage-field="downPayment" value="20"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-1-down-label" min="0" max="100" step="0.5" data-rw-mortgage-field="downPayment" value="20"/>
<p class="rw-mortgage__hint" data-rw-mortgage-out="downHint">$96,000 down</p>
</div>
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-1-rate-label" for="mortgage-calculator-1-rate">Interest rate</label>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-1-rate" type="number" inputMode="decimal" min="0" max="15" step="0.01" data-rw-mortgage-field="rate" value="6.568"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-1-rate-label" min="0" max="15" step="0.01" data-rw-mortgage-field="rate" value="6.568"/>
<p class="rw-mortgage__hint" data-rw-mortgage-out="rateHint">Market rate on July 24, 2026</p>
</div>
</div>
<details class="rw-mortgage__more">
<summary class="rw-mortgage__more-summary">More options</summary>
<div class="rw-mortgage__more-grid">
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-score">Credit score</label>
<select class="rw-select" id="mortgage-calculator-1-score" data-rw-mortgage-field="creditScore">
<option value="760+" selected="">760+</option>
<option value="740-759">740-759</option>
<option value="720-739">720-739</option>
<option value="700-719">700-719</option>
<option value="680-699">680-699</option>
<option value="660-679">660-679</option>
<option value="640-659">640-659</option>
<option value="620-639">620-639</option>
<option value="<620"><620</option>
</select>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-propertyTaxAnnual">Yearly property tax</label>
<input class="rw-input" id="mortgage-calculator-1-propertyTaxAnnual" type="text" inputMode="decimal" placeholder="5,400" data-rw-mortgage-field="propertyTaxAnnual" value="5400"/>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-insuranceAnnual">Yearly home insurance</label>
<input class="rw-input" id="mortgage-calculator-1-insuranceAnnual" type="text" inputMode="decimal" placeholder="3,715" data-rw-mortgage-field="insuranceAnnual" value=""/>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-1-hoaMonthly">Monthly HOA dues</label>
<input class="rw-input" id="mortgage-calculator-1-hoaMonthly" type="text" inputMode="decimal" placeholder="125" data-rw-mortgage-field="hoaMonthly" value="125"/>
</div>
</div>
</details>
<div class="rw-mortgage__result">
<div class="rw-mortgage__donut" data-rw-mortgage-donut=""><svg viewBox="0 0 140 140" width="160" height="160" aria-hidden="true" focusable="false"><circle class="rw-mortgage__track" cx="70" cy="70" r="54" fill="none" stroke-width="16"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--principalAndInterest" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="249.132 90.160" stroke-dashoffset="0.000" transform="rotate(-90 70 70)" data-rw-mortgage-seg="principalAndInterest"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--propertyTax" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="45.865 293.427" stroke-dashoffset="-249.132" transform="rotate(-90 70 70)" data-rw-mortgage-seg="propertyTax"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--homeInsurance" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="31.555 307.737" stroke-dashoffset="-294.997" transform="rotate(-90 70 70)" data-rw-mortgage-seg="homeInsurance"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--mortgageInsurance" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="0.000 339.292" stroke-dashoffset="-326.552" transform="rotate(-90 70 70)" data-rw-mortgage-seg="mortgageInsurance"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--hoa" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="12.740 326.552" stroke-dashoffset="-326.552" transform="rotate(-90 70 70)" data-rw-mortgage-seg="hoa"></circle></svg><p class="rw-mortgage__center"><span class="rw-mortgage__total" data-rw-mortgage-out="total">$3,329</span><span class="rw-mortgage__per">per month</span></p></div>
<div class="rw-mortgage__lines">
<h3 class="rw-visually-hidden">Monthly payment breakdown</h3>
<ul class="rw-mortgage__list">
<li class="rw-mortgage__row" data-line="principalAndInterest">
<span class="rw-mortgage__dot rw-mortgage__dot--principalAndInterest" aria-hidden="true"></span>
<span class="rw-mortgage__label">Principal and interest</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="principalAndInterest">$2,444</span>
</li>
<li class="rw-mortgage__row" data-line="propertyTax">
<span class="rw-mortgage__dot rw-mortgage__dot--propertyTax" aria-hidden="true"></span>
<span class="rw-mortgage__label">Property taxes</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." hidden="" data-rw-mortgage-est="propertyTax"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="propertyTax">$450</span>
</li>
<li class="rw-mortgage__row" data-line="homeInsurance">
<span class="rw-mortgage__dot rw-mortgage__dot--homeInsurance" aria-hidden="true"></span>
<span class="rw-mortgage__label">Home insurance</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." data-rw-mortgage-est="homeInsurance"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="homeInsurance">$310</span>
</li>
<li class="rw-mortgage__row" data-line="mortgageInsurance">
<span class="rw-mortgage__dot rw-mortgage__dot--mortgageInsurance" aria-hidden="true"></span>
<span class="rw-mortgage__label">Mortgage insurance</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="mortgageInsurance">$0</span>
</li>
<li class="rw-mortgage__row" data-line="hoa">
<span class="rw-mortgage__dot rw-mortgage__dot--hoa" aria-hidden="true"></span>
<span class="rw-mortgage__label">HOA dues</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." hidden="" data-rw-mortgage-est="hoa"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="hoa">$125</span>
</li>
<li class="rw-mortgage__row rw-mortgage__row--total">
<span class="rw-mortgage__label">Total</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="total">$3,329</span>
</li>
</ul>
<p class="rw-mortgage__note" data-rw-mortgage-out="note" hidden=""></p>
</div>
</div>
<div class="rw-mortgage__reasons" data-rw-mortgage-out="reasons" hidden="">
<p class="rw-mortgage__reasons-title">To qualify for this loan type, adjust the scenario:</p>
<ul></ul>
</div>
<p class="rw-mortgage__stale" data-rw-mortgage-out="stale" hidden="">Some rates may be a few days old.</p>
<p class="rw-mortgage__status" role="status" aria-live="polite"><span data-rw-mortgage-out="status"></span> <button type="button" class="rw-mortgage__link" hidden="" data-rw-mortgage-retry="">Try again</button></p>
<div class="rw-mortgage__disclosures" data-rw-mortgage-out="disclosures">
<p>This is an estimate, not a loan offer, quote, pre-qualification or pre-approval. Actual rates and payments depend on underwriting.</p>
<p>Rate source: FRED, Optimal Blue OBMMI.</p>
<p>Rates as of 2026-07-24.</p>
</div>
</section>import { MortgageCalculator } from "@ruuster/idx-recipes";
<MortgageCalculator baseUrl={baseUrl} prefill={prefill} answers={answers} /><!--
The mortgage calculator for a loan type the scenario does not qualify for (USDA with 5 percent down): the reasons and the mortgage insurance note.
From the React component MortgageCalculator with initialEstimate. Generated by npm run idx:recipes-static from @ruuster/idx-recipes. Do not edit it by hand.
Fill each value from:
section.rw-mortgage[data-rw-base-url]: your own route made with @ruuster/idx/route, for example /api/idx (it adds your secret key on your server). On a site with no server, leave it out: the browser calls https://idx.ruuster.com/v1 with no key, from your approved website address
section.rw-mortgage[data-rw-mortgage-query]: the starting query as JSON: price (listing.price), downPaymentPercent 20, loanType and termYears null, state (listing.address.state), zip (the first five digits of listing.address.postalCode), hoaMonthly (associationFee with associationFeeFrequency from listing.details, as a monthly figure), propertyTaxAnnual (taxAnnualAmount), insuranceAnnual null
section.rw-mortgage[data-country]: data.country of the answer, else US (CA for a Canadian province in state)
select[data-rw-mortgage-field=loanType] and [term] options: data.options.loanTypes and data.options.terms (value and label); the selected ones are data.inputs.loanType and the term value ("30", or "30-arm" for an ARM)
inputs [data-rw-mortgage-field=price, downPayment, rate]: the price, the down payment percent (20) and data.rate.annualPercent; the range's min is the lower of 50,000 and the price, its max the higher of 2,500,000 and three times the price, in steps of 5,000
[data-rw-mortgage-out=downHint]: "{data.inputs.downPayment as $96,000} down"
[data-rw-mortgage-out=rateHint]: "Market rate on {data.rate.asOf as July 24, 2026}"
More options inputs: your own figures when the listing has them (propertyTaxAnnual, hoaMonthly), else empty; each placeholder is the answer's own figure (monthly.propertyTax times 12, monthly.homeInsurance times 12, monthly.hoa), in whole dollars with commas
circle[data-rw-mortgage-seg]: one arc per line in this order: principalAndInterest, propertyTax, homeInsurance, mortgageInsurance, hoa. On a circle of radius 54 (circumference 339.292), each arc's length is line divided by total times the circumference, stroke-dasharray is "{length} {circumference minus length}" and stroke-dashoffset minus the sum of the arcs before it, all with three decimals; a line at 0 has length 0
[data-rw-mortgage-out=total, principalAndInterest, propertyTax, homeInsurance, mortgageInsurance, hoa]: data.monthly, in whole dollars ($3,329)
[data-rw-mortgage-est]: the est. badge of propertyTax, homeInsurance and hoa: hidden unless data.monthly.provenance of that line is estimated
[data-rw-mortgage-out=note]: data.mortgageInsuranceNote; hidden when it is null
[data-rw-mortgage-out=reasons]: data.ineligibleReasons, one li each; hidden when data.eligible is true
[data-rw-mortgage-out=stale]: shown when data.stale is true
[data-rw-mortgage-out=disclosures] p: data.requiredDisclosures, one paragraph each, word for word
id, for, aria-labelledby, name: any values that are unique on the page
Every data-rw-* attribute is a hook for ruuster-idx.js; see ../HOOKS.md.
-->
<section class="rw-recipes rw-mortgage" aria-labelledby="mortgage-calculator-ineligible-1-title" data-rw-mortgage="" data-rw-base-url="/api/idx" data-rw-mortgage-query="{"price":480000,"downPaymentPercent":5,"loanType":"usda","termYears":null,"state":"GA","zip":"30127","hoaMonthly":null,"propertyTaxAnnual":null,"insuranceAnnual":null}" data-country="US">
<h2 class="rw-mortgage__title" id="mortgage-calculator-ineligible-1-title">Estimate your monthly payment</h2>
<div class="rw-mortgage__selects">
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-loan">Loan type</label>
<select class="rw-select" id="mortgage-calculator-ineligible-1-loan" data-rw-mortgage-field="loanType">
<option value="conventional">Conventional</option>
<option value="fha">FHA</option>
<option value="va">VA</option>
<option value="usda" selected="">USDA</option>
<option value="jumbo">Jumbo</option>
</select>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-term">Term</label>
<select class="rw-select" id="mortgage-calculator-ineligible-1-term" data-rw-mortgage-field="term">
<option value="30" selected="">30 years, fixed</option>
<option value="20">20 years, fixed</option>
<option value="15">15 years, fixed</option>
<option value="30-arm">5/6 ARM</option>
</select>
</div>
</div>
<div class="rw-mortgage__sliders">
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-ineligible-1-price-label" for="mortgage-calculator-ineligible-1-price">Home price</label>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-ineligible-1-price" type="number" inputMode="decimal" min="50000" max="2500000" step="5000" data-rw-mortgage-field="price" value="480000"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-ineligible-1-price-label" min="50000" max="2500000" step="5000" data-rw-mortgage-field="price" value="480000"/>
</div>
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-ineligible-1-down-label" for="mortgage-calculator-ineligible-1-down">Down payment</label>
<fieldset class="rw-mortgage__mode"><legend class="rw-visually-hidden">Down payment</legend><label class="rw-mortgage__mode-option"><input type="radio" name="mortgage-calculator-ineligible-1-downmode" data-rw-mortgage-field="downMode" value="$"/><span>Dollars</span></label><label class="rw-mortgage__mode-option"><input type="radio" name="mortgage-calculator-ineligible-1-downmode" data-rw-mortgage-field="downMode" checked="" value="%"/><span>Percent</span></label></fieldset>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-ineligible-1-down" type="number" inputMode="decimal" min="0" max="100" step="0.5" data-rw-mortgage-field="downPayment" value="5"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-ineligible-1-down-label" min="0" max="100" step="0.5" data-rw-mortgage-field="downPayment" value="5"/>
<p class="rw-mortgage__hint" data-rw-mortgage-out="downHint">$24,000 down</p>
</div>
<div class="rw-mortgage__slider">
<div class="rw-mortgage__slider-head">
<label class="rw-field__label" id="mortgage-calculator-ineligible-1-rate-label" for="mortgage-calculator-ineligible-1-rate">Interest rate</label>
</div>
<input class="rw-input rw-mortgage__number" id="mortgage-calculator-ineligible-1-rate" type="number" inputMode="decimal" min="0" max="15" step="0.01" data-rw-mortgage-field="rate" value="6.479"/>
<input class="rw-mortgage__range" type="range" aria-labelledby="mortgage-calculator-ineligible-1-rate-label" min="0" max="15" step="0.01" data-rw-mortgage-field="rate" value="6.479"/>
<p class="rw-mortgage__hint" data-rw-mortgage-out="rateHint">Market rate on July 24, 2026</p>
</div>
</div>
<details class="rw-mortgage__more">
<summary class="rw-mortgage__more-summary">More options</summary>
<div class="rw-mortgage__more-grid">
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-score">Credit score</label>
<select class="rw-select" id="mortgage-calculator-ineligible-1-score" data-rw-mortgage-field="creditScore">
<option value="760+" selected="">760+</option>
<option value="740-759">740-759</option>
<option value="720-739">720-739</option>
<option value="700-719">700-719</option>
<option value="680-699">680-699</option>
<option value="660-679">660-679</option>
<option value="640-659">640-659</option>
<option value="620-639">620-639</option>
<option value="<620"><620</option>
</select>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-propertyTaxAnnual">Yearly property tax</label>
<input class="rw-input" id="mortgage-calculator-ineligible-1-propertyTaxAnnual" type="text" inputMode="decimal" placeholder="5,280" data-rw-mortgage-field="propertyTaxAnnual" value=""/>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-insuranceAnnual">Yearly home insurance</label>
<input class="rw-input" id="mortgage-calculator-ineligible-1-insuranceAnnual" type="text" inputMode="decimal" placeholder="3,715" data-rw-mortgage-field="insuranceAnnual" value=""/>
</div>
<div class="rw-field">
<label class="rw-field__label" for="mortgage-calculator-ineligible-1-hoaMonthly">Monthly HOA dues</label>
<input class="rw-input" id="mortgage-calculator-ineligible-1-hoaMonthly" type="text" inputMode="decimal" placeholder="0" data-rw-mortgage-field="hoaMonthly" value=""/>
</div>
</div>
</details>
<div class="rw-mortgage__result">
<div class="rw-mortgage__donut" data-rw-mortgage-donut=""><svg viewBox="0 0 140 140" width="160" height="160" aria-hidden="true" focusable="false"><circle class="rw-mortgage__track" cx="70" cy="70" r="54" fill="none" stroke-width="16"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--principalAndInterest" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="260.178 79.114" stroke-dashoffset="0.000" transform="rotate(-90 70 70)" data-rw-mortgage-seg="principalAndInterest"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--propertyTax" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="39.412 299.880" stroke-dashoffset="-260.178" transform="rotate(-90 70 70)" data-rw-mortgage-seg="propertyTax"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--homeInsurance" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="27.731 311.561" stroke-dashoffset="-299.589" transform="rotate(-90 70 70)" data-rw-mortgage-seg="homeInsurance"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--mortgageInsurance" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="11.971 327.321" stroke-dashoffset="-327.321" transform="rotate(-90 70 70)" data-rw-mortgage-seg="mortgageInsurance"></circle><circle class="rw-mortgage__seg rw-mortgage__seg--hoa" cx="70" cy="70" r="54" fill="none" stroke-width="16" stroke-dasharray="0.000 339.292" stroke-dashoffset="-339.292" transform="rotate(-90 70 70)" data-rw-mortgage-seg="hoa"></circle></svg><p class="rw-mortgage__center"><span class="rw-mortgage__total" data-rw-mortgage-out="total">$3,788</span><span class="rw-mortgage__per">per month</span></p></div>
<div class="rw-mortgage__lines">
<h3 class="rw-visually-hidden">Monthly payment breakdown</h3>
<ul class="rw-mortgage__list">
<li class="rw-mortgage__row" data-line="principalAndInterest">
<span class="rw-mortgage__dot rw-mortgage__dot--principalAndInterest" aria-hidden="true"></span>
<span class="rw-mortgage__label">Principal and interest</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="principalAndInterest">$2,905</span>
</li>
<li class="rw-mortgage__row" data-line="propertyTax">
<span class="rw-mortgage__dot rw-mortgage__dot--propertyTax" aria-hidden="true"></span>
<span class="rw-mortgage__label">Property taxes</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." data-rw-mortgage-est="propertyTax"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="propertyTax">$440</span>
</li>
<li class="rw-mortgage__row" data-line="homeInsurance">
<span class="rw-mortgage__dot rw-mortgage__dot--homeInsurance" aria-hidden="true"></span>
<span class="rw-mortgage__label">Home insurance</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." data-rw-mortgage-est="homeInsurance"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="homeInsurance">$310</span>
</li>
<li class="rw-mortgage__row" data-line="mortgageInsurance">
<span class="rw-mortgage__dot rw-mortgage__dot--mortgageInsurance" aria-hidden="true"></span>
<span class="rw-mortgage__label">Mortgage insurance</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="mortgageInsurance">$134</span>
</li>
<li class="rw-mortgage__row" data-line="hoa">
<span class="rw-mortgage__dot rw-mortgage__dot--hoa" aria-hidden="true"></span>
<span class="rw-mortgage__label">HOA dues</span>
<span class="rw-mortgage__est" title="Estimated. Enter your own figure under More options." hidden="" data-rw-mortgage-est="hoa"><span aria-hidden="true">est.</span><span class="rw-visually-hidden">Estimated. Enter your own figure under More options.</span></span>
<span class="rw-mortgage__value" data-rw-mortgage-out="hoa">$0</span>
</li>
<li class="rw-mortgage__row rw-mortgage__row--total">
<span class="rw-mortgage__label">Total</span>
<span class="rw-mortgage__value" data-rw-mortgage-out="total">$3,788</span>
</li>
</ul>
<p class="rw-mortgage__note" data-rw-mortgage-out="note">Mortgage insurance applies for the life of the loan. An upfront fee of $4,560 is added to the loan amount.</p>
</div>
</div>
<div class="rw-mortgage__reasons" data-rw-mortgage-out="reasons">
<p class="rw-mortgage__reasons-title">To qualify for this loan type, adjust the scenario:</p>
<ul>
<li>USDA loans are for homes in eligible rural areas. A lender can confirm whether this home qualifies.</li>
</ul>
</div>
<p class="rw-mortgage__stale" data-rw-mortgage-out="stale" hidden="">Some rates may be a few days old.</p>
<p class="rw-mortgage__status" role="status" aria-live="polite"><span data-rw-mortgage-out="status"></span> <button type="button" class="rw-mortgage__link" hidden="" data-rw-mortgage-retry="">Try again</button></p>
<div class="rw-mortgage__disclosures" data-rw-mortgage-out="disclosures">
<p>This is an estimate, not a loan offer, quote, pre-qualification or pre-approval. Actual rates and payments depend on underwriting.</p>
<p>Rate source: FRED, Optimal Blue OBMMI.</p>
<p>Rates as of 2026-07-24.</p>
</div>
</section>import { MortgageCalculator } from "@ruuster/idx-recipes";
<MortgageCalculator {...props} />What it shows
- Loan type and term, as two menus. The choices come from the answer's
options: Conventional, FHA, VA, USDA and Jumbo with 30, 20 and 15 years fixed or a 5/6 ARM in the United States, and fixed or variable rates with 1 to 10 year terms in Canada. - Home price, from the listing's price, with a slider from $50,000 to $2,500,000 (or three times the price, for a higher price) in steps of $5,000 and a field for an exact figure.
- Down payment in dollars or percent, 20 percent to start, with the other figure under it, such as "$125,000 down".
- Interest rate, today's market rate to start, with "Market rate on July 24, 2026" under it. A rate the visitor types reads "Your rate" with "Use the market rate" beside it.
- More options: the credit score band (United States), the yearly property tax, the yearly home insurance and the monthly HOA dues (condo fees in Canada). Each field shows the figure the estimate used until the visitor types their own.
- The monthly payment: the ring chart with the total and "per month", then each line and the total. The HOA line is always there, at $0 when the home has no dues. A line the API estimated carries an "est." badge, whose name for screen readers is "Estimated. Enter your own figure under More options."
- When the scenario misses a loan type's rules, "To qualify for this loan type, adjust the scenario:" and the API's sentences, such as the down payment a loan type needs.
- The mortgage insurance note when the loan carries mortgage insurance, and "Some rates may be a
few days old." when the API answers
stale: true. - The disclosures, every line of the answer's
requiredDisclosures, in small text under the estimate.
A change waits 350 milliseconds, then asks the API once; a newer change cancels the request before it. The last estimate stays on screen while the next one loads, and screen readers hear "Updating the estimate." When a request fails, the calculator shows "The estimate could not load. Please try again in a moment." with a "Try again" button.
When the page shows it
ListingDetail shows the calculator under the property details when all of these hold:
- you pass
apiBaseUrl(your listings route, such as/api/idx); - you leave
mortgageunset ortrue(mortgage={false}leaves it off the page); - the listing has a price, and it is neither sold nor a rental or lease.
It starts from mortgagePrefill(listing): the price, the home's state and ZIP code, the HOA dues
from the listing's details turned into a monthly figure (yearly, quarterly and monthly dues), and the
yearly tax when the listing carries it.
What the browser calls
| When | Request | Key | Cached |
|---|---|---|---|
| When the page loads, and after each change | GET /v1/mortgage/estimate, through your listings route |
your secret key, added on your server | 5 minutes at Ruuster's edge for the same scenario |
The estimate costs no daily units. The request for this listing's first estimate:
curl -s -G "https://idx.ruuster.com/v1/mortgage/estimate" \
--data-urlencode price=625000 \
--data-urlencode downPaymentPercent=20 \
--data-urlencode state=GA \
--data-urlencode zip=30308 \
-H "Authorization: Bearer $IDX_SECRET_KEY"import { createClient } from "@ruuster/idx";
const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });
const r = await idx.mortgage({
price: 625000,
downPaymentPercent: 20,
state: "GA",
zip: "30308",
});
if (!r.ok) throw new Error(`${r.error.code}: ${r.error.message}`);
console.log(r.data);import os
import requests
res = requests.get(
"https://idx.ruuster.com/v1/mortgage/estimate",
params={
"price": "625000",
"downPaymentPercent": "20",
"state": "GA",
"zip": "30308",
},
headers={"Authorization": "Bearer " + os.environ["IDX_SECRET_KEY"]},
timeout=30,
)
body = res.json()
if not body["ok"]:
raise RuntimeError(body["error"]["code"] + ": " + body["error"]["message"])
print(body["data"])<?php
$query = http_build_query([
'price' => '625000',
'downPaymentPercent' => '20',
'state' => 'GA',
'zip' => '30308',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/mortgage/estimate' . '?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('IDX_SECRET_KEY')],
CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body['ok']) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);The answer holds options for the menus, inputs as the API used them, rate, loan, monthly
with each line and its provenance (actual or estimated), eligible with
ineligibleReasons, mortgageInsuranceNote, requiredDisclosures and stale. The
reference page lists every parameter and field.
A first answer from your server
The calculator asks for its first estimate in the browser. To have the figures in the HTML from the
start, ask idx.mortgage() on your server and pass the answer as initialEstimate. The calculator
shows it in the first HTML, then refreshes it in the browser and follows every change.
// The mortgage calculator on your own layout, with its first answer rendered on your server: the
// figures are in the HTML from the start, and the browser asks your listings route for a new
// estimate as the visitor moves a slider. Every figure comes from GET /v1/mortgage/estimate.
import type { ListingDetail as ListingDetailData } from "@ruuster/idx";
import { createClient } from "@ruuster/idx";
import { MortgageCalculator, mortgagePrefill } from "@ruuster/idx-recipes";
const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY, baseUrl: process.env.IDX_BASE_URL || undefined });
export async function ListingMortgage({ listing }: { listing: ListingDetailData }) {
const p = mortgagePrefill(listing);
if (!p.price) return null;
const first = await idx.mortgage({ price: p.price, state: p.state || null, zip: p.zip, hoaMonthly: p.hoaMonthly, propertyTaxAnnual: p.propertyTaxAnnual });
return (
<MortgageCalculator
baseUrl="/api/idx"
price={p.price}
state={p.state}
zip={p.zip}
hoaMonthly={p.hoaMonthly}
propertyTaxAnnual={p.propertyTaxAnnual}
initialEstimate={first.ok ? first.data : null}
/>
);
}
idx.mortgage() and toMortgageQueryString() are in the TypeScript SDK.
The calculator builds the same query string as toMortgageQueryString(), so a scenario your server
asked for and the same scenario from the browser are one cached answer.
Props
| Prop | Type | Required | What it does |
|---|---|---|---|
price |
number |
Yes | The listing's price: mortgagePrefill(listing).price |
state |
string | null |
One of the two | The home's state or province code |
zip |
string | null |
One of the two | The home's ZIP code |
hoaMonthly |
number | null |
No | The monthly HOA dues |
propertyTaxAnnual |
number | null |
No | The yearly property tax |
insuranceAnnual |
number | null |
No | The yearly home insurance |
initial |
{ downPaymentPercent?, loanType?, termYears? } |
No | The starting choices. Default 20 percent down and the country's default loan |
baseUrl |
string |
No | Your listings route, such as /api/idx. Default https://idx.ruuster.com/v1, with no key |
debounceMs |
number |
No | The pause after a change before the request. Default 350 |
initialEstimate |
MortgageEstimate | null |
No | A first answer from your server |
publishableKey |
string |
No | Leave out. Kept only for pages built before keyless requests |
On ListingDetail, apiBaseUrl and mortgage control it; the listing fills the rest.
Rules this screen follows
MUST
- Show every line of
requiredDisclosuresunder the estimate. Showing them is a condition of using the rates. - Mark each estimated line, so the visitor knows which figures to replace with their own.
- Show the figures the API answers. The browser never computes a payment itself.
NEVER
- Present the estimate as a loan offer, a quote or an approval.
- Show the calculator on a sold home or a rental.
- Change the wording of the disclosures.
Without React
The static listing page prints the calculator with a first answer from the server, and
ruuster-idx.js asks for a new one as the visitor changes it, through the address in
data-rw-base-url on the calculator: your listings route, or https://idx.ruuster.com/v1 with no key
on a site builder. The hooks
(data-rw-mortgage, data-rw-mortgage-field, data-rw-mortgage-out and the rest) are in
static/HOOKS.md. See Build without React.