1

I try to read the list of people who likes a page, but it looks like it is not possible with the Graph API or FQL. I found lots of entries of people trying it, but nobody found a solution. Is it possible?

Here I get the profile info, I see the field "likes" with the number 200

https://graph.facebook.com/162253007120080/

But when I try to read it, I get an empty data array?

https://graph.facebook.com/162253007120080/likes

Anybody an idea how to handle this?

Kara
  • 6,115
  • 16
  • 50
  • 57
mediaman
  • 11
  • 1
  • 3
  • Are you asking for the user_likes permission? I think that's why you are getting the empty data array. Which token are you using to get the friends connection? Maybe you should try an application token instead of personal token. Also, If you are calling the graph api from an SDK, php or js or other, it sometimes takes the token from the active session instead of the token you provide. Hope this helps. – DannyKK Apr 20 '11 at 09:56
  • 2
    possible duplicate of [Querying Users who 'like' my Facebook Page](http://stackoverflow.com/questions/5183251/querying-users-who-like-my-facebook-page) – ifaour Apr 20 '11 at 10:55

3 Answers3

0

The resulting data array isn't empty when you go there, it is:

{ "error": { "message": "An access token is required to request this resource.", "type": "OAuthException", "code": 104 } }

Which means you need an access token in order to access that LIKE data..

John
  • 167
  • 1
  • 11
0

HI, here you go, streight out my tool box:

<?php
require_once('../library/Facebook.php');
$facebook = new Facebook(array(
    'appId'  => '123456789000000',
    'secret' => 'asdf',
    'cookie' => true,
));
$result = $facebook->api(array(
    'method' => 'fql.query',
    'query' => 'select fan_count from page where page_id = 1234567890;'
));

echo $result[0]['fan_count'];
?>
Rufinus
  • 29,200
  • 6
  • 68
  • 84
0

Call the graph api link. Extract the contents using json_decode.

Dori
  • 915
  • 1
  • 12
  • 20
Joby Joseph
  • 2,177
  • 3
  • 15
  • 19