Take the 2-minute tour ×

I luckly get some ununderstandable response when trying to get friendlist from a facebook account, this is what i got when console.log:

 #v_3 { __wrapped=#v_3, __observableEvents={...}, name="v_3", more...}

The method FB.Data.query:toString is not officially supported by Facebook and access to it will soon be removed.

Here is my code for login and get user's friendlist member:

    FB.init({ appId:'my_appid' });

    // fetch the status on load

    $('#login').bind('click', function() {


    // handle a session response from any of the auth related calls
    function handleSessionResponse() {
        FB.api('/me', function(response) {
            var access_token = FB.getAuthResponse()['accessToken'];
            var friends = FB.Data.query('SELECT uid, flid FROM friendlist_member WHERE flid IN (SELECT flid FROM friendlist WHERE owner=me())');

            $('#user-info').html(response.id + ' - ' + response.name);

Anyone has exprienced the same issue?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Well, there is a much better way to get the friendlist of a user:

FB.api('me/friends', function(response) {

If you really want to use FQL (which is not a good way in this case), it is explained how to use FQL with the JavaScript SDK in this thread: How can I execute a FQL query with Facebook Graph API

The correct FQL call to get the friends would be this one:

SELECT uid2 FROM friend WHERE uid1=me()


share|improve this answer
dude, i feel myself like a noob.... anyway ty for the answer! ;D –  nihulus Nov 21 '12 at 11:16
i tried ur link to get friend list with fql but still getinng 0 data –  nihulus Nov 21 '12 at 12:41
fql is very buggy, if there is a way with the graph api (see my code) you should always use it. zero data could also mean that you are missing the correct permission though, but if it works with the graph api, it should also work with fql. –  luschn Nov 21 '12 at 13:04
btw, i think you are using the wrong FQL call in your code. don´t mix "friends" with "lists". i will edit my answer to include the correct fql. –  luschn Nov 21 '12 at 13:06
look here: stackoverflow.com/questions/1795934/… –  luschn Nov 21 '12 at 15:42

Your Answer


