Issue with getting Facebook pages like count in my account - facebook-fql

Requirement: Get like count of all pages under my FB account.
FQL https://api.facebook.com/method/fql.query?query=SELECT+user_id,object_id,post_id+FROM+like+WHERE+user_id=me()
Problem Every time i hit this FQL, i get the following ERROR:
"Querying like on user_id requires the read_stream extended permission."
Source
Get Facebook "Like" count for every page on my domain
Please help me to solve this issue.
Best Regards,
Mohit

You need the read_stream extended permission.
Grant this to your app and that query should work fine.

Related

facebook graph api if a user has liked a page

I am trying to use facebook graph api to find out if a user has liked a particular page.This is the query I tried
https://graph.facebook.com/user_id/likes/page_id?access_token="my access token"
I tried the same kind of query to find if two users are friends but its returning empty data set even for that.
https://graph.facebook.com/user_id/frineds/user_id
How should I solve that issue?
You can use
GET /v2.2/{user-id}/likes/{page-id}
to find out if a user likes a page. Remember that you need the user_likes permission!
See
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/likes#readmodifiers
For seeing if a user is a friend of another user, try
GET /v2.2/{user-id-a}/friends/{user-id-b}
You need the user_friends permission to do so.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends#readmodifiers

Facebook API: Get the liked links

I am trying to get information on all links that a user has liked. in the past month.
I have obtained the user_likes permission from the user and am trying to use the FB Graph API.
I have tried:
/{user-id}/feed but it is only working for me not the users.
/{user-id}/likes but it only gives the pages, movies, apps, etc liked not the links likes.
/{user-id}/link doesn't give anything even when I see users have liked/shared a link.
Any suggestion will be much appreciated.
Thanks.
As far as I know there's no way to do this in the Graph API. But you can use the FQL table url_like (https://developers.facebook.com/docs/reference/fql/url_like/) to get your info:
select user_id, url from url_like where user_id=me()
Shares have nothing to do with URL likes imho...

Reading facebook post using graph API which app posted

My application is posting on wall on behalf of the user with user access_token. Once it is posted I get back the post_id which is persisted in DB. An an application I would like to query the post using the post_id to collect some basic insights like comments and likes. I can't get my app to query the data.
I tried stream table but doesn't return data as an app. I get "GraphMethodException" code:100
I checked privacy settings on post but that doesn't include permission for an app
I tried GraphAPI /post_id which returns same error as stream table
I tried insights table with post_impressions metric with no luck. I couldn't give the post_id so tried removing the user_id part from post_id(xxxx_yyyy where xxxx is the userid)
What kind of permissions do I need to request user to grant my application stream_read permission?
How do I query insights table with the post_id that I have?
You can only read the user wall with an active user access token, and the read_stream permission.
About the insights: maybe with this graph connection?
/[post-id]/insights
Well, it gives me nothing for a valid post id. But i am sure you can only get the insights of pages, not user accounts.
See here (about pages, but maybe useful additional info): Unable to access a post's insights for someone else's page
One more reason why it will not work, just popped up in my head:
If you go to a facebook page, you have the insights view as admin. Nothing like that on a user profile. So the only thing you can track is how often a link to your app has been clicked after posting it to a user profile. You can easily add tracking information to the link too, so you always know from which profile the click comes.

Trying to get a list of Facebook IDs for those who have checked into a place

I am trying to determine if it is possible to get a list of Facebook users and IDs (via JSON I assume) that have checked in to a place/page.
Is this even possible? Do you need an access token from each user account to access this information? I found Facebook's documentation to be less than helpful...any help will be much appreciated!
You can query the FQL checkin table but at most (based on the permissions granted) you'll get the user's & her friends' checkins.

Facebook Fan page like check

I would like to see of visitor of my website is already fan of my fanpage.
So if somebody visits my website,i would like to ask him to visit my fanpage only, if he is not fan already.I dont want to ask for permission. Just check, if he likes the fanpage or not.
Is there possibility to do this? I am not experienced in this Facebook API, this is why i ask for an idea for doing this
It can be done using FQL by querying page_fan table, you have to get user_likes permission before doing this...
It is now against Facebook's policies to gate an app or content within an app based on if someone has liked your page.
Use of the user_likes permission will not be approved for use by Facebook via Login Review if you're using it for the purpose of like gating.
In addition, FQL is now deprecated and should no longer be used for new apps.
See the announcement here: https://developers.facebook.com/blog/post/2014/08/07/Graph-API-v2.1/