This calculation is the approximate calculation of the maximum loan for the housing which will vary depending on your annual income and borrowing power. Basically, the maximum loan will be 35% of the total income.
Details are shown below.
http://api.key-ative.com/loan-calculators/borrowing-power-calculator/v1
monthly_income - Monthly Income
debt_burden - Debt Burden
interest_rate - Interest Rate per Year.
year - Duration.
My API will return loan repayment data in JSON format. Here's is sample.
{
"borrowing_power":2477545.50671,
"monthly_repayment":13300,
"remark":"The maximum loan will be 35% of the total income",
"servertime":"Tue, 11 Aug 15 11:31:04 +0700",
"error":false,
"status":200
}
borrowing_power - Borrowing Power
monthly_repayment - Monthly Repayment
remark - Remark
servertime - Execute time on server
error - Error status (true/false)
status - HTTP Status code
$curl "api.key-ative.com/loan-calculators/borrowing-power-calculator/v1?monthly_income=43000&debt_burden=5000&interest_rate=5&year=30"
{
"borrowing_power":2477545.50671,
"monthly_repayment":13300,
"remark":"The maximum loan will be 35% of the total income",
"servertime":"Tue, 11 Aug 15 11:31:04 +0700",
"error":false,
"status":200
}
Here's a jQuery example.
$.get("http://api.key-ative.com/loan-calculators/borrowing-power-calculator/v1",
{monthly_income:43000,debt_burden:5000,interest_rate:5,year:30},
function( data ) {
console.log(data);
},"json");
Here's a PHP code example.
Option 1
$url = "http://api.key-ative.com/loan-calculators/borrowing-power-calculator/v1?monthly_income=43000&debt_burden=5000&interest_rate=5&year=30";
$json = file_get_contents($url);
if($json){
$data = json_decode($json);
var_dump($data);
}
Option 2
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://api.key-ative.com/loan-calculators/borrowing-power-calculator/v1");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"monthly_income=43000&debt_burden=5000&interest_rate=5&year=30");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec ($ch);
curl_close ($ch);
$data = json_decode($json);
var_dump($data)