# Mortgage estimate

Source: https://help.ruuster.com/idx/mortgage-estimate

> Estimate the monthly payment for a home price, with principal and interest, property tax, home insurance, mortgage insurance and HOA dues, at today's market rates.

```http
GET https://idx.ruuster.com/v1/mortgage/estimate
```

publishable or secret key · free · cached 3600 s

A monthly payment estimate for one price, line by line, at today's market rates. The listing page's
`MortgageCalculator` calls it with your publishable key and shows the answer; on other stacks,
`ruuster-idx.js` does the same from the page's markup.

## What to know

- Send `price` and the home's `state` (or its `zip`). Everything else has a default: 20 percent
  down, a 30-year fixed conventional loan in the United States, and a 5-year fixed term on a
  25-year amortization in Canada.
- Send the listing's HOA dues and yearly tax when you have them. Without `hoaMonthly` the HOA
  line is 0. A yearly tax or insurance figure you leave out is estimated, and
  `monthly.provenance` marks that line `estimated` so the page can show an "est." badge.
- The answer's `options` lists the loan types and terms for the home's country. A term value of
  `30-arm` means `termYears=30` with `rateType=arm`.
- A scenario that misses a loan type's rules still answers 200, with `eligible: false` and
  `ineligibleReasons` saying what to change in full sentences.
- Show every line of `requiredDisclosures` under the estimate.
- It costs no daily units. Rates refresh hourly, and when a refresh fails the last rates stay in
  use with `stale: true`, so the page can say the rates may be a few days old.
- From the browser, call it with your publishable key as `?key=`. Answers to a publishable key are
  cached for 5 minutes per scenario, so the same price, down payment and place reuse one answer.

## Where it is used

- [Mortgage calculator](https://help.ruuster.com/idx/recipe-mortgage-calculator): the
  `MortgageCalculator` recipe component and its place on the listing page.
- [The TypeScript SDK](https://help.ruuster.com/idx/guide-sdk): `idx.mortgage(query)` on your server, and
  `toMortgageQueryString(query)` for the same query string the calculator sends.

## Query parameters

| Name | Type | Description |
|---|---|---|
| `price` | number 1000 to 100000000 | The home price in dollars (required). On a listing page, send the listing's price. |
| `downPayment` | number 0 to 100000000 | The down payment in dollars, at most the price. Send this or downPaymentPercent, not both; with neither the estimate uses 20 percent. |
| `downPaymentPercent` | number 0 to 100 | The down payment as a percent of the price (0 to 100). Send this or downPayment, not both. |
| `loanType` | enum | The loan type. In the United States: conventional (the default), fha, va, usda or jumbo. In Canada: fixed (the default), variable or adjustable. The answer's options.loanTypes lists the ones that apply. Values: `conventional`, `fha`, `va`, `usda`, `jumbo`, `fixed`, `variable`, `adjustable`. |
| `termYears` | integer 1 to 30 | The loan term in years. In the United States 30 (the default), 20 or 15. In Canada the contract term, 1 to 10 (default 5). |
| `rateType` | enum, default fixed | United States only: fixed, or arm for a 5/6 adjustable-rate loan (termYears 30). Values: `fixed`, `arm`. |
| `amortizationYears` | integer 15 to 30 | Canada only: the years to pay the loan off (15 to 30, default 25). |
| `creditScore` | enum, default 760+ | United States only: the buyer's credit score range, which sets the rate's credit adjustment. Values: `760+`, `740-759`, `720-739`, `700-719`, `680-699`, `660-679`, `640-659`, `620-639`, `<620`. |
| `rate` | number 0 to 15 | An annual interest rate in percent that replaces today's market rate (for example 6.25). |
| `state` | string | The home's two-letter state code (or Canadian province code, which makes the estimate Canadian). It sets the insurance average. Send state or zip. |
| `zip` | string | The home's five-digit ZIP code. Without state, the estimate reads the state from it. |
| `hoaMonthly` | number 0 to 100000 | Monthly HOA dues (condo fees in Canada) in dollars. Without it the estimate shows 0 for this line. |
| `propertyTaxAnnual` | number 0 to 10000000 | The yearly property tax in dollars. Without it the estimate uses a national average and marks the line as estimated. |
| `insuranceAnnual` | number 0 to 1000000 | The yearly home insurance in dollars. Without it the estimate uses the state's average for the price and marks the line as estimated. |

## Response

The answer is `{ ok: true, data, meta }`. These are the fields of `data`; `meta` carries `brokerageId`, `freshness.asOf`, `mls` (each board's display rules) and `canonical`.

| Field | Type | Description |
|---|---|---|
| `country` | string (enum) | US, or CA when state is a Canadian province. One of `US`, `CA`. |
| `currency` | string (enum) | The currency of every amount. One of `USD`, `CAD`. |
| `inputs` | object | The inputs as the calculator used them, defaults filled in. |
| `inputs.price` | number | The home price. In dollars, two decimals at most. |
| `inputs.downPayment` | number | The down payment. In dollars, two decimals at most. |
| `inputs.downPaymentPercent` | number | The down payment as a percent of the price. |
| `inputs.loanType` | string (enum) | The loan type used. One of `conventional`, `fha`, `va`, `usda`, `jumbo`, `fixed`, `variable`, `adjustable`. |
| `inputs.termYears` | integer | The term in years (in Canada the contract term). |
| `inputs.rateType` | string (enum) | fixed, or arm for a 5/6 adjustable-rate loan (United States). One of `fixed`, `arm`. |
| `inputs.amortizationYears` | integer or null | Canada: the years to pay the loan off; null in the United States. |
| `inputs.creditScore` | string (enum) | The credit score range used (United States). One of `760+`, `740-759`, `720-739`, `700-719`, `680-699`, `660-679`, `640-659`, `620-639`, `<620`. |
| `inputs.state` | string | The state or province code used. |
| `inputs.zip` | string or null | The ZIP code sent, or null. |
| `options` | object | The choices for the loan type and term dropdowns. |
| `options.loanTypes` | array of object | The loan types for this country, in display order. |
| `options.loanTypes[].value` | string | The parameter value to send. |
| `options.loanTypes[].label` | string | The text a dropdown shows. |
| `options.terms` | array of object | The terms for this country, in display order. A US value of the form 30-arm means termYears=30 and rateType=arm. |
| `options.terms[].value` | string | The parameter value to send. |
| `options.terms[].label` | string | The text a dropdown shows. |
| `eligible` | boolean | false when the scenario misses the loan type's rules. Every figure still calculates. |
| `ineligibleReasons` | array of string | What to change, as full sentences; empty when eligible. |
| `rate` | object | The interest rate. |
| `rate.annualPercent` | number | The annual interest rate in percent. |
| `rate.asOf` | string | The day of the market rates (YYYY-MM-DD). |
| `rate.isEstimated` | boolean | true when the rate is derived rather than a published rate for this exact loan. |
| `rate.isOverride` | boolean | true when the request's rate parameter replaced the market rate. |
| `loan` | object | The loan. |
| `loan.amount` | number | The loan amount, including any financed upfront fee. In dollars, two decimals at most. |
| `loan.ltvPercent` | number | The loan amount as a percent of the price. |
| `loan.cashAtClosing` | number | The cash needed at closing, down payment included. In dollars, two decimals at most. |
| `monthly` | object | The monthly payment, line by line. |
| `monthly.principalAndInterest` | number | Principal and interest each month. In dollars, two decimals at most. |
| `monthly.propertyTax` | number | Property tax each month. In dollars, two decimals at most. |
| `monthly.homeInsurance` | number | Home insurance each month. In dollars, two decimals at most. |
| `monthly.mortgageInsurance` | number | Mortgage insurance each month (0 when none). In dollars, two decimals at most. |
| `monthly.hoa` | number | HOA dues (condo fees in Canada) each month, 0 when none. In dollars, two decimals at most. |
| `monthly.total` | number | The whole monthly payment. In dollars, two decimals at most. |
| `monthly.provenance` | object | Which lines were sent and which the calculator estimated. |
| `monthly.provenance.propertyTax` | string (enum) | actual = sent in the request; estimated = an average the calculator used (show an "est." badge). One of `actual`, `estimated`. |
| `monthly.provenance.homeInsurance` | string (enum) | actual = sent in the request; estimated = an average the calculator used (show an "est." badge). One of `actual`, `estimated`. |
| `monthly.provenance.hoa` | string (enum) | actual = sent in the request; estimated = an average the calculator used (show an "est." badge). One of `actual`, `estimated`. |
| `mortgageInsuranceNote` | string or null | A sentence about mortgage insurance (when it ends, or the upfront premium); null when there is none. |
| `requiredDisclosures` | array of string | The calculator's required disclosures. A page that shows the estimate shows these under it. |
| `stale` | boolean | true when some rates are not today's; the page says the rates may be out of date. |

## Errors

These are the error codes this endpoint can answer. Every error has the same body; [Errors](https://help.ruuster.com/idx/reference-errors) explains each code and what to show.

`invalid_parameter`, `secret_key_in_url`, `invalid_credentials`, `missing_credentials`, `payment_required`, `access_revoked`, `brokerage_not_enabled`, `origin_not_allowed`, `origin_required`, `secret_key_in_browser`, `internal_error`, `api_paused`, `source_unavailable`

## Example request

cURL:

```bash
curl -s -G "https://idx.ruuster.com/v1/mortgage/estimate" \
  --data-urlencode price=450000 \
  --data-urlencode downPaymentPercent=20 \
  --data-urlencode state=GA \
  --data-urlencode hoaMonthly=150 \
  --data-urlencode propertyTaxAnnual=5400 \
  -H "Authorization: Bearer $IDX_SECRET_KEY"
```

TypeScript:

```typescript
import { createClient } from "@ruuster/idx";

const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });

const r = await idx.mortgage({
  price: 450000,
  downPaymentPercent: 20,
  state: "GA",
  hoaMonthly: 150,
  propertyTaxAnnual: 5400,
});
if (!r.ok) throw new Error(`${r.error.code}: ${r.error.message}`);
console.log(r.data);
```

Python:

```python
import os

import requests

res = requests.get(
    "https://idx.ruuster.com/v1/mortgage/estimate",
    params={
        "price": "450000",
        "downPaymentPercent": "20",
        "state": "GA",
        "hoaMonthly": "150",
        "propertyTaxAnnual": "5400",
    },
    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:

```php
<?php

$query = http_build_query([
    'price' => '450000',
    'downPaymentPercent' => '20',
    'state' => 'GA',
    'hoaMonthly' => '150',
    'propertyTaxAnnual' => '5400',
], '', '&', 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']);
```

## Example response

```json
{
  "ok": true,
  "data": {
    "country": "US",
    "currency": "USD",
    "inputs": {
      "price": 450000,
      "downPayment": 90000,
      "downPaymentPercent": 20,
      "loanType": "conventional",
      "termYears": 30,
      "rateType": "fixed",
      "amortizationYears": null,
      "creditScore": "760+",
      "state": "GA",
      "zip": null
    },
    "options": {
      "loanTypes": [
        {
          "value": "conventional",
          "label": "Conventional"
        },
        {
          "value": "fha",
          "label": "FHA"
        },
        {
          "value": "va",
          "label": "VA"
        },
        {
          "value": "usda",
          "label": "USDA"
        },
        {
          "value": "jumbo",
          "label": "Jumbo"
        }
      ],
      "terms": [
        {
          "value": "30",
          "label": "30 years, fixed"
        },
        {
          "value": "20",
          "label": "20 years, fixed"
        },
        {
          "value": "15",
          "label": "15 years, fixed"
        },
        {
          "value": "30-arm",
          "label": "5/6 ARM"
        }
      ]
    },
    "eligible": true,
    "ineligibleReasons": [],
    "rate": {
      "annualPercent": 6.568,
      "asOf": "2026-07-24",
      "isEstimated": false,
      "isOverride": false
    },
    "loan": {
      "amount": 360000,
      "ltvPercent": 80,
      "cashAtClosing": 90000
    },
    "monthly": {
      "principalAndInterest": 2291.57,
      "propertyTax": 450,
      "homeInsurance": 290.25,
      "mortgageInsurance": 0,
      "hoa": 150,
      "total": 3181.82,
      "provenance": {
        "propertyTax": "actual",
        "homeInsurance": "estimated",
        "hoa": "actual"
      }
    },
    "mortgageInsuranceNote": null,
    "requiredDisclosures": [
      "This is an estimate, not a loan offer, quote, pre-qualification or pre-approval. Actual rates and payments depend on underwriting.",
      "Rate source: FRED, Optimal Blue OBMMI.",
      "Rates as of 2026-07-24."
    ],
    "stale": false
  },
  "meta": {
    "brokerageId": "bbbbbbbb-0000-4000-8000-000000000001",
    "freshness": {
      "asOf": "2026-10-22T15:00:00.000Z"
    },
    "mls": [],
    "canonical": null,
    "audience": "display"
  }
}
```
