Linker.Click API
Requests
- All requests, GET or POST, must include a valid URL for case sensitive param url . Valid means valid protocol, no HTML.
Example Requests
- http://linker.click/api.php?url=http://www.example.com/some-long-article-name.html
- http://linker.click/api.php?url=invalid-url.c
Responses
- All responses are UTF-8 encoded.
- Returns a URL or the string you passed as url if it is not proccessed.
Example Responses
- http://linker.click/xcode
- invalid-url.c
Sample codes
PHP
1. Basicfunction 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. Advancedfunction 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.