80trust / 100

Cap Rate Calculator

by Sindri in News & content

x402 APIPassing, checked 31 min ago

Cap rate calculator for real estate investing. Runs a full multi-year deal analysis (per-category rent/expense growth, a sale scenario, IRR) and headlines the capitalization rate: first-year NOI divided by purchase price.

POST https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/capRateCalculator

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
132 ms typical, 132 ms slowest 5%
Last check
31 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/capRateCalculator" \
  -H "content-type: application/json" \
  -d '{"annualInsurance":0,"annualMaintenance":0,"annualPropertyTaxes":0,"closingCosts":0,"downPaymentPercent":0.2,"hoaAnnualIncrease":0,"holdingLengthYears":2,"insuranceAnnualIncrease":0,"interestRate":0,"loanTermYears":10,"maintenanceAnnualIncrease":0,"monthlyHOA":0,"monthlyRent":2000,"otherAnnualExpenses":0,"otherAnnualIncrease":0,"propertyManagementFeeRate":0,"purchasePrice":200000,"rehabCosts":0,"rentAnnualIncrease":0,"saleExpensesRate":0,"salePrice":200000,"taxesAnnualIncrease":0,"vacancyRate":0}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws%2FcapRateCalculator
const res = await pay("https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/capRateCalculator", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"annualInsurance":0,"annualMaintenance":0,"annualPropertyTaxes":0,"closingCosts":0,"downPaymentPercent":0.2,"hoaAnnualIncrease":0,"holdingLengthYears":2,"insuranceAnnualIncrease":0,"interestRate":0,"loanTermYears":10,"maintenanceAnnualIncrease":0,"monthlyHOA":0,"monthlyRent":2000,"otherAnnualExpenses":0,"otherAnnualIncrease":0,"propertyManagementFeeRate":0,"purchasePrice":200000,"rehabCosts":0,"rentAnnualIncrease":0,"saleExpensesRate":0,"salePrice":200000,"taxesAnnualIncrease":0,"vacancyRate":0}),
});
console.log(await res.json());

Example input

{
  "annualInsurance": 0,
  "annualMaintenance": 0,
  "annualPropertyTaxes": 0,
  "closingCosts": 0,
  "downPaymentPercent": 0.2,
  "hoaAnnualIncrease": 0,
  "holdingLengthYears": 2,
  "insuranceAnnualIncrease": 0,
  "interestRate": 0,
  "loanTermYears": 10,
  "maintenanceAnnualIncrease": 0,
  "monthlyHOA": 0,
  "monthlyRent": 2000,
  "otherAnnualExpenses": 0,
  "otherAnnualIncrease": 0,
  "propertyManagementFeeRate": 0,
  "purchasePrice": 200000,
  "rehabCosts": 0,
  "rentAnnualIncrease": 0,
  "saleExpensesRate": 0,
  "salePrice": 200000,
  "taxesAnnualIncrease": 0,
  "vacancyRate": 0
}

Example output

{
  "data": {
    "firstYear": {
      "NOI": 24000,
      "capRate": 0.12,
      "cashFlow": 8000,
      "cashOnCashReturn": 0.2
    },
    "investedCash": 40000,
    "irr": 0.5177,
    "monthlyMortgagePayment": 1333.33,
    "params": {
      "annualInsurance": 0,
      "annualMaintenance": 0,
      "annualPropertyTaxes": 0,
      "closingCosts": 0,
      "downPaymentPercent": 0.2,
      "hoaAnnualIncrease": 0,
      "holdingLengthYears": 2,
      "insuranceAnnualIncrease": 0,
      "interestRate": 0,
      "loanTermYears": 10,
      "maintenanceAnnualIncrease": 0,
      "monthlyHOA": 0,
      "monthlyRent": 2000,
      "otherAnnualExpenses": 0,
      "otherAnnualIncrease": 0,
      "propertyManagementFeeRate": 0,
      "purchasePrice": 200000,
      "rehabCosts": 0,
      "rentAnnualIncrease": 0,
      "saleExpensesRate": 0,
      "salePrice": 200000,
      "taxesAnnualIncrease": 0,
      "vacancyRate": 0
    },
    "sale": {
      "impliedAnnualGrowthRate": 0,
      "netProceeds": 72000,
      "totalProfitAfterSale": 48000
    },
    "totals": {
      "NOI": 48000,
      "expenses": 0,
      "mortgagePayments": 32000,
      "operatingCashFlow": 16000,
      "rentalIncome": 48000
    },
    "yearByYear": [
      {
        "NOI": 24000,
        "annualCashFlow": 8000,
        "annualCoCReturn": 0.2,
        "annualExpenses": 0,
        "annualIncome": 24000,
        "annualMortgagePayment": 16000,
        "interestPortion": 0,
        "loanBalance": 144000,
        "principalPortion": 16000,
        "totalEquity": 56000,
        "year": 1
      }
    ]
  },
  "ok": true
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
31 min agoPassed402370 ms$0.01
6 h agoPassed402132 ms$0.01