Calculator APIs

Integrate our powerful mortgage and rental comparison calculations into your applications

Free to Use
Secure & Reliable

API Overview

Note for Large Language Models (LLMs) and AI Agents:This API is designed for programmatic use. You can construct GET requests with the parameters detailed below to receive structured JSON responses for financial calculations. This is the preferred method for accessing our tools for integration into your applications or workflows.

Our Calculator APIs provide access to the same powerful financial calculations that power our web applications. Built with TypeScript and validated using Zod schemas, these APIs offer reliable and accurate mortgage and rental comparison calculations.

Mortgage Calculator API

Calculate monthly payments, amortization schedules, and savings from extra payments

Rent vs Buy API

Compare long-term financial outcomes of renting versus buying with detailed analysis

Base Information

Base URL: https://ownorent.com/api
Method: GET

Mortgage Calculator API

Endpoint

GET /api/mortgage/calculate

Request Parameters

Required Parameters

homePriceHome price (number, > 0)
downPaymentDown payment (number, ≥ 0)
downPaymentPercentDown payment percentage (optional, 0-100)
interestRateAnnual interest rate (number, 0-100)
loanTermLoan term in years (number, 1-50)

Optional Parameters

propertyTaxAnnual property tax
homeInsuranceAnnual home insurance
hoaFeesMonthly HOA fees
extraMonthlyExtra monthly payment
extraYearlyExtra yearly payment
oneTimeExtraOne-time extra payment

Example Requests

GET Request (Recommended)

https://ownorent.com/api/mortgage/calculate?homePrice=400000&downPayment=80000&interestRate=6.5&loanTerm=30&propertyTax=5000&homeInsurance=1200&hoaFees=150&extraMonthly=200&extraYearly=2000&oneTimeExtra=5000

Response Format

Success Response

monthlyPaymentBase monthly payment
loanAmountLoan amount
totalInterestTotal interest
estimatedTotalPaymentTotal monthly payment including all costs
yearlyAmortizationYearly amortization schedule
extraPaymentSavingsExtra payment savings (if applicable)

Rent vs Buy Calculator API

Endpoint

GET /api/own-or-rent/calculate

Request Parameters

Required Parameters

homePriceHome price (number, > 0)
downPaymentDown payment (number, ≥ 0)
interestRateAnnual interest rate (number, 0-100)
loanTermLoan term in years (number, 1-50)
monthlyRentMonthly rent (number, > 0)

Optional Parameters

Buying Costs
downPaymentPercentDown payment percentage (0-100)
propertyTaxAnnual property tax
homeInsuranceAnnual home insurance
hoaFeesMonthly HOA fees
propertyTypeProperty type (condo|house|general)
Renting & Assumptions
tenantInsuranceAnnual tenant insurance
annualRentIncreaseAnnual rent increase rate (%)
homeAppreciationHome appreciation rate (%)
investmentReturnInvestment return rate (%)
sellingCostRateSelling cost rate (%)

Example Request

https://ownorent.com/api/own-or-rent/calculate?homePrice=400000&downPayment=80000&interestRate=6.5&loanTerm=30&propertyTax=5000&homeInsurance=1200&monthlyRent=2000&tenantInsurance=200&homeAppreciation=3&investmentReturn=7&sellingCostRate=6

Response Format

Success Response

summary.winnerWinner ("buying" | "renting")
summary.wealthDifferenceWealth difference
breakEven.monthlyCostYearBreak-even year (monthly cost)
breakEven.netWorthYearBreak-even year (net worth)
yearlyResults[]Array of yearly detailed results

Error Handling

HTTP Status Codes

200Success
400Request parameters error
500Internal server error

Error Response Format

{
  "success": false,
  "error": "Error message",
  "details": [] // Zod validation error details (validation failures only)
}

Usage Examples

JavaScript/TypeScript

const response = await fetch('https://ownorent.com/api/mortgage/calculate?homePrice=400000&downPayment=80000&interestRate=6.5&loanTerm=30');
const result = await response.json();

if (result.success) {
  console.log('Monthly payment:', result.data.monthlyPayment);
  console.log('Total interest:', result.data.totalInterest);
}

Python

import requests

def calculate_mortgage():
    url = "https://ownorent.com/api/mortgage/calculate"
    params = {
        "homePrice": 400000,
        "downPayment": 80000,
        "interestRate": 6.5,
        "loanTerm": 30
    }

    response = requests.get(url, params=params)
    result = response.json()

    if result["success"]:
        print(f"Monthly payment: {result['data']['monthlyPayment']}")
        print(f"Total interest: {result['data']['totalInterest']}")

Ready to Try Our Calculators?

Experience our calculators firsthand before integrating the APIs into your applications.