API Documentation & Tools

This page uses default Cashperlink.com 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 Cash Per Link 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:


You will get a JSON response like the following


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.


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



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 = '321a11e7bb712fd6d570f0ed64d573cb075e61f0';
$api_url = "https://cashperlink.com/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 = '321a11e7bb712fd6d570f0ed64d573cb075e61f0';
$api_url = "https://cashperlink.com/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 adlinkfly_url = 'https://cashperlink.com/';
            var adlinkfly_api_token = '321a11e7bb712fd6d570f0ed64d573cb075e61f0';
            var adlinkfly_advert = 1;
            var adlinkfly_domains = ['depositfiles.com', 'uploading.com', 'uploadable.ch'];
        <script src='//cashperlink.com/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 adlinkfly_url = 'https://cashperlink.com/';
            var adlinkfly_api_token = '321a11e7bb712fd6d570f0ed64d573cb075e61f0';
            var adlinkfly_advert = 1;
            var adlinkfly_exclude_domains = ['example.com', 'yoursite.com'];
        <script src='//cashperlink.com/js/full-page-script.js'></script>


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


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 cashperlink.com.

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