So long, and thanks for all the fish
kl.am's API uses a simple REST interface.
Endpoint: http://kl.am/api/
Parameters:
url - URL-encoded stringformat - json or text (optional, defaults to json)api_key - API key can be found under your account settings (optional, allows you to create a link under your kl.am account)tags - URL-encoded list of tags separated by a space (optional, only applied when authenticating with your API key)utm_source - Campaign source for Google Analytics (optional)utm_medium - Campaign medium for Google Analytics (optional)utm_campaign - Campaign name for Google Analytics (optional)Returns:
short_url - Full kl.am URLdestination - Destination URLstats_url - kl.am stats page URL for the shortened linkExamples:
http://kl.am/api/shorten/?url=http%3A%2F%2Fgoogle.com
http://kl.am/api/shorten/?url=http%3A%2F%2Fgoogle.com&api_key=aaaaa&tags=tag1+tag2&utm_source=Twitter
Returns JSON-encoded object:
short_url => http://kl.am/2destination => http://google.comstats_url => http://kl.am/stats/2Returns:
short_url - Full kl.am URLExample:
http://kl.am/api/shorten/?url=http%3A%2F%2Fgoogle.com&format=text
Returns:
http://kl.am/2
This method is in beta and may change without warning
Parameters:
short - Full kl.am URL or keygroup - domain or url (optional, defaults to domain)Returns:
clicks - Number of total clicksreferrers - Array of referrer click counts, sorted from highest to lowest with direct click count listed lastExample:
http://kl.am/api/stats/?short=2 or
http://kl.am/api/stats/?short=http%3A%2F%2Fkl.am%2F2
Returns JSON-encoded object:
clicks => 342referrers =>
[0] =>
referrer => googleblog.blogspot.comclicks => 202[1] =>
referrer => www.mattcutts.comclicks => 50[2] =>
referrer => directclicks => 90