Snowballr Calculator API
Free, no-auth JSON endpoints for compound interest, loan amortization, and debt payoff. CORS-enabled. Schema.org compatible. Use them in your app, agent, spreadsheet, or AI tool.
API responses are licensed under CC BY 4.0, which permits commercial reuse with the required attribution. Suggested credit: Calculations by Snowballr (snowballr.io). Include the source URI and license link where reasonably practicable. We do not require a publisher-site backlink or a keyword-rich anchor.
Endpoints
- Compound interest —
/api/calculate/compound - Loan amortization —
/api/calculate/loan - Debt snowball / avalanche —
/api/calculate/debt-snowball
Compound interest
GET /api/calculate/compoundFuture value of an initial amount plus month-end contributions that can increase by an optional percentage at the start of each projection year. The nominal annual rate and selected compounding frequency determine the equivalent monthly growth rate. Returns a year-by-year schedule.
The monthly growth factor is (1 + rate / 100 / n)^(n / 12), where n is 365 for daily, 252 for business days, 12 for monthly, 4 for quarterly, 2 for semiannual, or 1 for annual compounding. Each month, the balance grows by that factor and then receives the monthly contribution. The optional increase parameter raises that amount at the start of each new projection year; year 1 uses the starting amount. Deposits remain monthly at every compounding frequency. This is a projection convention; individual accounts may credit interest differently.
result.effectiveAnnualRate is 100 × ((1 + rate / 100 / n)^n − 1), rounded to six decimals. The legacy result.cagr field retains the nominal input rate for compatibility. Neither field measures a cash-flow return or IRR. The example assumes a constant rate and excludes fees, taxes, inflation, and withdrawals.
| Param | Type | Default | Description |
|---|---|---|---|
initial | number | 0 | Starting balance |
monthly | number | 0 | Starting monthly contribution, added after growth at each month-end |
increase | number | 0 | Optional annual percentage increase (0–20) applied to the monthly contribution at each new projection year; year 1 uses the starting amount |
rate | number | 7 | Nominal annual % return, before compounding (e.g., 7 for 7%) |
years | number | 30 | Time horizon (1–100) |
compounding | string | monthly | daily | business-days (252) | monthly | quarterly | semiannually | annually |
currency | string | USD | ISO 4217 currency code |
https://snowballr.io/api/calculate/compound?initial=10000&monthly=500&increase=3&rate=7&years=30&compounding=monthly¤cy=USDSchedule abbreviated to the first year here; the API returns all years. Amounts are rounded to two decimals only in the response.
{
"@context": "https://schema.org",
"@type": "Dataset",
"name": "Compound interest calculation: USD 10000 + USD 500/mo at 7% for 30 years",
"inputs": {
"initial": 10000,
"monthly": 500,
"increase": 3,
"rate": 7,
"years": 30,
"compounding": "monthly",
"currency": "USD"
},
"assumptions": {
"contributionTiming": "end-of-month",
"monthlyGrowthFactor": "(1 + rate / 100 / n)^(n / 12), where n is the compounding frequency per year",
"contributionIncrease": "Optional annual percentage increase to the monthly contribution, applied at each projection year start; year 1 uses the starting contribution.",
"rateDefinition": "Nominal annual percentage; the balance grows at the equivalent monthly rate.",
"cagrDefinition": "Legacy alias of inputs.rate (nominal annual percentage), not a cash-flow return or IRR. Use result.effectiveAnnualRate for the effective annual percentage."
},
"result": {
"finalBalance": 914744.96,
"totalContributions": 295452.49,
"totalGrowth": 619292.47,
"cagr": 7,
"effectiveAnnualRate": 7.229008,
"multiple": 3.1
},
"schedule": [
{
"year": 1,
"balance": 16919.19,
"contributions": 16000,
"growth": 919.19
}
],
"source": "https://snowballr.io",
"citation": "Snowballr Compound Interest API — https://snowballr.io/api-docs",
"license": "https://creativecommons.org/licenses/by/4.0/",
"generatedFor": "https://snowballr.io/api/calculate/compound?initial=10000&monthly=500&increase=3&rate=7&years=30&compounding=monthly¤cy=USD"
}Loan amortization
GET /api/calculate/loanMonthly payment + total interest for any fixed-rate loan. Optional extra monthly payment shows months and interest saved.
| Param | Type | Default | Description |
|---|---|---|---|
principal | number | 300000 | Loan amount |
rate | number | 6.5 | Annual APR |
years | number | 30 | Loan term |
extra | number | 0 | Extra monthly payment |
currency | string | USD | ISO 4217 currency code |
https://snowballr.io/api/calculate/loan?principal=300000&rate=6.5&years=30&extra=200Response excerpt; schedule abbreviated to the first year. monthlyPayment is the base payment, excluding the additional 200 per month in this example. Assumes a fixed rate, monthly payments, and no fees.
{
"@context": "https://schema.org",
"@type": "Dataset",
"inputs": { "principal": 300000, "rate": 6.5, "years": 30, "extraMonthly": 200, "currency": "USD" },
"result": {
"monthlyPayment": 1896.20,
"totalPayment": 579184.67,
"totalInterest": 279184.67,
"monthsToPayoff": 277,
"yearsToPayoff": 23.08,
"interestSavedFromExtra": 103448.79,
"monthsSavedFromExtra": 83
},
"schedule": [
{ "year": 1, "balance": 294174.02, "interestYTD": 19328.47, "principalYTD": 5825.98 }
]
}Debt snowball / avalanche
GET /api/calculate/debt-snowballPay-off plan for up to 20 debts using snowball or avalanche method. Returns comparison between both. Accepts GET (query string JSON) or POST (JSON body).
| Param | Type | Default | Description |
|---|---|---|---|
debts | JSON array | — | Array of { name, balance, rate, minPayment } |
extra | number | 0 | GET: extra monthly payment above initial minimums. In a POST JSON body, use extraPayment. |
strategy | string | snowball | snowball | avalanche |
https://snowballr.io/api/calculate/debt-snowball?extra=300&strategy=snowball&debts=%5B%7B%22name%22%3A%22Card%20A%22%2C%22balance%22%3A4000%2C%22rate%22%3A22%2C%22minPayment%22%3A80%7D%2C%7B%22name%22%3A%22Card%20B%22%2C%22balance%22%3A8000%2C%22rate%22%3A18%2C%22minPayment%22%3A160%7D%5DResponse excerpt. The monthly budget is the initial minimum payments plus extra; freed payments roll into the next debt in the same month. Both strategies choose Card A first in this example. monthsToFree is null when a balance remains at the 600-month simulation limit; inspect paidOff and remainingBalance.
{
"@context": "https://schema.org",
"@type": "Dataset",
"inputs": {
"debts": [
{
"name": "Card A",
"balance": 4000,
"rate": 22,
"minPayment": 80
},
{
"name": "Card B",
"balance": 8000,
"rate": 18,
"minPayment": 160
}
],
"extraPayment": 300,
"strategy": "snowball"
},
"result": {
"monthsToFree": 28,
"paidOff": true,
"monthsSimulated": 28,
"remainingBalance": 0,
"totalInterest": 2831.64,
"payoffOrder": [
{
"month": 12,
"debtPaidOff": "Card A"
},
{
"month": 28,
"debtPaidOff": "Card B"
}
]
},
"comparison": {
"snowball": {
"monthsToFree": 28,
"totalInterest": 2831.64
},
"avalanche": {
"monthsToFree": 28,
"totalInterest": 2831.64
},
"avalancheSavesInterest": 0
}
}Code samples
const url = "https://snowballr.io/api/calculate/compound?initial=10000&monthly=500&increase=3&rate=7&years=30&compounding=monthly¤cy=USD";
const data = await fetch(url).then(r => r.json());
console.log(data.result.finalBalance);
// 914744.96import requests
r = requests.get("https://snowballr.io/api/calculate/compound", params={
"initial": 10000, "monthly": 500, "rate": 7, "years": 30,
})
print(r.json()["result"]["finalBalance"])
# 914744.96curl "https://snowballr.io/api/calculate/loan?principal=300000&rate=6.5&years=30&extra=200"FAQs
Is there a rate limit?
Responses are cached at the edge for 24 hours. Please be reasonable. For high-volume use, consider self-hosting using our open formula reference at /compound-interest-formula.
What about authentication?
None. No keys, no tokens, no sign-up.
Will the response format change?
Additive only. We will not rename or remove existing fields without 6 months notice. New fields may appear in the result or schedule objects.
Want more endpoints?
We're working on retirement (4% rule), mortgage refinance, Roth vs Traditional, and FIRE projections. Suggest one →
Last reviewed 2026-10-13. Response caching and availability depend on the hosting environment.