API Endpoint
Mortgage Affordability
Calculate how much house you can afford based on income, debts, and lending ratios.
Endpoint
Also supports GET with query parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
annualIncome | number | — | Annual gross income ($) |
monthlyDebts | number | — | Total monthly debt payments ($) |
downPayment | number | — | Available down payment ($) |
annualRate | number | — | Expected mortgage rate (%) |
years | number | — | Loan term (years) |
housingRatio | number | 28 | Max housing expense ratio (%) |
debtRatio | number | 36 | Max total debt ratio (%) |
Request Examples
POST (JSON body)
curl -X POST https://likeoptions.com/api/v1/calculate/affordability \
-H "Content-Type: application/json" \
-d '{"annualIncome": 100000, "monthlyDebts": 50000, "downPayment": 6}'GET (query parameters)
curl "https://likeoptions.com/api/v1/calculate/affordability?annualIncome=100000&monthlyDebts=50000&downPayment=6"Response
{
"kind": "affordability",
"result": {
"primary": 1234.56,
"secondary": [
{ "label": "Example metric", "value": 100, "format": "money" },
{ "label": "Example percent", "value": 5.5, "format": "percent" }
]
}
}When to Use
- Determine purchase budget
- Understand lending limits
- Plan house hunting
Error Handling
- 400 Bad Request — Invalid input parameters or missing required fields
- 404 Not Found — Unknown calculator kind
- 429 Too Many Requests — Rate limit exceeded (120 req/hour per IP)
- 413 Payload Too Large — Request body exceeds 16 KB
Related Endpoints
View request examples in JavaScript, Python, cURL, and more →