There are no doubts that Facebook is the most known social network in the world. With more than 600 million monthly active users , its site is the second most visited site on the web, after Google. Facebook’s user base is therefore important for every company that addresses itself to the public in order to test reactions, analyse opinions and try to understand the customer base. This is why Facebook is one of the social networks considered for our application.
The Graph API is the core of the Facebook Platform, enabling developers to read and write data to Facebook. All objects – users, posts, comments, images, likes, connections, etc. – are represented as the nodes of a graph. The API provides two ways of browsing objects, depending on their privacy settings
- unauthenticated browsing of the social graph for publicly available information
- authenticated requests for objects which have a higher privacy level
Since our web application’s purpose is to unify what users post on different social networks about different topics, we are mostly interested in being able to query Facebook for the posts that users publish and then to analyse the reactions.
The Graph API is a very simple API that works on a request – response basis, returning a JSON object for each call. The format of a request for searching over public objects is the following:
OBJECT_TYPE can be post, user, page, event, group, place or checkin.
For example to browse all public posts that mention University of Southampton, the query should look like:
One of the results looks like:
"name": "Hartley Library",
"message": "We have some new photos of Hartley Library in our main facebook page (http://www.facebook.com/UniSotonLibrary?sk=photos).",
"name": "University of Southampton Library",
"description": "The Library is a dynamic service, and is continually adding resources and developing services to support the teaching and research of the University.",
"text": "197 people like this."
Since every object has an ID and the Graph API allows querying the public data of each object, the response can be parsed and more details can be obtained. In case the user would like to query information that is private, he will have to connect with Facebook through our application and then the application can also provide details about private objects.