API & Developers

It returns a ShortURL. Copy it to the clipboard, and paste it into the address bar of your browser. it should take you to the home page of my weblog. Apparently it works for any URL you give it. And of course you can call it from a script just as easily as you click a link in a browser. Very nice!

Straight to the point, here's what you need:

Required parameter: api_key (obviously), api_password (obviously), api_version (obviously), url_array (obviously).

RESPONSE - JSON Response with single or multiple url.

Concurrent API Request Limits

The following table lists the limits for various types for concurrent requests (calls).

Type Limit
Overall Number of API call's allow 10000
Number of URL's allow per call 100
Number of call allow per day 100


Limits are enforced against the aggregate of all API calls made by the organization in a 24 hour period; limits are not on a per-user basis. When an organization exceeds a limit, all users in the organization may be temporarily blocked from making additional calls. Calls will be blocked until usage for the preceding 24 hours drops below the limit.

If you're unsure how to use this, here's a little function in PHP you can use to get started:

ShortURL API PHP Function

<?php
function ShortURL($api_key, $api_password, $api_version, $url_array){
	$curl_url = 'http://ucut.it/api/v1/create_url/index.php';
	
	$curl_parameters = array(
		api_key => $api_key, 
		api_password => $api_password, 
		api_version => $api_version,
		url => $url_array
	);
	
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $curl_url);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query( $curl_parameters ));
	$data = curl_exec($ch);
	curl_close($ch);
	return $data;
}
?>

Sample usage

<?php
$api_key = "xxxxxx"; # API Key;
$api_password = "xxxxxx"; # API Password;
$api_version = "1"; # Default version 1;

# Single URL Shorten Step
$url_array = array('http://www.google.com');

# Multiple URL Shorten Step
$url_array = array('http://www.google.com','http://www.yahoo.com', 
'http://www.yahoo1.com', 'http://www.yahoo2.com', 'http://www.yahoo3.com'); $short_url = ShortURL($api_key, $api_password, $api_version, $url_array);
# Return responce in jSON echo $short_url; ?>

Sample JSON Response

{
    "request_date_time": "Mon Sep 09 12:20:41 +0000 2013",
    "response": [{
        "http:\/\/www.google.com": "http:\/\/ucut.it\/7wh9rs"
    }, {
        "http:\/\/www.yahoo.com": "http:\/\/ucut.it\/8fh7vc"
    }, {
        "http:\/\/www.yahoo1.com": "http:\/\/ucut.it\/zvkts0"
    }, {
        "http:\/\/www.yahoo2.com": "http:\/\/ucut.it\/t6f65j"
    }, {
        "http:\/\/www.yahoo3.com": "http:\/\/ucut.it\/6yj3dp"
    }]
}

Enjoy!