How to get "People Also Like" using FQL or Graph API - facebook

As mentioned above, I want to get name and page_URL(website) on People Also Like list using FQL OR Facebook Graph API.
I was making some Query for FQL such as:
select page_id, name, username, page_url, website from page where page_id in (select page_id from page_fan where uid= "")
But it gives Liked by this page not for People Also like
Please give me your kind advices for getting People Also Like lists.

Related

Get musicians/band verified facebook pages

How do I query Facebook to select only verified band/musicians pages?
I used Tool explorer https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Did%2Cname&version=v2.2 and query this me/music/?fields=category,name,id,band_members but as result I just got all kind of pages not including the official ones.
Is that possible or does Facebook not offer any specific parameter to get this info?
There's currently no way to filter this via the Graph API endpoints. If you can use FQL (meaning you app is a <=v2.0 app), you could use the following query:
select page_id, name from page where is_verified = 'true' and page_id in (select page_id from page_fan where uid=me())

Find all the pages for which a user is an admin using Facebook Graph API

Until now, I was using FQL. I've seen that it's going to be removed (when, I don't know).
When I have obtained the rights to query the user profile, I can find out the pages she manages. Something like the following example. So from page_admin, I get the details of all the pages.
$fql = "select talking_about_count, access_token, description, emails,fan_count,general_info, location, page_url, pic_square, username, page_id,name from page WHERE page_id IN (SELECT page_id FROM page_admin where uid = ".$user['fbuid'].')';
$fql = 'https://graph.facebook.com/'.$user['fbuid'].'/fql?access_token='.$user['token'].'&q='.urlencode($fql);
I cannot find the equivalent using the graph API.
/me/accounts with the manage_pages permission is what you need

How can I take the like pages from an user of Facebook?

I have a problem. I am using fql to get user information. I want to take the pages the user has liked.
https://developers.facebook.com/docs/reference/fql
I have been investigating all tables, but I have not seen what I wanted.
If you know how can I do it, that would be fantastic.
Thank you!!
You want the page_fan table
https://developers.facebook.com/docs/reference/fql/page_fan
uid should be an indexable field
here's a sample FQL query to get you started
select page_id,name from page where page_id in (select page_id from page_fan where uid=me())
https://developers.facebook.com/tools/explorer?fql=select%20page_id%2Cname%20from%20page%20where%20page_id%20in%20(select%20page_id%20from%20page_fan%20where%20uid%3Dme())

Retrieve Facebook users who like a URL/web page

How can I retrieve the list of Facebook users that have clicked the like button on an external site?
Say I have a like button:
<fb:like href="http://example.com/xyz"></fb:like>
I'd like a list of FB user IDs of people who have liked it.
I've tried OpenGraph:
https://graph.facebook.com/OBJECTID/likes/
(where OBJECTID is the id of the like example.com/xyz)
and FQL
select user_id from like where object_id in (
select id from object_url where url = 'http://example.com/xyz'))
but both return empty results.
I can see from other calls that the likes are counted alright, but I can't get the actual users.
Anyone know what permissions etc. I'd need to retrieve these?
Also see this question for sample code.
The simple answer is 'Its not possible to get individual user ids who liked a page'.
https://graph.facebook.com/cocacola/likes?access_token='xxxxxxxxxxxxxxxxxxxxxxx'
will surely return the data about the likes from the user/page but not the list of users who liked the specific object(in this case coca-cola). But make sure you send a proper access_token with proper permissions.
The FQL like is used to get the likes of any objects like video, note, link, photo, or album. To get liked users count of a page please use either link_stat or page from FQL.
the sample query will be like
SELECT url, normalized_url, share_count, like_count, comment_count, total_count,
commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url="facebook.com"
SELECT name, fan_count FROM page WHERE page_id = 19292868552
For more clear answers on this, please read the answer by Jonathan Dean in How to list facebook users who like a page or interest
or ifaour answer in Querying Users who 'like' my Facebook Page

Obtaining Facebook Likes for Multiple Users using FQL

I'm trying to replicate the results of the graph api call:
graph.facebook.com/[fbid]/likes
using FQL so that I can obtain the likes of multiple people using a single call. Anyone know if this is possible / how to do it?
FQL can supposedly support multiqueries. Check out this page:
FQL Multiquery
which says:
"query2":"SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #query1)"
You can use SELECT page_id,name FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid in (....). Hope this was helpful. I found the answer in this discussion. Since this was one of the first pages I came across, I thought I should link it to the answer