Catalog/finance-calculator

Finance

Financial calculator (compound/loan/NPV/IRR) API

Run a financial calculation: compound interest, loan amortization payment, NPV, or IRR (iterative solver). Answers queries like 'monthly payment on a loan', 'compound interest', 'net present value', 'internal rate of return'.

Price$0.01per request
MethodPOST
Route/v1/finance/calculator
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
financecalculatorloannpvirrcompound-interestamortizationtvm
API URLhttps://x402.hexl.dev/v1/finance/calculator
Integration docs
Example request
{
  "op": "loan",
  "principal": 250000,
  "annualRate": 0.06,
  "months": 360
}
Example response
{
  "op": "loan",
  "result": 1498.88,
  "detail": {
    "totalPaid": 539595.47,
    "totalInterest": 289595.47
  }
}
Input schema
{
  "type": "object",
  "required": [
    "op"
  ],
  "properties": {
    "op": {
      "type": "string",
      "enum": [
        "compound",
        "loan",
        "npv",
        "irr"
      ]
    },
    "principal": {
      "type": "number"
    },
    "annualRate": {
      "type": "number",
      "description": "decimal, e.g. 0.05"
    },
    "years": {
      "type": "number"
    },
    "months": {
      "type": "number"
    },
    "compoundsPerYear": {
      "type": "number",
      "default": 12
    },
    "rate": {
      "type": "number",
      "description": "decimal, for NPV"
    },
    "cashflows": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  }
}
Output schema
{
  "type": "object",
  "required": [
    "op",
    "result"
  ],
  "properties": {
    "op": {
      "type": "string"
    },
    "result": {
      "type": "number"
    },
    "detail": {
      "type": "object",
      "additionalProperties": true
    }
  }
}