Using Shortener Link`s API And Make Money With It: Generate Automatic Shorte.st Link

Shorte.st created a link shortener connected with advertising network so we get paid when we shorten a link and make someone click on it. Easy way to earn extra money.


So, if you are a blogger, have website and traffic, now time to convert your valuable traffic to money. Shorte.st pay for it. When a link shortened, when clicked it will go to a page that contains ads for wait 5 second, then visitor will click Skip For This Ads, to go to real link.


#ref-menu

For developers Shorte.st prepared API which returns responses in JSON format. Currently there is one method which can be used to shorten links on behalf of your account.

Just sign up here, then go to Link Tools / Developer API.

curl -H "public-api-token: YOUR_TOKEN" -X PUT -d "urlToShorten=google.com" https://api.shorte.st/v1/data/url


Retun in JSON format

{"status":"ok","shortenedUrl":"http:\/\/sh.st\/XXXX"}

Now, we`re going to interpret that using CURL in php. Note, that if CURL going to a https link, we must add below pieces code, OR no return will appear.

{"status":"ok","shortenedUrl":"http:\/\/sh.st\/XXXX"}
<?php 
function shst($url){
$apiurl="https://api.shorte.st/v1/data/url";
$ch = curl_init();

curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT' );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('public-api-token: YOUR_TOKEN_HERE','X-HTTP-Method-Override: PUT')); curl_setopt($ch, CURLOPT_POSTFIELDS, "urlToShorten=".$url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $data = curl_exec($ch); curl_close($ch); $obj = json_decode($data); $ret=$obj->{'shortenedUrl'}; return $ret; } echo shst('http://dunia21.net/ouija-seance-the-final-game-2018/');

Above function will return
http://destyy.com/wJYYfB

Demo here, hit blue button.

Share to

Do You Know!