
Loan & Mortgage Calculator API
Finance
Calculate loan and mortgage payments, total interest and payoff date, with bi-weekly and accelerated payments, extra payments, Canadian semi-annual compounding and a full schedule.
Authentication
Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.
Rate Limit
120 requests per minute
Endpoints
1 endpoint available
Overview
Works out the regular payment, total interest, total paid and payoff date for a loan or mortgage, with an optional extra payment each period and a year-by-year or payment-by-payment schedule.
Interest and payments
compounding: "standard"compounds once per payment (rate divided by payments per year)."canadian"compounds semi-annually, as the Interest Act requires for fixed-rate mortgages in Canada.accelerated-bi-weeklyandaccelerated-weeklypay the monthly payment divided by 2 or 4, every 2 weeks or every week. That adds up to one extra monthly payment a year, so the loan finishes early.- The schedule works in whole cents, like a lender's: the payment and each period's interest are rounded to the cent and the last payment clears what is left.
extraPaymentis paid with every payment and goes straight to principal. When it is above 0,withoutExtraPaymentshows the same loan without it, withinterestSavedandpaymentsSaved.- The term can be 1 to 600 months. A rate of 0 works.
Dates
- Dates are
YYYY-MM-DDand are handled in UTC, so they do not shift. Monthly payment dates keep the day of the month and clamp to month end (January 31 is followed by February 28 or 29). - If
firstPaymentDateis left out, it is the first day of the month afterreferenceDate. IfreferenceDateis also left out, that is today's date in UTC on the server. SendfirstPaymentDatefor results that do not change from day to day. The date used comes back asfirstPaymentDate.
Schedule
schedule: "yearly"(default) returnsyearly, one row per year.schedule: "payments"returnspayments, one row per payment, in pages. UsescheduleOffsetandscheduleLimit(up to 1,000 per request).paymentsTotalandpaymentsHasMoretell you when to stop.schedule: "none"returns the summary only.
Amounts are numbers in dollars, to the cent.
Endpoints
POST
https://opentools.ca/api/v1/tools/loan-calculatorCalculate loan or mortgage payments with an amortization schedule
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| principal | number | Required | Loan amount, 1 or more. |
| annualRate | number | Required | Annual interest rate as a percentage, 0 to 50. |
| term | number | Required | Length of the loan, in termUnit. Works out to 1 to 600 months. |
| termUnit | string Enum: years, months | Optional | Unit for term.Default: years |
| frequency | string Enum: monthly, bi-weekly, weekly, accelerated-bi-weekly, accelerated-weekly | Optional | How often payments are made.Default: monthly |
| compounding | string Enum: standard, canadian | Optional | Interest convention.Default: standard |
| extraPayment | number | Optional | Extra amount paid with every payment, straight to principal.Default: 0 |
| firstPaymentDate | string | Optional | Date of the first payment, YYYY-MM-DD, in years 1900 to 2400. Defaults to the first day of the month after referenceDate. |
| referenceDate | string | Optional | Used only when firstPaymentDate is missing. Defaults to today's date in UTC on the server.Default: today (UTC) |
| schedule | string Enum: none, yearly, payments | Optional | Which schedule to return.Default: yearly |
| scheduleOffset | number | Optional | payments schedule only. Number of payments to skip.Default: 0 |
| scheduleLimit | number | Optional | payments schedule only. Payments to return, 1 to 1,000.Default: 360 |
Response Example
{
"success": true,
"principal": 25000,
"annualRate": 6,
"termMonths": 24,
"frequency": "monthly",
"compounding": "standard",
"extraPayment": 0,
"firstPaymentDate": "2027-01-01",
"paymentsPerYear": 12,
"payment": 1108.02,
"periodicRate": 0.005,
"effectiveAnnualRate": 6.167781,
"scheduledPaymentCount": 24,
"paymentCount": 24,
"totalInterest": 1592.37,
"totalPaid": 26592.37,
"payoffDate": "2028-12-01",
"withoutExtraPayment": null,
"yearly": [
{
"year": 1,
"payments": 12,
"principal": 12126.11,
"interest": 1170.13,
"extra": 0,
"endBalance": 12873.89,
"endDate": "2027-12-01"
},
{
"year": 2,
"payments": 12,
"principal": 12873.89,
"interest": 422.24,
"extra": 0,
"endBalance": 0,
"endDate": "2028-12-01"
}
]
}Error Codes
400
Bad Request - A field is invalid, the term is outside 1 to 600 months, or firstPaymentDate is outside 1900 to 2400401
Unauthorized - Missing or invalid API key403
Forbidden - The API key is inactive or expired, or the request IP is not allowed405
Method Not Allowed - This endpoint accepts POST only429
Too Many Requests - Rate limit exceeded (120 requests per minute per API key)500
Internal Server ErrorCode Examples
# Two-year loan, summary and yearly schedule
curl -X POST https://opentools.ca/api/v1/tools/loan-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"principal": 25000,
"annualRate": 6,
"term": 2,
"frequency": "monthly",
"firstPaymentDate": "2027-01-01",
"schedule": "yearly"
}'
# Canadian mortgage with an extra payment, first three payments
curl -X POST https://opentools.ca/api/v1/tools/loan-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"principal": 400000,
"annualRate": 5,
"term": 25,
"compounding": "canadian",
"extraPayment": 200,
"referenceDate": "2026-11-25",
"schedule": "payments",
"scheduleLimit": 3
}'Rather use it in your browser? Open the Loan & Mortgage Calculator