Simple API

GET requests: https://keep.re/ajax/shorten_api.php?url=LONG-URL-HERE&custom=CUSTOM-NAME-FOR-THIS-URL

https://keep.re/f2

PHP Code

<?php // This is the URL you want to shorten

$longUrl = "https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onclick_addeventlistener";

$customn = '';

// Get cURL resource

$curl = curl_init();

// Set some options - we are passing in a useragent too here

curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://keep.re/ajax/shorten_api.php?url='.urlencode($longUrl).'&custom='.urlencode($custom), curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13') ));

$resp = curl_exec($curl);

// Close request to clear up some resources

curl_close($curl);

$response = $resp;

// Change the response json string to object

$json = json_decode($response);

echo 'url shortened:'.$json;

?>