Reading Edges from the Graph API

We previously showed you a simple example of reading data from the Graph API. This example expands that a bit to show you how to handle a list of data rather than a single piece of info, and how that list can be transformed into individual elements. We'll show you a response containing some of the Facebook Pages that you like.

Adding Permissions

First, we'll need the user_likes permission to make this request, so we'll insert a Login button which requests that permission (click on this if you haven't already granted it):

Using FB.api()

Click here to show some of your Page likes (the API request might take a few seconds).

Related Guides

Read our quickstart to using the JavaScript SDK for Graph API calls for more info.