Home / Ajax / Working with Facebook Graph API

Working with Facebook Graph API

Facebook Graph API is a user friendly tool which provides required data in JSON format. In this tutorial we are just going to use getJSON() method to fetch values from the end point URL.

We are going to use jQuery Ajax PHP’s Facebook page in this example. So lets proceed with the script

What we do is simply feed the end point URL to a variable say api, then pass this variable to getJSON method of jQuery. This method fetches the date generated from the end point URL and store in the object s. With this we can easily append required JSON objects into HTML elements.

You can check the JSON output of the url from the browser http://graph.facebook.com/smartcoding/ and choose which object to select. The mark is very easy to setup simply define <DIV> with appropriate classes as mentioned in the javascript and you are good to try the demo.

Thats it! I hope you find this tutorial helpful.

Download   Preview

About Ashik

I am a Full Stack Developer and love to work on APIs and Apps. Hardcore lover of Ionic and Laravel <3

Check Also

Weather forecast API using jQuery, Ajax and PHP

Weather forecast API is widely used as widgets in small blogs to huge news website …

Do you wan't to get notified?

I will not spam your inbox. I will only send email whenever I publish a new article or to share information about technology

You have Successfully Subscribed!