API & Tools

This page uses default free API token intended for guest users. This API token is free to use and without ads. If you are already registered, you will need to login to use your own API token. API/tools on this page are recommended for testing purpose only.

 

For developers iya.io 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://iya.io/api?api=9e334c30fe2b1b080135b46ed0b682103488843c&url=yourdestinationlink.com&alias=CustomAlias

You will get a JSON response like the following

{"status":"success","shortenedUrl":""https:\/\/iya.io\/xxxxx""}

If you want a TEXT response 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://iya.io/api?api=9e334c30fe2b1b080135b46ed0b682103488843c&url=yourdestinationlink.com&alias=CustomAlias&format=text

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

&type=0

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 = '9e334c30fe2b1b080135b46ed0b682103488843c';
$api_url = "https://iya.io/api?api={$api_token}&url={$long_url}&alias=CustomAlias";
$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 = '9e334c30fe2b1b080135b46ed0b682103488843c';
$api_url = "https://iya.io/api?api={$api_token}&url={$long_url}&alias=CustomAlias&format=text";
$result = @file_get_contents($api_url);
if( $result ){
 echo $result;
}

 

If you have a website with 100's or 1000's of links you want to change over to iya.io 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 iyaio_url = 'https://iya.io/';
            var iyaio_api_token = '9e334c30fe2b1b080135b46ed0b682103488843c';
            var iyaio_advert = 0;
            var iyaio_domains = ['depositfiles.com', 'uploading.com', 'uploadable.ch'];
        </script>
        <script src='//iya.io/js/full-page-script.js'></script>
        

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

        <script type="text/javascript">
            var iyaio_url = 'https://iya.io/';
            var iyaio_api_token = '9e334c30fe2b1b080135b46ed0b682103488843c';
            var iyaio_advert = 0;
            var iyaio_exclude_domains = ['example.com', 'yoursite.com'];
        </script>
        <script src='//iya.io/js/full-page-script.js'></script>
        

 

Short links more easily. Click and drag the following link to your links toolbar.

Shorten!

Once this is on your toolbar, you'll be able to make a short link at the click of a button.

This is compatible with most web browsers and platforms as long as your bookmarks or favorites allow javascript. The links toolbar may not be visible in all setups and in most browsers, you can enable it in the View->Toolbars menu of your web browser. You can also put it in your bookmarks instead of the links toolbar.

 

Everyone can use the shortest way to shorten links with iya.io.

Just copy the link below to address bar into your web browser, change last part to destination link and press ENTER. iya.io will redirect you to your shortened link.

https://iya.io/st?api=9e334c30fe2b1b080135b46ed0b682103488843c&url=yourdestinationlink.com