Facebook Graph API Introduction

Facebook uses Graph API platform for developers to develop applications. The main purposes of Facebook applications are reading and writing data using Graph API.

Facebook’s core is the social graph: people and the connections.  The basic concept of Open Graph is to put people on the web and then create appropriate connections between them.

And the concept of Facebook Graph API can be simplified as: objects and connections.


In Facebook Graph API, every object has a unique ID. Facebook
Graph API provides an easy way accessing Facebook objects:


The ID in the above URL can be a user ID or user name. It can also be Pages, Events, Groups, Applications, Status Message, Photos, Photo Albums, Videos and Notes.

ME can also be used for the ID to represent the current Facebook login user.


Let’s take some examples to illustrate how to access the Facebook objects.

Access object (people) with user ID


The output return is in JASON format. You can extract the individual element easily with some simple script, for example, PHP or JavaScript.

Access object (people) with username


Access Information of Facebook Pages


Access Information of Events


An access token is required to request this resource.

More examples can be found at Facebook documentation:



Another Facebook core concept is connections – establish appropriate connections between objects.

All of the objects in the Facebook social graph are connected to each other via relationships. For example: Alex is a fan of the MyGreatNameHosting Page, and Alex and Kathy are friends. The connections between objects can be examined easily using the following URL structure:


The connections supported for people and pages include Friends, Likes, Books, Movies, Music, Events, etc…

To access the connection, you need to obtain an access token for the user to perform authorized requests on behalf of that user.  This can be done by including the access token in your Graph API requests:


Let’s also take some examples to illustrate how to examine the connections between objects:

Connections or Relationship with Friends

Connection with Books

Connections with Music

All examples above can be accessed even without login Facebook account.

More connection types and  examples can be found at Facebook documentation:


I will talk more about Facebook Graph API later.

Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>