Goo.gl API: PHP Shorten URL using googles URL shortening service

Share

goo.gl

Looking for PHP api to make url shortened using goo.gl? Here is the solution..

http://Goo.gl PHP API to shorten your URL..



Just get Google API key form http://code.google.com/apis/console/ and use it in the code below. That’s it. You will have your URL entered in line 1 shortened in last echo statement in the code below. 🙂

Goo.gl API: PHP

Below is the video explaining how you can get goo.gl api key.

Or, please login using google or facebook and create a forum topic to get your query answered in few hours here http://www.learn-drupal.in/forums/forum/drupal-forum-post-installation

https://goo.gl/

Follow me

Sachin Wable

Sachin Wable is a technical blogger. He is blogging since 2010 & writes about Blogging, affiliate marketing & technical stuff. His blog learn-drupal.in receives 22,500 page views and visits from 1934 cities from 135 countries per year. (As per last years google analytics report.)
Follow me

Latest posts by Sachin Wable (see all)

Sharing is cool...Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
affiliate_link

4,974 views

7 comments

  1. Alex says:

    Awesome! Thanks for the post.

  2. Norman says:

    Works like a charm! You are great!

  3. Flavio Carvalho says:

    I Keep getting the error

    Notice: Undefined property: stdClass::$id in C:\xampp\htdocs\URL Shortner.php on line 26
    Shortened URL ->

    The API Key is OK, I dont know how to fix it.

    • Sachin Wable says:

      Hi Flavio,

      Have you tried copying same code and changing only API key as I have shown in video? If yes, it should work. I can see you are trying to run on local machine. Make sure you have curl enabled on your local server or try executing script on some hosting where we ideally have curl enabled. 🙂

      Sachin

  4. José says:

    Everything is fine thanks
    now as consulting statistics Short URL?

Leave a Reply

Your email address will not be published. Required fields are marked *