---
title: "Compare renting with buying"
method: POST
path: "/api/v1/calculate-rent-vs-buy"
tags: ["calculations"]
---

# Compare renting with buying

`POST /api/v1/calculate-rent-vs-buy`

## Request

- Base URL: `https://www.usmortgagecalc.com`
- URL: `https://www.usmortgagecalc.com/api/v1/calculate-rent-vs-buy`
- Auth: none declared

Compares renting and buying on net wealth rather than on monthly payment, accounting for equity, appreciation, maintenance, selling costs, and the return a renter earns on money not spent on a down payment. Returns the year buying overtakes renting. The result is highly sensitive to the appreciation and investment-return assumptions, which are returned alongside it.

## Request body

- object: Rent versus buy compared on net wealth, with the year buying pulls ahead.
  - `homePrice` number, required: Purchase price of the home in US dollars.
  - `downPaymentPercent` number: Down payment as a percentage of the purchase price, 0 to 100. Not a dollar amount.
  - `annualInterestRatePercent` number: Annual nominal interest rate as a percentage, for example 6.5 for 6.5%.
  - `loanTermYears` integer: Loan term in years. Most US mortgages are 15 or 30.
  - `annualInsurance` number: Annual homeowners insurance premium.
  - `monthlyHoa` number: Monthly HOA dues.
  - `monthlyRent` number, required: Current monthly rent for a comparable home.
  - `annualRentIncreasePercent` number: Expected annual rent growth.
  - `annualHomeAppreciationPercent` number: Expected annual home price growth. The answer is highly sensitive to this.
  - `annualMaintenancePercent` number: Annual upkeep as a percentage of home value. Typically 1 to 2.
  - `investmentReturnPercent` number: Return a renter earns on cash not tied up in a house.
  - `sellingCostPercent` number: Cost of selling, including agent commission.
  - `yearsToCompare` integer: Horizon of the comparison.
  - `state` string: Full US state name, for example "Texas". Used to look up the average property tax rate. Either this or propertyTaxRatePercent is required.
  - `propertyTaxRatePercent` number: Annual property tax as a percentage of home value. Omit and pass `state` instead to use that state's average.

## Response `200`

Calculation result.

- object
  - `data` object: The calculation result.
  - `meta` object
    - `operation` string
    - `computedAt` string, date-time

## Other responses

- `400`: Input failed validation. The message names the offending field.
- `429`: Rate limit exceeded. Retry after the interval in Retry-After.

---

[API](https://skmtc.dev/usmortgagecalc/apis/us-mortgage-calculator-api.md) · [All operations](https://skmtc.dev/usmortgagecalc/apis/us-mortgage-calculator-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usmortgagecalc/apis/us-mortgage-calculator-api/revisions/4439848058a8?raw)
