mrte.ch: link shortener api
Features
- Generate or get existing short URLs, with sequential or custom keyword
- Get some statistics about your links: top clicked links, least clicked links, newest links
- Output format: JSON, XML, or simple raw text
Usage
You need to send parameters to http://api.mrte.ch/go.php either via GET or POST. These parameters are:
WordPress/Twitter Plugin also available, should work with no id/pw: YOURLS: WordPress to Twitter
Sample linkhttp://api.mrte.ch/go.php?action=shorturl&url=http://www.mrtech.com/&format=json
- The requested
action: "shorturl" (get short URL for a link), "expand" (get long URL of a shorturl) or "stats" (get stats about your links) - With action = "shorturl" :
- the
urlto shorten - optional
keywordfor custom short URLs - output
format: either "json", "xml" or "simple" (default=xml)
- the
- With action = "expand" :
- the
shorturlto expand (can be either 'abc' or 'http://site/abc') - output
format: either "json", "xml" or "simple"
- the
- With action = "stats" :
- the
filter: either "top", "bottom" or "last" - the
limit(maximum number of links to return) - output
format: either "json" or "xml"
- the
Sample return
XML<result> <url> <id>62019439011</id> <keyword>shorter</keyword> <url>http://somereallylongurlyouneedtoshrink.com/</url> <date>2009-06-23 18:08:07</date> <ip>127.0.0.1</ip> </url> <status>success</status> <message>http://somereallylongurlyouneedtoshrink.com/ (ID: shorter) added to database</message> <shorturl>http://yoursite.com/shorter</shorturl> </result>JSON
{
status: "fail"
code: "error:url"
message: "http://www.mrtech.com/ already exists in database"
shorturl: http://mrte.ch/2
statusCode: 200
}
Provided by:
YOURLS: Your Own URL Shortener