Skip to content
All APIs

Calculators · Finance · 1 endpoint

Compound Interest

Balance, contributions, and the interest earned on both — the arithmetic every savings product starts from.

Status
Operational
Price
1 credit / request
Rate limit
300 / 60s
Cache
None
Requests
0

Endpoint

How to call it

GET/v1/finance/compound-interest

Code

Request — cURL

v1

curl https://api.diraz.co.id/v1/finance/compound-interest \
  -H "Authorization: Bearer drz_live_…"

For AI agents

Callable through the MCP server with the same key:

call_api {"endpoint":"compound-interest","params":{"principal":"1000","rate_pct":"5","years":"10"}}

Parameters

principalnumber · required
The starting balance.
rate_pctnumber · required
Annual rate in percent.
yearsnumber · required
How long it compounds.
times_per_yearinteger · optional
Compounding periods per year: 1, 2, 4, 12, 365.Default: 12
contributionnumber · optional
Added at the end of every period.Default: 0

Example response

200 OK

JSON

{
  "data": {
    "principal": 1000,
    "rate_pct": 5,
    "years": 10,
    "times_per_year": 1,
    "contribution": 0,
    "balance": 1628.89,
    "total_contributed": 1000,
    "interest_earned": 628.89
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
balance
Where it ends up.
total_contributed / interest_earned
What went in, and what the compounding paid.

Errors

When something goes wrong

Every failure carries a stable machine-readable code and the same meta.request_id a success carries — quote it and we can find your request. Errors are never billed.

401 Unauthorized

JSON

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "The API key is invalid, expired, or revoked."
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
UNAUTHORIZEDHTTP 401
Missing, malformed, expired, or revoked API key.
FORBIDDENHTTP 403
The key is valid but lacks the scope this product needs.
VALIDATION_ERRORHTTP 422
A query parameter is the wrong type or out of range.
RATE_LIMITEDHTTP 429
Rate limit exhausted. `Retry-After` says how long to wait.
SERVICE_UNAVAILABLEHTTP 503
No data recent enough to serve. Carries `Retry-After`, and is never billed.

Health

Is it up?

  • Compound Interest

1/1 passing