PHP: Google URL Shortener API Tutorial with Examples

Google has released the Google URL Shortener API. This means that you can make use of this service in your websites, clients and programs. What this means to the developer is that he can access the Google URL shortener service through REST calls in his programs.

The API is released as a web service. The API can be accessed using REST calls. There are mainly three functions

  1. Shorten: Used to shorten a long URL
  2. Expand: Used to expand a shortener URL
  3. Analytics: Get the details of the shortened URL like how many people clicked the shortened URL and from where

There are two ways by which you can access the service

  1. With Key
  2. Without Key

If you have a key, you can be able to make a large number of URL shortener calls. You can also perform without the key. This tutorail explains both the methods of accessing the service.

  1. Without Key
    1. Shorten
    2. Expand
    3. Analytics
  2. With Authorization Key
    1. Shorten URL
    2. URL Expansion
    3. Shortened URL Analytics

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s