shlink URL Shortener

 

History

Not implemented yet.

API

http://shlk.eu/api.php?parameters

Request parameters

  • url: (required) To be truncated URL starting with http://, https:// or ftp://
  • format: (optional)
    • plain (default) Indicates that the output should be as plain text. It will only output the URL or an error text.
    • json (recommended) Indicates output as JSON (JavaScript Object Notation) is to take place. There are status(true), longurl, shortid, shorturl or in case of error status(false), longurl und text
  • callback: (optional)

Example PHP

$shortenedurl = file_get_contents('http://shlk.eu/api.php?url=http://google.com/');

Example Javascript

      $.getJSON('http://shlk.eu/api.php?callback=?', {
    url: 'http://google.com/',
    format: 'json'
}, function (res) {
    if (res.status === true) {
        console.log(res.shorturl);
    }
});