Skip to main content
Mortgages Lab
Public Beta

Calculator API

Production-grade Canadian mortgage calculators, accessible as a JSON API. Semi-annual compounding per the Bank Act, CMHC tiers, stress test, and more — ready to embed in your platform.

No signup required

Start testing immediately. Anonymous access at 100 requests/hour.

Canadian math only

Semi-annual compounding, CMHC tiers, OSFI stress test. Never US conventions.

Structured JSON

Every response includes inputs, outputs, source attribution, and disclaimer.

Try It Live

Select a calculator, fill in the inputs, and see the API response in real time. No signup needed.

Loading calculators...

Quickstart

1. Discover available calculators

curl
curl https://mortgageslab.ca/api/calculators

2. Run a calculation

curl
curl -X POST https://mortgageslab.ca/api/calculate/cmhc-insurance \
  -H "Content-Type: application/json" \
  -d '{"homePrice": 700000, "downPayment": 50000}'

3. JavaScript / TypeScript example

JavaScript
const res = await fetch("https://mortgageslab.ca/api/calculate/cmhc-insurance", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ homePrice: 700000, downPayment: 50000 }),
});

const data = await res.json();
console.log(data.result);
// { premiumRate: 4, premiumAmount: 26000, totalMortgage: 676000, ... }

4. Python example

Python
import requests

resp = requests.post(
    "https://mortgageslab.ca/api/calculate/cmhc-insurance",
    json={"homePrice": 700000, "downPayment": 50000},
)
data = resp.json()
print(data["result"])
# {'premiumRate': 4, 'premiumAmount': 26000, 'totalMortgage': 676000, ...}
MethodEndpointDescription
GET/api/calculatorsList all calculators with schemas and examples
GET/api/calculate/{id}Get schema and docs for one calculator
POST/api/calculate/{id}Execute a calculation with JSON inputs

Available Calculators

cmhc-insurance

CMHC Insurance

Compare 19% down (insured, lower rate) vs 20% down (uninsured) to see which strategy saves you more over 5 years. Uses Canadian semi-annual compounding.

cost-of-borrowing

Cost of Borrowing

See the true cost of your mortgage: total interest paid, effective annual rate, cost per dollar borrowed, and how a 1% rate change impacts your bottom line. Uses Canadian semi-annual compounding.

ird-penalty

IRD Penalty

Calculate your Interest Rate Differential (IRD) penalty for breaking a fixed mortgage early. Shows the penalty amount, breakeven timeline, and whether switching lenders actually saves you money.

spousal-buyout

Spousal Buyout

Calculate how much you need to borrow to keep the home in a separation — including your ex's equity payout, debt consolidation, CMHC insurance, and stress test qualification.

renewal-shock

Renewal Shock

See exactly how your mortgage renewal rate change affects monthly payments, annual costs, and 5-year impact. Includes an amortization extension relief scenario.

skip-payment

Skip Payment

See the real cost of skipping mortgage payments. Interest keeps compounding while you pause — this calculator shows the added balance, increased payments, and extra months on your mortgage.

Each calculator auto-documents its inputs, outputs, and examples via GET /api/calculate/{id}. New calculators are added regularly.

Rate Limits

TierLimitAuthNotes
Anonymous100 req / hourNoneFor testing and evaluation
Free500 req / dayX-API-KeyFor side projects and prototypes
Pro10,000 req / dayX-API-KeyFor production integrations
EnterpriseCustomX-API-KeySLA, dedicated support, custom limits

Response Headers

Every response includes rate limit information:

X-RateLimit-Limit: 100

X-RateLimit-Remaining: 87

X-RateLimit-Reset: 1715500800

X-API-Tier: anonymous

Response Format

POST /api/calculate/cmhc-insurance — 200 OK
{
  "calculator": "cmhc-insurance",
  "inputs": {
    "homePrice": 700000,
    "downPayment": 50000
  },
  "result": {
    "premiumRate": 4,
    "premiumAmount": 26000,
    "totalMortgage": 676000,
    "ltvRatio": 92.86,
    "isInsuranceRequired": true,
    "monthlyPremiumImpact": 49
  },
  "source": "Mortgages Lab",
  "sourceUrl": "https://mortgageslab.ca/calculators/cmhc-insurance",
  "disclaimer": "CMHC insurance premiums are subject to change...",
  "calculatedAt": "2026-05-12T14:30:00.000Z"
}

API Terms of Use

1. Permitted Use

The Mortgages Lab Calculator API is provided for integration into websites, applications, and platforms that serve Canadian homebuyers, real estate professionals, and financial planners. You may use the API in both personal and commercial projects.

2. Attribution Required

All integrations must display visible attribution: “Powered by Mortgages Lab” near any calculator output shown to end users. The attribution must link to https://mortgageslab.ca.

3. Rate Limits & Fair Use

Requests are rate-limited per tier. Do not attempt to circumvent rate limits through IP rotation, multiple accounts, or other means. Excessive automated scraping of endpoints (as opposed to normal calculator usage) may result in permanent blocking.

4. No Warranty & Disclaimer

The API is provided “as is” without warranties of any kind. Mortgage calculations are estimates based on standard Canadian formulas and may not reflect the exact terms offered by any specific lender. Users must consult a licensed mortgage professional before making financial decisions. Mortgages Lab is not liable for decisions made based on API outputs.

5. Availability

We aim for high availability but do not guarantee uptime or SLA for the free and anonymous tiers. Pro and Enterprise tiers include uptime commitments defined in their respective agreements. We reserve the right to modify endpoints, add or remove calculators, and change rate limits with reasonable notice.

6. Data Privacy

API requests are logged for analytics, rate limiting, and abuse prevention. Logs include IP address, endpoint, timestamp, and API key prefix (if provided). We do not log or store the calculation inputs beyond the current request. No personal financial data is retained.

7. Prohibited Use

You may not use the API to: misrepresent calculations as originating from your own engine without attribution; resell raw API access without adding value; or use outputs in a way that violates Canadian financial services regulations.

Last updated: May 12, 2026. Mortgages Lab reserves the right to update these terms. Continued use of the API constitutes acceptance of the current terms.

Get your API Key

Generate a free API key instantly. No credit card, no approval wait. 500 requests/day to start building.

Instant key generation — start using it in seconds
Usage dashboard to monitor your requests
Need Pro or Enterprise? Contact us

Checking your account...