- Posts tagged api
- Explore api on posterous
Facebook Graph API - The Future Of Semantic Web?
The new Graph API attempts to drastically simplify the way developers read and write data to Facebook. It presents a simple, consistent view of the Facebook social graph, uniformly representing objects in the graph (e.g., people, photos, events, and fan pages) and the connections between them (e.g., friend relationships, shared content, and photo tags).
Every object in the social graph has a unique ID. You can fetch the data associated with an object by fetching
https://graph.facebook.com/ID. For example, the official page for the Facebook Platform has id 19292868552, so you can fetch the object at https://graph.facebook.com/19292868552:{ "name": "Facebook Platform", "type": "page", "website": "http://developers.facebook.com", "username": "platform", "founded": "May 2007", "company_overview": "Facebook Platform enables anyone to build...", "mission": "To make the web more open and social.", "products": "Facebook Application Programming Interface (API)...", "fan_count": 449921, "id": 19292868552, "category": "Technology" }Alternatively, people and pages with usernames can be fetched using their username as an ID. Since "platform" is the username for the page above, https://graph.facebook.com/platform will return what you expect. All responses are JSON objects.
All objects in Facebook can be accessed in the same way:
- Users: https://graph.facebook.com/btaylor (Bret Taylor)
- Pages: https://graph.facebook.com/cocacola (Coca-Cola page)
- Events: https://graph.facebook.com/251906384206 (Facebook Developer Garage Austin)
- Groups: https://graph.facebook.com/2204501798 (Emacs users group)
- Applications: https://graph.facebook.com/2439131959 (the Graffiti app)
- Status messages: https://graph.facebook.com/367501354973 (A status message from Bret)
- Photos: https://graph.facebook.com/98423808305 (A photo from the Coca-Cola page)
- Photo albums: https://graph.facebook.com/99394368305 (Coca-Cola's wall photos)
- Videos: https://graph.facebook.com/614004947048 (A Facebook tech talk on Tornado)
- Notes: https://graph.facebook.com/122788341354 (Note announcing Facebook for iPhone 3.0)
All of the objects in the Facebook social graph are connected to each other via relationships. Bret Taylor is a fan of the Coca-Cola page, and Bret Taylor and Arjun Banker are friends. We call those relationships connections in our API. You can examine the connections between objects using the URL structure
https://graph.facebook.com/ID/CONNECTION_TYPE. The connections supported for people and pages include:
- Friends: https://graph.facebook.com/me/friends
- News feed: https://graph.facebook.com/me/home
- Profile feed (Wall): https://graph.facebook.com/me/feed
- Likes: https://graph.facebook.com/me/likes
- Movies: https://graph.facebook.com/me/movies
- Books: https://graph.facebook.com/me/books
- Notes: https://graph.facebook.com/me/notes
- Photos: https://graph.facebook.com/me/photos
- Videos: https://graph.facebook.com/me/videos
- Events: https://graph.facebook.com/me/events
- Groups: https://graph.facebook.com/me/groups
We support different connection types for different objects. For example, you can get the list of all the people attending the Facebook Developer Garage at SXSW (ID #331218348435) by fetching https://graph.facebook.com/331218348435/attending.
All of the different types of objects and connections we support are included in the Graph API reference documentation.
Contents
The Web is moving to a model based on the connections between people and all the things they care about. This is the future of the online world we live in.



