curatedapi
Browse the docs

Guides

Finance

Excel functions

Late payments

E-invoices

Accounting

Number checks

VAT and GST

Billing and pricing

Money and currencies

Dates and time

Math

Unit conversion

Everyday

Health

Compound interest API

Future value of a lump sum with annual, monthly, daily or continuous compounding, plus the effective annual rate (APY).

POST https://api.curatedapi.com/v1/calc/finance/compound-interest

Grows a single deposit at a nominal annual rate compounded m times a year: A = P(1 + r/m)^(m·t), or A = P·e^(r·t) for continuous compounding. Whole numbers of periods are computed exactly; anything else is computed with certified high-precision arithmetic and rounded correctly.

Formula

A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1
  • Amounts are plain numbers in any single currency; no currency conversion is done.
  • Daily compounding uses 365 periods per year.

Inputs

Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).

InputTypeDescription
principal required decimal (string) Amount deposited at the start. Allowed: >= 0 and <= 1000000000000000. Unit: currency.
annual_rate_percent required decimal (string) Nominal annual interest rate in percent (may be negative, above -100). Allowed: > -100 and <= 1000. Unit: percent.
years required decimal (string) Time in years. Allowed: >= 0 and <= 200. Unit: years.
compounding annually | semiannually | quarterly | monthly | weekly | daily | continuously
default annually
How often interest is compounded. Options: annually: once a year; semiannually: twice a year; quarterly: 4 times a year; monthly: 12 times a year; weekly: 52 times a year; daily: 365 times a year; continuously: continuous compounding (e^rt)
options.rounding half_even | half_up | half_down | up | down | ceiling | floor Rounding mode applied once to each result. Default half_even.
options.decimals integer Round results to this many digits after the decimal point.

Result

Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.

ResultTypeDescription
final_amountdecimal (string)Balance at the end. Unit: currency.
interest_earneddecimal (string)Final amount minus principal. Unit: currency.
effective_annual_rate_percentdecimal (string)Effective annual rate (APY) for this compounding, in percent. Unit: percent.
periodsstringNumber of compounding periods m·t used.

Examples

1,000 at 5% for 10 years, yearly

Requestcurl
curl https://api.curatedapi.com/v1/calc/finance/compound-interest \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "principal": "1000",
    "annual_rate_percent": "5",
    "years": "10"
  }'
200 OKResponse
{
  "calculator": "finance/compound-interest@1",
  "result": {
    "final_amount": "1628.89",
    "interest_earned": "628.89",
    "effective_annual_rate_percent": "5.00",
    "periods": "10"
  },
  "exactness": {
    "final_amount": "rounded",
    "interest_earned": "rounded",
    "effective_annual_rate_percent": "exact"
  },
  "precision": {
    "rounding": "half_even",
    "decimals": 2
  },
  "inputs": {
    "principal": "1000",
    "annual_rate_percent": "5",
    "years": "10",
    "compounding": "annually"
  },
  "formula": "A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1",
  "references": [
    {
      "title": "CFPB: What is compound interest? (worked example at 5% a year)",
      "url": "https://www.consumerfinance.gov/ask-cfpb/how-does-compound-interest-work-en-1683/"
    },
    {
      "title": "Compound interest (formula and continuous compounding)",
      "url": "https://en.wikipedia.org/wiki/Compound_interest"
    }
  ],
  "warnings": []
}

1,000 at 5% for 2 years, yearly

Requestcurl
curl https://api.curatedapi.com/v1/calc/finance/compound-interest \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "principal": "1000",
    "annual_rate_percent": "5",
    "years": "2"
  }'
200 OKResponse
{
  "calculator": "finance/compound-interest@1",
  "result": {
    "final_amount": "1102.50",
    "interest_earned": "102.50",
    "effective_annual_rate_percent": "5.00",
    "periods": "2"
  },
  "exactness": {
    "final_amount": "exact",
    "interest_earned": "exact",
    "effective_annual_rate_percent": "exact"
  },
  "precision": {
    "rounding": "half_even",
    "decimals": 2
  },
  "inputs": {
    "principal": "1000",
    "annual_rate_percent": "5",
    "years": "2",
    "compounding": "annually"
  },
  "formula": "A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1",
  "references": [
    {
      "title": "CFPB: What is compound interest? (worked example at 5% a year)",
      "url": "https://www.consumerfinance.gov/ask-cfpb/how-does-compound-interest-work-en-1683/"
    },
    {
      "title": "Compound interest (formula and continuous compounding)",
      "url": "https://en.wikipedia.org/wiki/Compound_interest"
    }
  ],
  "warnings": []
}

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.