curl --request POST \
--url https://api.hapi.so/calculate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"home_price": 123,
"down_payment_amt": 123,
"down_payment_type": "percent",
"state": "<string>",
"loan_term": 30,
"interest_rate": 123,
"yearly_insurance": 123,
"yearly_property_tax": 123,
"monthly_pmi": 123,
"monthly_hoa": 123
}
'{
"total_monthly_payment": 123,
"principal_and_interest": 123,
"monthly_tax": 123,
"monthly_insurance": 123,
"monthly_pmi": 123,
"monthly_hoa": 123,
"interest_rate": 123,
"home_price": 123,
"down_payment_amount": 123,
"down_payment_percent": 123,
"loan_amount": 123,
"monthly_income_needed": 123,
"state": "<string>",
"yearly_income_needed": 123
}Calculate a mortgage based on the provided inputs.
curl --request POST \
--url https://api.hapi.so/calculate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"home_price": 123,
"down_payment_amt": 123,
"down_payment_type": "percent",
"state": "<string>",
"loan_term": 30,
"interest_rate": 123,
"yearly_insurance": 123,
"yearly_property_tax": 123,
"monthly_pmi": 123,
"monthly_hoa": 123
}
'{
"total_monthly_payment": 123,
"principal_and_interest": 123,
"monthly_tax": 123,
"monthly_insurance": 123,
"monthly_pmi": 123,
"monthly_hoa": 123,
"interest_rate": 123,
"home_price": 123,
"down_payment_amount": 123,
"down_payment_percent": 123,
"loan_amount": 123,
"monthly_income_needed": 123,
"state": "<string>",
"yearly_income_needed": 123
}The listing price of the home.
600000
The down payment amount. Use down_payment_type to specify the type of down payment, either percent or amount. If down_payment_type is set to percent, this field should be a percentage of the home price, e.g. 5.0. If down_payment_type is set to amount, this field should be the actual amount, e.g. 20000.
5
20000
The type of down payment - percent or amount.
percent, amount "percent"
"amount"
The state in which the home is located. Used to determine the average interest rate.
2"CA"
"NY"
The term length of the loan in years.
15, 20, 30, 40 15
20
30
40
The annual interest rate of the loan expressed as a percentage. Will return the current average rate of the given state if not provided.
6.375
The yearly cost of homeowner's insurance.
1200
The yearly cost of property tax.
2500
The monthly cost of private mortgage insurance.
100
The monthly cost of homeowner's association fees.
50
Successful Response
The total monthly payment, including principal, interest, taxes, insurance, PMI, and HOA fees.
3500
The monthly payment for principal and interest only. Does not include taxes, insurance, PMI, or HOA fees.
2500
The monthly cost of property tax.
200
The monthly cost of homeowner's insurance.
100
The monthly cost of private mortgage insurance. Not applied if the down payment is 20% or more.
100
The monthly cost of homeowner's association fees. This value will be the exact same as the input if provided.
50
The annual interest rate of the loan expressed as a percentage. This value will be the exact same as the input if provided.
6.375
The total price of the home. This value will be the exact same as the input if provided.
300000
The total dollar amount of the down payment.
60000
The percentage of the home price that is paid as a down payment expressed as a percentage.
5
The total amount of the loan.
240000
The monthly income needed to afford the home. This is based on a debt-to-income ratio of 45%.
8750
The state in which the home is located. Used to determine the average interest rate.
2"CA"
"NY"
The yearly income needed to afford the home. This is based on a debt-to-income ratio of 45%.
105000