CalcX Loan Calculator API

API Overview

Introducing the CalcX Loan Calculator API, a powerful tool that provides accurate estimates of loan costs and generates a detailed amortization schedule. Our API offers precise calculations of the total cost of a loan, allowing you to make informed financial decisions. By providing essential inputs such as the loan amount, interest rate, and repayment term, our API instantly generates estimates of the overall cost, giving you a comprehensive understanding of your financial commitment and a detailed amortization schedule. This schedule breaks down each payment, showing the portion dedicated to interest, principal, and remaining balance. Armed with this information, you can plan your budget efficiently and stay on top of your repayment schedule.

The API uses currency rates provided by Forex. Integrating the CalcX Loan Cost Calculator API into your existing systems and applications is a breeze. The API supports a wide range of programming languages, including but not limited to: C, Clojure, C#, GO, Java, JavaScript, Kotlin, Node.js, Objective-C, OCaml, PHP, PowerShell, Python, R, RapidQL, Ruby, Shell, and Swift.

Supported Currencies:

NOK (Norwegian Krone), EUR (Euro), HKD (Hong Kong Dollar), CZK (Czech Koruna), THB (Thai Baht), CHF (Swiss Franc), USD (United States Dollar), ISK (Icelandic Króna), GBP (British Pound Sterling), JPY (Japanese Yen), BGN (Bulgarian Lev), CNY (Chinese Yuan), IDR (Indonesian Rupiah), TRY (Turkish Lira), NZD (New Zealand Dollar), SGD (Singapore Dollar), DKK (Danish Krone), AUD (Australian Dollar), BRL (Brazilian Real), ILS (Israeli New Shekel), SEK (Swedish Krona), CAD (Canadian Dollar), HUF (Hungarian Forint), ZAR (South African Rand), MYR (Malaysian Ringgit), KRW (South Korean Won), MXN (Mexican Peso), INR (Indian Rupee), PHP (Philippine Peso), PLN (Polish Złoty) and RON (Romanian Leu).

Status Codes:

200: Successful calculation and response.

400: Invalid request or missing required parameters.

500: Internal server error.

Error Handling

If an error occurs during the calculation or processing of the request, the API will respond with an error message and an appropriate status code.

Calculate Loan

These endpoints calculate the cost of a loan based on the provided loan amount, interest rate, and repayment term. They also generate an amortization schedule that breaks down each payment, including the interest, principal, and remaining balance. The endpoints support additional parameters such as extra payment and currency conversion. They return the loan type, loan amount, interest rate, repayment term, monthly payment, total loan interest, and the complete amortization schedule in the requested currency.

Parameters

ParameterTypeRequiredDescription
loanfloatYesThe loan amount as a float. Example: loan=10000.
ratefloatYesThe annual interest rate as a float. Example: rate=5.5.
termintYesThe repayment term in months as an integer. Example: term=12.
typestringOptionalThe loan type as a string. This parameter is case-insensitive and can take one of the following values: mortgage, auto, business, student, medical, personal, or other. Defaults to “other.
extrafloatOptionalThe extra payment per month as a float. Example: extra=500.0. Default value: 0.0.
currencystringOptionalThe desired currency for the response. Defaults to “USD“.

/loan

HTTP Request Example:
GET /loan?loan=10000&rate=5.5&term=12&type=student&extra=0.0&currency=USDHTTP/1.1 
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com

/loan/post

HTTP Request Example:
POST /loan/post HTTP/1.1 
Content-Type: application/json
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com
Content-Length: 115
{
"loan": 10000,
"rate": 5.5,
"term": 12,
"extra": "0.0",
"type": "student",
"currency": "USD"
}

/loan/batch

HTTP Request Example:
POST /loan/batch HTTP/1.1 
Content-Type: application/json
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com
Content-Length: ...
[
{
"loan": 10000,
"rate": 5.5,
"term": 12,
"currency": "USD",
"extra": "0.0",
"type": "student"
},
...
]
JSON Response:
{ 
"interest_rate": "5.50%",
"loan_amount": "$10000.00",
"loan_interest": "$300.41",
"loan_type": "student",
"monthly_payment": "$858.37",
"repayment_term": "12 months",
"schedule": [
{
"balance": "$9187.47",
"interest": "$45.83",
"payment": "$858.37",
"period": 1,
"principal": "$812.53"
},
{
"balance": "$8371.21",
"interest": "$42.11",
"payment": "$858.37",
"period": 2,
"principal": "$816.26"
},
{
"balance": "$7551.21",
"interest": "$38.37",
"payment": "$858.37",
"period": 3,
"principal": "$820.00"
},
...
{
"balance": "$0.00",
"interest": "$3.92",
"payment": "$858.37",
"period": 12,
"principal": "$854.45"
}
]
}

Endpoint Response

The response will be a JSON object containing the results for each loan calculation in the same order as they were provided in the request. Each result will have the following properties:

KeyDescription
loan_type The type of the loan.
loan_amount The loan amount formatted with the currency symbol.
interest_rate The interest rate formatted as a percentage.
repayment_term The repayment term in months.
monthly_payment The monthly payment amount formatted with the currency symbol.
loan_interest The total interest paid over the loan term formatted with the currency symbol.
schedule An array of objects representing the amortization schedule. Each object has the following keys:
period : The period number.
payment : The payment amount for the period formatted with the currency symbol.
interest : The interest amount for the period formatted with the currency symbol.
principal : The principal amount for the period formatted with the currency symbol.
balance : The remaining balance after the period formatted with the currency symbol.

Calculate Auto Loan

The Auto Loan Calculator endpoint provides a way to calculate and analyze auto loan-related information, including monthly payments, total loan cost, and amortization schedules. The endpoint supports both GET and POST requests.

Parameters

ParameterTypeRequiredDescription
pricedecimalYesThe loan amount as a float. Example: price=10000.
ratedecimalYesThe annual interest rate as a float. Example: rate=5.5.
term_monthsintYesThe repayment term in months as an integer. Example: term=12.
discountdecimalOptionalCash incentives or discounts applied to the vehicle price.
sales_tax_ratedecimalOptionalThe sales tax rate as a percentage.
down_paymentdecimalOptionalThe down payment amount.
other_feesdecimalOptionalOther fees associated with the loan.
trade_in_valuedecimalOptionalThe value of a vehicle traded in.
currencystringOptionalThe desired currency for the response. Defaults to “USD“.

/auto

HTTP Request Example:
GET /auto?price=10000&rate=5.5&term_months=12&discount=1000&sales_tax_rate=5.0&currency=USDHTTP/1.1 
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com

/auto

HTTP Request Example:
POST /auto HTTP/1.1 
Content-Type: application/json
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com
Content-Length: 115
{
"price": 100000,
"rate": 5.5,
"term_months": 12,
"sales_tax_rate": 8.5,
"discount": 1000.0,
"down_payment": 10000.0,
"other_fees": 500.0,
"trade_in_value": 2500.0,
"currency": "CAD"
}
JSON Response:
{
"loan_amount": "$XXX,XXX.XX",
"interest_rate": "X.XX%",
"term_months": XX,
"upfront_pay": "$XXX,XXX.XX",
"sales_tax": "$XXX,XXX.XX",
"monthly_payment": "$XXX.XX",
"total_monthly_payments": "$XXX,XXX.XX",
"total_interest": "$XXX,XXX.XX",
"amortization_schedule": [
{
"month": X,
"payment": "$XXX.XX",
"principal_payment": "$XXX.XX",
"interest_payment": "$XXX.XX",
"remaining_balance": "$XXX,XXX.XX"
},
// Additional entries for each month
],
"total_loan_cost": "$XXX,XXX.XX"
}

Calculate Mortgage

The Mortgage Calculator endpoint allows users to calculate mortgage-related values and generate amortization schedules. It supports various amortization frequencies, including monthly, semi-monthly, bi-weekly, and weekly

Parameters

Parameter Type Required Description
amount decimal Yes The loan amount as a float. Example: price=10000.
rate decimal Yes The annual interest rate as a float. Example: rate=5.5.
term_years int Yes The repayment term in years as an integer. Example: term=3.
frequency string Optional The frequency of amortization. Valid options: “monthly” (default), “semi-monthly“, “bi-weekly“, “weekly“.
down_payment decimal Optional The down payment amount.
currency string Optional The desired currency for the response. Defaults to “USD“.

/mortgage

HTTP Request Example:
GET /mortgage?amount=10000&rate=5.5&term_years=2&frequency=monthly&down_payment=500.0&currency=USDHTTP/1.1 
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com

/mortgage

HTTP Request Example:
POST /mortgage HTTP/1.1 
Content-Type: application/json
X-Rapidapi-Key: SIGN-UP-FOR-KEY
X-Rapidapi-Host: calcx-loan-calculator.p.rapidapi.com
Host: calcx-loan-calculator.p.rapidapi.com
Content-Length: 115
{
"amount": 100000,
"rate": 5.5,
"term_years": 12,
"down_payment": 10000.0,
"frequency": "monthly",
"currency": "CAD"
}
JSON Response:
{
"loan_amount": "$XXX,XXX.XX",
"interest_rate": "X.XX%",
"term_months": XX,
"upfront_pay": "$XXX,XXX.XX",
"sales_tax": "$XXX,XXX.XX",
"monthly_payment": "$XXX.XX",
"total_monthly_payments": "$XXX,XXX.XX",
"total_interest": "$XXX,XXX.XX",
"amortization_schedule": [
{
"month": X,
"payment": "$XXX.XX",
"principal_payment": "$XXX.XX",
"interest_payment": "$XXX.XX",
"remaining_balance": "$XXX,XXX.XX"
},
// Additional entries for each month
],
"total_loan_cost": "$XXX,XXX.XX"
}

API Support

If you have any questions or issues with our API, please don’t hesitate to contact us!