Google URL Shortener PHP Class Updates

Hello, i`m happy because my PHP class which i have wrote about it earlier was the first script about “ url shortener serves” on website, and i have received that two websites included the class in there database of scripts.

the first is and the second is i want to say thank you for both of them.


  • i have updated the class to version 0.2 so now you can get the analytics about the short url when you try to get the long one by sending true as second argument in get_long() function as get_long(“”,true) the default value is false.

you can get the latest version of the class on, feed back will be appreciated.

Update 13-10-2011:

blog post has been published  “Google URL Shortener PHP Class” was approved for publication on PHPClasess Blog check it out

Update 2:

another developer Rafael made some changes on the class to be more like CI [CodeIgniter] patterns on GitHub

Google URL Shortener PHP Class

The day Google announced that shorten URL serves got an API i created a PHP Class to handle the connection with the API.

Finaly my class got approved from and you can get it from the website on that link.

Main Features:

  1. Shorten or expand the urls with googl shorten url serves
  2. no need to know JSON the request send as string and get the result as php array
  3. could be easily implemented

Future work:

  • will add short URL’s analytics & user’s history

you can download the class form Download Here test it and give me feed back

Check the new updates on