Borrowing power calculator


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.

Monthly Income :
Baht
Debt Burden :
Baht
Interest Rate :
%
Duration of Loan :
Years

Calculation result

You could borrow up to
-
Monthly repayments
-
*Remarks: The calculation result is the approximate result

WEBSERVICE

Details are shown below.

URL


http://api.key-ative.com/loan-calculators/borrowing-power-calculator/v1
        		

PARAMETERS


 monthly_income - Monthly Income
 debt_burden - Debt Burden
 interest_rate - Interest Rate per Year.
 year - Duration.
        		

RESPONSE

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
        		

Try the JSON API from the command line


$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
}
        		

jQuery

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");
        		

PHP Code

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)