عربي
Untiny Logo

Intro to Untiny API v1.0

An Application Programming Interface (API) is created for Untiny to help web developers and programmers to benefit from Untiny services. The current version for the API is 1.0 and it includes the following services:

-Extract Service which retrieves the original URLs form tiny ones.
-Services Service which lists the tiny services that are supported by Untiny.

To make it easy to develop addons for programmers, Untiny API is available in three formats:

- The result as Plain Text
- The result as XML format
- The result as JSON format (for javascript)

and it will be available in a PHP - Serialized format soon.

The API also covers the possible errors that can occur during the extract service. To take a general idea about the errors and their numbers, they are explained as follows:

error 0: Invalid URL
error 1: Unsupported service
error 2: Connection to service failed
error 3: Unable to get the original URL


To see more details about each service, click on the service link at the sidebar.

Note: You can use the API services with any of Untiny domains, which are:

Untiny Logo

Extract Service

Extract service used to retrieve the original URL. It is available at:

http://untiny.me/api/1.0/extract

To retrieve the original URL from a tiny one like http://tiny.pl/htk, appended the tiny URL to the extract service as:

The default format of the result is XML format.

You can choose another format by the 'format' variable appended to the service URL. The avaialbe formats for extract service are: XML(default), JSON and plain text.

-An example to extract in plain text format:

The result will be:

http://www.google.com


-An example to extract in XML format:

The result will be:

<?xml version="1.0"?>
<response>
   <org_url>http://www.google.com</org_url>
</response>

Note that org_url denotes Original URL.

-An example to extract in JSON format:

The result will be:

{"org_url":"http:\/\/www.google.com"}



Errors
In case errors occur in the extracting process, the API will show the error and the error number in the requested format. For more information about the errors and errors numbers, please refer to the API introduction page.

-Example of error in plain text format:

error(0): Invalid URL


-Example of error in XML format:

<response>
   <error num="0">Invalid URL</error>
</response>


-Example of error in JSON format

{"error":["0","Invalid URL"]}






Untiny Logo

Services Service

Services service is a service to list the supported tiny services by Untiny. It is available at:

The result is available in the following formats: XML(default), JSON and plain text.
You can use the 'format' variable to specify which format to use.

-An example to retrieve the result in plain text:

will return:

tiny.pl, tinyurl.com, is.gd, twurl.nl, bit.ly, ping.fm, snurl.com, snipr.com, snipurl.com, metamark.net, xrl.us, url.ie, wapurl.co.uk, url.co.uk, rubyurl.com, minilien.com, easyurl.net, yep.it, x.se


-An example to retrieve the result in XML format:

will return:

<?xml version="1.0"?>
<response>
   <services>
      <service>tiny.pl</service>
      <service>tinyurl.com</service>
      ...
      <service>x.se</service>
   </services>
</response>


-An example to retrieve the result in JSON format:

will return:

{"tiny.pl":"tiny.pl", "tinyurl.com":"tinyurl.com", ... , "x.se":"x.se"}






 Untiny on Untiny On Twitter Untiny Page On Facebook Untiny On LifeHacker Untiny On MakeUseOf Untiny On Delicious Untiny On Digg    Bookmark and Share