Short URL API

Short Url Free Api 

 

Test Demo Account 

Login

Username: member@htt.nu

Password: 12345

Quick Link

Your API token: 732c4c98076c09549ad9e1b9547672aab422be85

Everyone can use the shortest way to shorten links with Unlimited URL Shortener.

Just copy the link below to address bar into your web browser, change last part to destination link and press ENTER. Unlimited URL Shortener will redirect you to your shortened link. Copy it wherever you want and get paid.

 

https://htt.nu/st/?api=732c4c98076c09549ad9e1b9547672aab422be85&url=www.htt.nu


Full Page Script

 

If you have a website with 100's or 1000's of links you want to change over to Unlimited URL Shortener then please use the script below.

Simply copy-and-paste the code below on to your webpage or blog and the links will be updated automatically!

You can add or remove any domains for the code that you use on your website.

 

 <script type="text/javascript">
            var mighty_url = 'https://htt.nu/';
            var mighty_api_token = '732c4c98076c09549ad9e1b9547672aab422be85';
            var mighty_type = 1;
            var mighty_domains = ['depositfiles.com', 'uploading.com', 'uploadable.ch'];
        </script>
        <script src='//htt.nu/js/full-page-script.js'></script>
        

 

Or if you wish to change every link to Unlimited URL Shortener on your website (without stating exactly which domains) please use the following code.

<script type="text/javascript">
            var mighty_url = 'https://htt.nu/';
            var mighty_api_token = '732c4c98076c09549ad9e1b9547672aab422be85';
            var mighty_type = 1;
            var mighty_exclude_domains = ['example.com', 'yoursite.com'];
        </script>
        <script src='//htt.nu/js/full-page-script.js'></script>
        

 

If you want to use Full Page Script with the banner advertising replace this code

var mighty_type = 1;
var mighty_type = 2;

Developers API

For developers Unlimited URL Shortener prepared API which returns responses in JSON or TEXT formats.

Currently there is one method which can be used to shorten links on behalf of your account.

All you have to do is to send a GET request with your API token and URL Like the following:

https://htt.nu/api/?api=732c4c98076c09549ad9e1b9547672aab422be85&url=yourdestinationlink.com&alias=CustomAlias

You will get a JSON reposnse like the following

{"status":"success","shortenedUrl":""https:\/\/htt.nu\/xxxxx""}

If you want a TEXT reposnse just add &format=text at the end of your request as the below example. This will return just the short link. Note that if an error occurs, it will not output anything.

https://htt.nu/api/?api=732c4c98076c09549ad9e1b9547672aab422be85&url=yourdestinationlink.com&alias=CustomAlias&format=text

If you want to use developers API with the banner advertising add the below code to the end of the URL

&type=2

 


 

I  Note

api & url are required fields and the other fields like alias, format & type are optional.

 

That's it :)

Using the API in PHP

To use the API in your PHP application, you need to send a GET request via file_get_contents or cURL. Please check the below sample examples using file_get_contents

Using JSON Response

$long_url = urlencode('yourdestinationlink.com');
$api_token = '732c4c98076c09549ad9e1b9547672aab422be85';
$alias = urlencode('CustomAlias');
$api_url = "https://htt.nu/api?api={$api_token}&url={$long_url}&alias={$alias}";
$result = @json_decode(file_get_contents($api_url),TRUE);
if($result["status"] === 'error') {
 echo $result["message"];
} else {
 echo $result["shortenedUrl"];
}

 

 

Using Plain Text Response

$long_url = urlencode('yourdestinationlink.com');
$api_token = '732c4c98076c09549ad9e1b9547672aab422be85';
$alias = urlencode('CustomAlias');
$api_url = "https://htt.nu/api?api={$api_token}&url={$long_url}&alias={$alias}&format=text";
$result = @file_get_contents($api_url);
if( $result ){
 echo $result;
}


Published on: 4/28/18, 6:48 AM