GET/v1/loan
Monthly payment, total interest, yearly summary and optional full schedule for a loan or mortgage
rate is the annual percentage rate. Give years or months. extra is an additional principal payment each month; start dates the schedule.
PARAMETERS
- principalquery · numberREQUIRED
- Amount borrowede.g. 400000
- ratequery · numberREQUIRED
- Annual interest rate, percente.g. 6.25
- yearsquery · number
- Term in yearse.g. 30
- monthsquery · integer
- Term in months (overrides years)e.g. 1
- extraquery · number
- Extra principal paid every monthe.g. 0
- startquery · string
- Date of the first paymente.g. string
- schedulequery · boolean
- Include every monthly row (up to 1,200)e.g. false
REQUEST
curl "https://api.apialmanac.com/v1/loan?principal=400000&rate=6.25" \ -H "X-API-Key: YOUR_KEY"
import requests
r = requests.get("https://api.apialmanac.com/v1/loan?principal=400000&rate=6.25", headers={"X-API-Key": "YOUR_KEY"})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.apialmanac.com/v1/loan?principal=400000&rate=6.25", {
headers: { "X-API-Key": "YOUR_KEY" }
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"principal": 400000,
"rate": 6.25,
"months": 360,
"payment": 2462.87,
"total_paid": 886633.2,
"total_interest": 486633.2,
"extra": 0,
"payoff_months": 360,
"payoff_date": null,
"yearly": [
{
"year": 1,
"paid": 29554.44,
"principal": 4694.14,
"interest": 24860.3,
"balance": 395305.86
}
],
"schedule": []
}