RT.nu provides a simple REST/json interface for shortening URLS and retrieving basic stats. The official RT.nu API url is: http://rt.nu/api/
{
"error" : false,
"error_message" : null,
"response" : "http://rt.nu/vt6x"
}
{ "error" : false,
"error_message" : null,
"response" : "http://www.omnipotent.net/jquery.sparkline/#who"
}
This method returns the total number of clicks for the url specified by [short]
{ "error" : false,
"error_message" : null,
"response" : "25"
}
This method returns the total number of shortened urls (total) and where the current url ranks based on total clicks
{
"error" : false,
"error_message" : null,
"response" :
{
"rank" : "27",
"total" : "98"
}
}
This method returns an array containing the total number of clicks per hour this url has received.
{
"error" : false,
"error_message" : null,
"response" : [
{ "0" : "45",
"1" : "2009-05-05",
"2" : "7",
"date" : "2009-05-05",
"hour" : "7",
"redirects" : "45"
},
{ "0" : "37",
"1" : "2009-05-05",
"2" : "8",
"date" : "2009-05-05",
"hour" : "8",
"redirects" : "37"
},
{ "0" : "2",
"1" : "2009-05-05",
"2" : "9",
"date" : "2009-05-05",
"hour" : "9",
"redirects" : "2"
}
]
}
Returns the distinct referring urls and the number of times it referred a visitor.
{
"error" : false,
"error_message" : null,
"response" : [
{ "0" : "No Referrer",
"1" : "24",
"referrals" : "24",
"referrer" : "No Referrer"
},
{ "0" : "http://twitter.com/",
"1" : "2",
"referrals" : "2",
"referrer" : "http://twitter.com/"
},
{ "0" : "http://powertwitter.me/",
"1" : "1",
"referrals" : "1",
"referrer" : "http://powertwitter.me/"
}
]
}
{
"error" : false,
"error_message" : null,
"response" : [ { "0" : "http://mdog02.deviantart.com/art/Experiences-58166534",
"1" : "bd_j",
"2" : "2009-04-30 15:30:27",
"date_created" : "2009-04-30 15:30:27",
"original" : "http://mdog02.deviantart.com/art/Experiences-58166534",
"short" : "bd_j"
},
{ "0" : "http://elbelbelb2000.blogtog.com/",
"1" : "2aah",
"2" : "2009-04-30 14:57:19",
"date_created" : "2009-04-30 14:57:19",
"original" : "http://elbelbelb2000.blogtog.com/",
"short" : "2aah"
},
{ "0" : "http://google.com/",
"1" : "q3hz",
"2" : "2009-04-30 14:47:46",
"date_created" : "2009-04-30 14:47:46",
"original" : "http://google.com/",
"short" : "q3hz"
}
]
}
{
"error" : false,
"error_message" : null,
"response" : [ { "0" : "1",
"1" : "2009-04-30",
"2" : "13",
"date" : "2009-04-30",
"hour" : "13",
"urls" : "1"
},
{ "0" : "42",
"1" : "2009-04-30",
"2" : "14",
"date" : "2009-04-30",
"hour" : "14",
"urls" : "42"
}
]
}
{
"error" : false,
"error_message" : null,
"response" : [ { "0" : "1",
"1" : "2009-04-30",
"2" : "13",
"date" : "2009-04-30",
"hour" : "13",
"redirects" : "1"
},
{ "0" : "42",
"1" : "2009-04-30",
"2" : "14",
"date" : "2009-04-30",
"hour" : "14",
"redirects" : "42"
}
]
}
{
"error" : false,
"error_message" : null,
"response" : [ { "0" : "rt.nu",
"1" : "6",
"host" : "rt.nu",
"urls" : "6"
},
{ "0" : "google.com",
"1" : "4",
"host" : "google.com",
"urls" : "4"
},
{ "0" : "www.yahoo.com",
"1" : "2",
"host" : "www.yahoo.com",
"urls" : "2"
}
...
]
}