1

trying to get amount of facebook firiends via facebook api (PHP)

  • using this API call :

                    $friends=$facebook->api('/me?fields=friends');
                    $friends=$friends['friends']; 
                    $amount = count($friends);
                    //$amount = 477
    
  • using this API call :

                    $params = array(
                                    'method' => 'fql.query',
                                    'query' => "SELECT friend_count FROM user WHERE uid =me()",
                    );
                    $amount = $facebook->api($params);
                    //$amount = 488
    
  • Why is there a difference for both the calls ?

  • What is more accurate ?

  • Is there a way to overcome this issue ?

Thanks

Nimrod007
  • 9,825
  • 8
  • 48
  • 71
  • And the `friend` table is giving the same result as `GraphAPI` using the query: `SELECT uid2 FROM friend WHERE uid1 =me()` . I'm not sure why is this happening, but the result from `fql` query is correct! – Sahil Mittal Jul 25 '13 at 05:59
  • possible duplicate of [Fetching list of friends in Graph API or FQL - Appears to be missing some friends](http://stackoverflow.com/questions/11135053/fetching-list-of-friends-in-graph-api-or-fql-appears-to-be-missing-some-friend) – phwd Jul 25 '13 at 11:44
  • Already covered: http://stackoverflow.com/questions/11135053/fetching-list-of-friends-in-graph-api-or-fql-appears-to-be-missing-some-friend – Tsvi Tannin Jul 25 '13 at 18:10

0 Answers0