Google's URL Shortener API - the best?
Google's URL Shortener API - the best?
Tuesday, 18 January 2011

The Google URL shortening service has to offer something extra if it is to capture the ground currently occupied by existing services. The new API might go someway to this end but is it as good as it could be?




Google has a finger in every pie you could imagine and the announcement of its URL shortening service  back in October 2010 came as no surprise - more surprising was the fact that it didn't have an API. Now it does.

Google claim that they have the best URL shortening service because it's fast, reliable and integrated with Google Safe Browsing. It also collects statistics for your links and creates QR bar codes. The last two should be enough to encourage you to at least checkout the new API.



The first thing to say is that if you are a heavy short URL user then you will have to pay Google for the service. However at the moment the free usage is very generous at 1,000,000 queries/day. You can use it without an API key but then the usage limits are much lower. You also need the API key if  you want to see traffic reports. The Google API console can be used to manage key access. For some actions you also need an auth token.

The API is based on REST and very easy to use.  You simply send an https post request to the server with the URL to be shortened in the body in JSON format. As the request is encrypted it is reasonably secure. The response is JSON formatted.  If you use an API key then the use of the shortened link will be displayed in the dashboard. If you use an auth token then the short URL will be unique to that user and show statistics in their dashboard. That is if you want to shorten a URL for another user you need their auth token.

As well as the basic shortening service you can also request that a short URL be expanded so that you can check its status without actually visiting the site. You can also retrieve the analytics for a shortened URL so that you can construct your own graphs etc.

One disappointment is that the API doesn't provided a way to retrieve the QR barcode corresponding to the short URL. This is a shame as programmatic access to the barcode would have opened up a range of interesting possibilities.

Perhaps it will be in version 1.5 if we ask for it in sufficient numbers.

More Information

The URL shortener




Google Doodle For Boole 200

You might have guessed that Google would celebrate the 200th birthday of George Boole, the man who invented the logic that computers and programmers use, with a Doodle. This one is Boolean logic and a [ ... ]

Star Wars For Hour Of Code
16/11/2015 has again teamed up with Disney to create its new tutorial for the 2015 hour of Code. This time the theme, characters and soundtrack come from Star Wars - which should give it a wide appeal.

 [ ... ]

More News

Last Updated ( Tuesday, 18 January 2011 )

RSS feed of news items only
I Programmer News
Copyright © 2015 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.