How to track the users have became fans of my facebook page? - facebook

I know there is a Facebook tool named insights, but, at the moment it does not give me the information I need.
I would like to create custom invitation code to track how many friend of a specific user have became the fans of my page.
Small example...
John becames fan of my page, I would like to undersand how many friends of John became fans of my page.
I do not know how to do that, but I must need to know how many users have become fans and by whom.
Is this possible with a Facebook page, or do I need to create an application?
Thank you!

This can be done with FQL (Facebook Query Language) using the Facebook Graph API. What you're looking for is the likes attribute which can be obtained from the JSON returned by http://graph.facebook.com/yourusername.
Ofcourse you will need to do further queries to obtain things like how many friends of a specific user liked your page. Probably something along the lines of SELECT ... FROM like WHERE object_id = yourpage and I would imagine you'd need to link that to the friend table with something like WHERE uid1 = friendid to get their friends.

Related

See Facebook Likes in Date Order

Is there a way I can see the order in which people like my facebook page? I would like to identify the 5000th like to give them a prize.
Is this possible?
Stuart
No, this is not possible, because you can't access the list of ALL users which liked you page.
You can only access the likes of ONE user once he gave his user_likes permission to your app (if you have one).

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...

Can you make a user-based search with Facebook API?

On Facebook when you write something in the search box in the top.
Like 'Eric'
You first get the results with your friends named Eric and further down you get people you might know with X mutual friends and some random people in the vicinity you might know.
Is it possible to make a similar search with the Facebook API?
I've tried:
https://graph.facebook.com/search?q=eric&type=user&fields=id,name&access_token= (my token)
And thought if I added my access_token I would get a search like the one on Facebook. But I just get some random Eric's from all over the world.
I'm writing a simple web application and getting this search to work would be great! Thanks!
It's possible to an extent but before looking further ensure this isn't the main service of your app otherwise you run the risk of violating Facebook policy on replicating core functionality.
You need to look into the user FQL table and the friend table
Do an FQL call as follow:
SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())
Then save the JSON response from that call and use a typeahead algorithm / plugin.

How to get the number of "likes" by your friends for a given place

Given a place, like https://graph.facebook.com/112088822180423, how can I get the number of likes just by my friends? The graph gives me Likes, Checkins and Talking_About_count, but I just want whose likes by my friends. Is that possible?
If you want to do this for a page you administer and you want do this as an admin, it may not be possible with current API. From https://stackoverflow.com/a/6737579/121052, you cannot get the list of likes for a location or a page. If you had the list, you can fetch a list of your own friends, and then performed an intersection.
However, if it is a feature you are building in an App to be used by it's users - i.e you want to display the list of friends of the user who has liked a page, then that is possible. For that, do the following:
Use http://developers.facebook.com/docs/reference/api/user/#likes to get if the user likes a page/location.
Use http://graph.facebook.com/USER/friends?access_token=XXX to get the list of his friends.
For any friend, you can perform the like check again and make the intersection.
I am sure there might be a way to optimize this operation. Batch Requests will definitely help.
I discovered that this is possible through the use of FQL and the page_fan table

GET Facebook Page Fans

I'm trying to get a list of all my Facebook Page Fans.
All I can get from FQL is the total amount of fans for my facebook page. I can't know WHO my fans are?
I have tried this:
https://graph.facebook.com/somepage
Anyone with an idea of how to know WHO my fans are? I.e. list the User IDs of all my fans for a specific page?
I also know that I can get more information about my fanpage using FQL and "insights", from there I can get "page_active_users" and so forth, but not a list of all my fans?
I know that Facebook doesn't support this (in public), but any ideas on how to get around it?
https://graph.facebook.com/[PAGEID]/members?limit=500&access_token=[oauthtoken]
Its not possible to get the UIDs of the users who have liked your page.
The UIDs of users are only available to third parties if the user performs a public action (post, comment or like on your page's feed), or if they auth an application.
This is why you can't query FQL with a page ID and get UIDs.
Its no more possible, thats why FB makes money ;-)
You can try to parse the AJAX call...