This service has RESTful API that allows to automate your tasks. To shorten an url pass it as a GET or POST parameter to https://clck.ru/--, e.g.:

$ curl https://clck.ru/--?url=http://b23.ru

or:

>>> url = 'http://bit.ly'
>>> import urllib2
>>> fetcher = urllib2.urlopen(
      'https://clck.ru/--?url='+
      url)
>>> fetcher.read()
'https://clck.ru/8JM'

or even:

<?=file_get_contents("https://clck.ru/--?url=http://b23.ru");?>

Additional examples by Igor Yevsukov:

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSString *address = @"https://clck.ru/";
    NSString *urlString = \
            [NSString stringWithFormat:@"https://clck.ru/--?url= %@",address];
    NSURL *url = [NSURL URLWithString:urlString];
    NSString *adr = [NSString stringWithContentsOfURL:url];
    
    NSLog(adr);
    
    [pool drain];
    return 0;
}


require 'open-uri'
open("https://clck.ru/--?url= "+"https://clck.ru/").read
 => https://clck.ru/5U


Return to manual URL shortening