Google Adds API For URL Shortener and Link Analytics

Romin Irani, January 11th, 2011

Google URL ShortenerOur API report for 2010 listed 25 URL Shorteners in our directory (there are now 28 URL shorteners). One of the better known link shrinkers in recent times, Goo.gl, has just given developers a New Years gift by providing an API. The Google URL Shortener API allows developers to integrate the Goo.gl service into their application and gives access to all operations like shortening and expanding URLs and giving access to your history and analytics.

Google’s Ben D’Angelo announced the API at the Google code blog and developers can now integrate the service into their applications that need to send across short URLs for sharing content. By providing access to the analytics via the API, applications could even monitor the usage statistics and traffic patterns.

The API documentation page can get you started with the API. The API is REST based and JSON only. It is interesting to note that every request may include an API Key and an Auth Token. The URL Shortener has a very generous rate limit, joining the million daily queries club. You can get yourself an API Key via the API Console. The Auth Token is required when you perform the actions on behalf of a Google User. The Auth Token can be obtained typically via OAuth.

To get up and running with the API, visit the Getting Started section that takes you through the basic operations like shortening/expanding a URL, looking up short URL’s analytics and looking up a user’s history. An example POST request for shortening http://www.programmable.web is given below:

POST https://www.googleapis.com/urlshortener/v1/url

With the following JSON request : {“longURL”: “http://www.programmableweb.com”}

If all goes well, , you get the following JSON response back:

{
"kind": "urlshortener#url",
"id": "http://goo.gl/NE2Mj",
"longUrl": "http://www.programmableweb.com”
}

If you have already integrated an existing URL Shortener API into your application, this news might not be exciting but for developers looking to integrate one, this is an excellent and easy to use option out there, along with basic analytics data also available via the API.

One of the concerns around URL shorteners has been malicious content being camouflaged under a short URL. One of the enhancements that is likely to come in later versions of the Goo.gl API is to make the auto-detection of spam or malicious content more robust. It will be interesting to see how well it does that. The URL Shortener space has seen a lot of activity in the last year and these services are vying with each other to become the de facto service. Platforms like Twitter are employing their own shortening service to manage the links and control the analytics data. This space should see interesting times this year.

Both comments and pings are currently closed.

3 Responses to “Google Adds API For URL Shortener and Link Analytics”

January 11th, 2011
at 9:21 am
Comment by: Tweets that mention Google Adds API For URL Shortener and Link Analytics -- Topsy.com

[...] This post was mentioned on Twitter by Web Based Apps. Web Based Apps said: Google Adds API For URL Shortener and Link Analytics http://bit.ly/g3et33 [...]

February 12th, 2011
at 10:34 pm
Comment by: API Technology – Basic Auth | API Evangelist

[...] Google Adds API For URL Shortener and Link Analytics (programmableweb.com) [...]

February 16th, 2011
at 6:59 am
Comment by: URLS Are For Tracking, Cookies Are For Eating | V3 Kansas City Integrated Marketing and Social Media Agency

[...] recently rolled out its own URL shortener, goo.gl which allows developers to integrate the service into their applications. It [...]

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.