Possible Duplicate:
Retrieve Facebook Fan Names
I wanna get a list of facebook users who like a page or interest.
FQL like 'SELECT user_id FROM like WHERE object_id=113970468613229
' does not work.
Is there a way to do this?
Possible Duplicate:
Retrieve Facebook Fan Names
I wanna get a list of facebook users who like a page or interest.
FQL like 'SELECT user_id FROM like WHERE object_id=113970468613229
' does not work.
Is there a way to do this?
I am Partner Engineer at Facebook so I thought I'd chime in here. The Facebook APIs will not give you the user ID of users who have liked a page or interest, this is to guard the privacy of those users.
There is no way to get a list of people that like your page via their API, which is why this question never got answered. You can get charts and aggregate information about who like your page from Facebook Insights but it is not personally identifiable information like their user id.
You can see the most recent 500 users that have like your page by going to: https://www.facebook.com/browse/?type=page_fans&page_id=your page id but you would have to scrape this to get the information and it won't work for more people besides the most recent 500.
It isn't possible to get the ids of users who like your page unfortunately.
You can use the like box to show a facepile of users who like your page. And as haha said you can detect if one user likes a page.
For the likebox/facepile option check out the docs at: Likebox
The FQL docs have been updated to clarify this limitation: https://developers.facebook.com/docs/reference/fql/like/
According to the facebook api that is exactly how you do it. Except it says you should have quotes around your object_id.
The example says:
$facebook->api_client->fql_query('SELECT user_id FROM like WHERE object_id="122706168308"');
http://developers.facebook.com/docs/reference/fql/like
With Facebook PHP-SDK you can use this
if($me) {
$youlikeit = $facebook->api(array(
"method" => "fql.query",
"query" => "select uid from page_fan where uid=me() and page_id=113970468613229"
));
}
$youlikeit = sizeof($youlikeit) == 1 ? true : false;