Русская версия English version


API of short URL service is very simple. You need to make a GET-request in order to use it:

The request parameters mean the following:

Required parameters which must be in every request: a=api and link=[long URL].

If you send correct request, you receive short URL like:

If you send wrong request (for example, long URL is missing), you receive the error description (in UTF8 encoding). It always starts with «Error». For example:

Error: Long URL is incorrect.

PHP example:

$pos=strpos($res,'Error: ');
if ($res=='' || $pos!==false && $pos==0) echo 'The error is occurred. '.$res;
else echo 'Short URL: '.$res;

Perl example:

use LWP::UserAgent;
use URI::Escape
my $ua = LWP::UserAgent->new;
my $response=$ua->get(''.uri_escape(''));
my $res=$response->content;
if ($res eq '' || $res=~/^Error: /) { print 'The error is occurred. '.$res; }
else { print 'Short URL: '.$res; }

Attention! If you send a lot of requests from one IP, it can be blocked. If you plan to add more then 100 URLs in one hour, please let the technical support know. Otherwise your IP can be blocked unexpectedly. Prior added URLs can be deleted.