Linker.Click API

Requests

Example Requests

  1. http://linker.click/api.php?url=http://www.example.com/some-long-article-name.html
  2. http://linker.click/api.php?url=invalid-url.c

Responses

Example Responses

  1. http://linker.click/xcode
  2. invalid-url.c

Sample codes

PHP

1. Basic
function myUrl($myurl){
	$url = "http://linker.click/api.php?url=$myurl";
	$response = file_get_contents($url);
	return $response;
}

echo myUrl('http://www.google.com');

It will write http://linker.click/1

2. Advanced
function parseMyUrl($myurl,$urllength){
	if(strlen($myurl)>$urllength){
		$myurl=myUrl($myurl);
	}
	return $myurl;
}

function myUrl($myurl){
	$url = "http://linker.click/api.php?url=$myurl";
	$response = file_get_contents($url);
	return $response;
}

$max_length=24;
$theUrl="http://www.google.com";

echo  parseMyUrl($theUrl,$max_length);

It will write http://www.google.com.

The function checks whether the URL has over 24 chars.
If it has over 24 chars it gets a short URL.
If it has less it gets the same URL because there is no benefit in a short URL.

Be Polite, Please!

Use good judgment when designing your application. Don't make repeated requests for the same data frequently.

We monitor API usage, and we may block applications that do silly things. Use good judgment to keep your application running smoothly!

Remember Terms

Using it for spamming or illegal purposes is forbidden.

This service is provided without warranty of any kind.