← Back to API Ninjas
GET/v1/mortgagecalculator

Calculate mortgage payments

Calculates monthly and annual mortgage payments and interest from a loan amount or home value and downpayment, plus optional HOA, tax and insurance. Requires `interest_rate`.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/mortgagecalculator", query: { "interest_rate": 123 } }); console.log(output);

Query parameters

loan_amount
number

Principal loan amount.

home_value
number

Total value of the home or asset. Must be greater than downpayment.

downpayment
number

Downpayment on the home or asset. Cannot exceed home_value.

interest_raterequired
number

Annual interest rate (in %). For example, a 3.5% interest rate would be 3.5. Cannot exceed 10000.

duration_years
number

Duration of the loan in years. Must be between 1 and 10000. If not set, the default value is 30 years. (Default: 30)

monthly_hoa
number

Monthly homeowner association fees.

annual_property_tax
number

Annual property tax owed.

annual_home_insurance
number

Annual homeowner's insurance bill.

    Orthogonal - Giving AI agents the tools they need.