Mortgage calculations, as an API

This site runs on a calculation engine published as a package. The website imports it, the REST API imports it, and the MCP server imports it — so a figure from any one of them matches the others by construction rather than by convention. No key, no account, no rate card.

What is available

11 operations, 11 of them read-only and safe to cache. Engine version 0.1.0.

Why the numbers agree

Most calculator sites that ship an API maintain the arithmetic twice. This one cannot.

The engine is a separate package with no dependency on a browser, a server runtime or a clock. It does not read Date, Intl or the filesystem — those are not merely discouraged, they do not typecheck. Given the same inputs it returns the same output on any runtime, which is what makes it safe to share between a prerenderer, a serverless function and an MCP tool.

Formatting, the current month and the visitor's locale belong to the caller. That is why an amortization schedule from the API contains month offsets rather than dates: the engine does not know what today is, and a calculation that depends on when it ran is not reproducible.

Three surfaces, one answer
# The same calculation, three ways.

# 1. REST
curl -s https://www.usmortgagecalc.com/api/v1/mortgage \
  -H 'content-type: application/json' \
  -d '{"homePrice":400000,"downPaymentPercent":20,"annualInterestRatePercent":6.5,
       "loanTermYears":30,"state":"Texas"}'

# 2. MCP (any compatible client)
#    https://www.usmortgagecalc.com/mcp

# 3. The website
#    https://www.usmortgagecalc.com/texas-mortgage-calculator

The data

Published, sourced and versioned rather than embedded.

The property tax dataset covers all 50 states with an average effective rate, median home value, assessment rules, exemptions and appeal procedure for each. It is available as JSON over the API and rendered as a table on the property tax page.

Every rate, fee and threshold the engine applies — FHA MIP, VA funding fees, USDA guarantee fees, conforming loan limits, DTI ceilings — carries a source, a source URL and the year it applies to. Nothing is a magic number, and anything that changes annually is labelled as such so you know what to re-verify.

Terms

Short, because there is not much to say.

  • No authentication. No key, no signup, no token. Requests are anonymous and nothing about them is stored.
  • Free to use, including commercially. Attribution is appreciated and not required.
  • Estimates, not advice. Figures come from published averages and programme rules. They are not a loan offer, a rate quote or a substitute for a lender's Loan Estimate. See the terms.

Open source on GitHub

The specifications, SDKs and documentation are public. Read them, fork them, or open an issue when something here is wrong — corrections to the docs are the most useful thing you can send.

chetanmane/usmortgagecalc-api — SDKs and examples under MIT, documentation and specifications under CC BY 4.0.