Calculator APIs
Integrate our powerful mortgage and rental comparison calculations into your applications
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
https://ownorent.com/api
GET
Mortgage Calculator API
Endpoint
Request Parameters
Required Parameters
homePrice
Home price (number, > 0)downPayment
Down payment (number, ≥ 0)downPaymentPercent
Down payment percentage (optional, 0-100)interestRate
Annual interest rate (number, 0-100)loanTerm
Loan term in years (number, 1-50)Optional Parameters
propertyTax
Annual property taxhomeInsurance
Annual home insurancehoaFees
Monthly HOA feesextraMonthly
Extra monthly paymentextraYearly
Extra yearly paymentoneTimeExtra
One-time extra paymentExample 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
monthlyPayment
Base monthly paymentloanAmount
Loan amounttotalInterest
Total interestestimatedTotalPayment
Total monthly payment including all costsyearlyAmortization
Yearly amortization scheduleextraPaymentSavings
Extra payment savings (if applicable)Rent vs Buy Calculator API
Endpoint
Request Parameters
Required Parameters
homePrice
Home price (number, > 0)downPayment
Down payment (number, ≥ 0)interestRate
Annual interest rate (number, 0-100)loanTerm
Loan term in years (number, 1-50)monthlyRent
Monthly rent (number, > 0)Optional Parameters
Buying Costs
downPaymentPercent
Down payment percentage (0-100)propertyTax
Annual property taxhomeInsurance
Annual home insurancehoaFees
Monthly HOA feespropertyType
Property type (condo|house|general)Renting & Assumptions
tenantInsurance
Annual tenant insuranceannualRentIncrease
Annual rent increase rate (%)homeAppreciation
Home appreciation rate (%)investmentReturn
Investment return rate (%)sellingCostRate
Selling 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.winner
Winner ("buying" | "renting")summary.wealthDifference
Wealth differencebreakEven.monthlyCostYear
Break-even year (monthly cost)breakEven.netWorthYear
Break-even year (net worth)yearlyResults[]
Array of yearly detailed resultsError Handling
HTTP Status Codes
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.