Unable to get actual likes of Facebook Page - facebook

I use
https://developers.facebook.com/tools/explorer?method=GET&path=fiatNL
to check the page likes of the Dutch Fiat Facebook page. The likes that are displayed are the combined likes of all Fiat Facebook pages together (over 1 million). I know that the Dutch Fiat page has no more than 50k likes.
If I check the brand children with this query:
https://developers.facebook.com/tools/explorer?method=GET&path=fiat%3Ffields%3Dglobal_brand_children.fields(name%2Clikes)
It still shows the combined likes.
Is there a way to check the likes of each brand child seperately?

I don't think it's possible because if you likes the page at https://www.facebook.com/fiatnl/, you're automatically likes the other page at https://www.facebook.com/fiatdk/ too.
This pages likes is sync:
If you unlikes the page at https://www.facebook.com/fiatnl/, the other page at https://www.facebook.com/fiatdk/ become unlike too.
Update:
You can try to request (110630838997361 is the page id of http://www.facebook.com/fiatnl):
SELECT value FROM insights where object_id='110630838997361' and
metric='page_fans_country' and period='0' AND end_time =
end_time_date('2014-01-12')
Based on documentation at https://developers.facebook.com/docs/reference/fql/insights/, i don't know why i have to specify end_time when period is 0:
However, this query would return the total likes of each country, so you can simply sum the total.
Page id 53829903566 (http://www.facebook.com/fiatdk):
Page id 110630838997361 (http://www.facebook.com/fiatnl):
Note: end_time_date('2014-01-12'), you cannot do end_time_date('2014-01-13') because it return empty results, so you may consider adjust a bit the current date:

Related

Facebook fan count on a given date

I am not a programmer and I have literally no idea about the Facebook API. However, I need to collect some data from six different Facebook pages for my thesis, and I'm not the admin of them.
I've managed to get all the statuses, likes, comments of the 6 Facebook pages from a year using:
https://api.facebook.com/method/fql.query?query=select permalink,like_info,comment_info,share_info,created_time from stream where source_id={fan-page-ID} and created_time < {time-in-Unix-timestamp} and actor_id={fan-page-ID} ORDER BY created_time DESC LIMIT 20000&access_token ={your-access-token}
Now I need to get the number of fans the six pages had during the year (the variation). I would like to know how many fans the page had on a certain date. I've found this:
http://api.facebook.com/method/fql.query?format=xml&query=select fan_count,name from page where page_id={fan-page-ID}
And it works but it gives me the number of fans for today, not a certain date that I want. Any idea how can I achieve that? It would be amazing if I could get an XML so I can open it in excel for further analysis.

Facebook Graph API: Get all posts from all the pages the user likes

I want to get all the posts from all the pages from the user /me/home feed.
Right now Facebook is deciding for the user what posts will get to the feed and which ones will not.
For example, if the user is subscribed (likes) 100 pages and all 100 of them posts an update the user feed will not show all 100 of them, only a portion of updates that it thinks important. Neither the API.
Is it possible to get all updates using the Graph api (like a regular timeline)?
You can try FQL, for example:
{"query1":"SELECT type,post_id,created_time,actor_id,target_id,message,attachment.media,attachment.caption,attachment.name,attachment.description,attachment.fb_checkin,likes.count,likes.user_likes,likes.can_like,comment_info,description FROM stream WHERE filter_key='pp' AND created_time<now() ORDER BY created_time DESC","query2":"SELECT id,name,pic FROM profile WHERE id IN (SELECT actor_id,target_id FROM #query1)"}
The keyword was filter_key='pp', means that you want to get all page's news feed.
I have no idea it will include ALL of 100 pages on real time, however this should be enough to achieve your goal. One more point, news feed have 1 week limitation, means that you cannot query older than 1 week's news feed.
Update:
https://graph.facebook.com/me/home?filter=pp is alternative way if you don't want to use FQL.
Use the following FQL in your https request to get the list of all likes paginated
SELECT src_big, src_small, owner,caption FROM photo WHERE object_id IN (SELECT object_id FROM like WHERE user_id == me() LIMIT 10 OFFSET 8 )

How to get all people who liked Facebook post?

I have FB post
I can click "77 people like this" and get all people I needed.
Question: is there way to get these people by FB API ?
PS I want to get 3 random names from these list so I need to have these people in JSON format
It's easy to do with FQL. This gets you three random ids of people who liked this event
SELECT user_id FROM like WHERE object_id = 336638873112346 ORDER BY rand() LIMIT 3
If you wanted to get their names instead, you'd rewrite the query like this:
SELECT uid, name, username FROM user WHERE uid IN
(SELECT user_id FROM like WHERE object_id = 336638873112346 ORDER BY rand() LIMIT 3)
I'm one of the co-founders of Kither, a platform for checking all of your Facebook stats. We have added many features which requires to fetch all of our user's posts likes.
As of August 6, 2016, FQL is deprecated.
Facebook's Graph API's still available and you can call https://graph.facebook.com/{api-version}/{post-id}/likes to get likes on posts. But remember, Facebook uses pagination on likes if there are more than 1,000 of them.
Now, In this case you'll need to call the next page url.
You'll need to call the next url unless you've got all the likes. (you won't find any next field if there are no more likes)
To get how many people have liked that post (i.e. count), you don't need to page through results. You can simply use https://graph.facebook.com/{api-version}/{post-id}/likes?summary=true and you'll get an extra field containing all likes' summary, including their count.
Same can be done with comments and recently added, reactions.

Facebook gave me page on many likes but likes count differs

I did add fb's like button on my site , after around 70 likes I got fb page for my link in ready made state.
But likes on page & my link differ that to by whole lot margin.
Can anyone explain me how to match both's like count or atleast sync them.
I'm assuming a lot here because your question isn't completely clear, but it sounds like you're saying the count on the Like button, and the count of likes on the Admin page for that URL are not matching?
That's expected. The like button count for a URL includes things not included on the virtual 'admin' page for that URL:
See https://developers.facebook.com/docs/reference/plugins/like/ :
What makes up the number shown on my Like button?
The number shown is the sum of:
The number of likes of this URL
The number of shares of this URL (this includes copy/pasting a link back to Facebook)
The number of likes and comments on stories on Facebook about this URL
The number of inbox messages containing this URL as an attachment.

Display summery of likes from facebook page and web site

I want to integrate the number of likes that I have in my website with the number of likes that I have in my facebook application, so for example if user clicks on my site like button and another user click on my facebook page like, the total likes that I will see on both the applications(site and facebook) will be 2.
My question is is this possible at all or thous are 2 separate objects and it is not possible to sum there likes
Thanks
You can find the like count of your website by running the following FQL query:
SELECT like_count FROM link_stat WHERE url="yourwebsiteurl"
Then, you can get the like count of your app in one of two ways. If the like button for your app points to its apps.facebook.com address, use the same query as above, with its app URL instead of your website URL.
If the likes for your app are from a Page associated with the app then you should make a Graph API call to:
https://graph.facebook.com/YOURPAGEID?fields=likes
This will give you the like count for each object, now you just need to sum them.