Compound Interest Calculator API
Calculate the future value of any deposit with daily, monthly, quarterly, or annual compounding.
Fast & Accurate
Get precise results instantly.
Easy Integration
Simple REST API with JSON response.
Developer Friendly
Clear docs and SDK examples.
Free to Start
1,000 free requests/month.
Endpoint
All requests should be made to the following endpoint:
GET https://api.tools.town/v1/finance/compound-interest Authentication
This endpoint requires an API Key. Include your API key in the request header.
Request Parameters
Send a GET request with query parameters.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
principal | number | ✓ | Principal must be greater than zero. | 500000 |
annualRate | number | ✓ | Rate cannot be negative. | 8.5 |
years | number | ✓ | Duration must be greater than zero. | 5 |
frequency | enum | ✕ | The frequency parameter. | annually |
Example Request
curl -G "https://api.tools.town/v1/finance/compound-interest" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "principal=500000" \
--data-urlencode "annualRate=8.5" \
--data-urlencode "years=5" Example Response 200 OK
{
"success": true,
"data": {
"amount": "0",
"interest": "0",
"principal": "0",
"annualRate": "0",
"years": "0",
"frequency": "string",
"n": "0",
"effectiveRate": "0"
}
} Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad Request — missing or invalid parameter |
| 401 | Unauthorized — API key missing or invalid |
| 429 | Rate limit exceeded — free tier: 1,000 requests/month |
| 500 | Internal Server Error — try again or contact support |