Querying Users who 'like' my Facebook Page

45,874

Solution 1

I am afraid this is NOT possible, follow this bug for more information.

Another proof is the page_fan table you will notice that only the uid field is indexable so you need to know the user id to search it and not the page_id, as you know if a user "likes" a page this would mean he is a "fan" of that page.


After being actively working with the Facebook API for a while now, and following the announcements and API releases (and deprecations) along with the introduction and changes of policies, I can understand that Facebook will only share info about their users by letting them explicitly do so (a.k.a interact/authorize your Apps).

And hence the best thing to do in the absence of such feature is:

  1. Understand your audience through Page Insights
  2. Collect fans interests & info by creating custom apps through Page Tabs and using other Facebook features like Questions

Solution 2

Alright, nobody wants to break Facebook's TOS but they have tied our hands on our own basic data. So, scraping is illegal, but not saving a page. What I have done (and note that I needed this for offline purpose anyway): Go to https://www.facebook.com/browse/?type=page_fans&page_id={FAN PAGE ID} Scroll down until you have all of your fans. Save this page on your local machine, let's say, Facebook.html. Now, using ruby and nokogiri:

require 'nokogiri'
>true
f = File.open('/your_path/Facebook.html')
doc = Nokogiri::HTML.parse(f.read)
doc.xpath('//div[@class="fsl fwb fcb"]/a').each {|link| puts link.content}

Solution 3

Do a graph search likes this: "People who like [your fanpage's name]". You will all the result.

Then create shortcut on your browser with this javascripts code, it will click on the View more link and scrolling until all result are shown in the page:

javascript: i = 0;minutes = 30;counter = minutes * 60;function repeatScroll() {
if (i < counter) {window.scrollTo(0, document.body.scrollHeight);i++;}    
setTimeout(repeatScroll, 1000);}repeatScroll();

After that, create other shortcut and run this js code to retrieve all UID from the search result:

javascript:var txt="";e=document.getElementsByClassName("FriendRequestOutgoing");
for(var i=0; i<e.length; i++) {v=e[i].getAttribute("data-profileid");
if(v) txt+=v+"\n"}document.body.innerHTML="<textarea>"+txt+"</textarea>";

A textarea box will appear in the screen with all uid inside. Just copy it to your notepad and import into your Custom Audience in Facebook Ad Manager.

I created and use this code everyday to get all UID with criterial I need. You can launch any graph search you want. This is homemade code, so using it without your own responsibility :)

Enjoy them.

Solution 4

It's possible, just not with FQL anymore.

Do a GET of https://www.facebook.com/browse/?type=page_fans&page_id={FAN PAGE ID} and scrape out the users.

Viola.

Solution 5

Now you can get people on your page with this link, or click on Settings button, than on People on the left sidebar. https://www.facebook.com/[PAGENAME]/settings/?tab=people_and_other_pages

If you want to get all the user's photo, press F12 and add these codes to the Console:

javascript:i=0;minutes=30;counter=minutes*60;function repeatScroll(){if(i<counter){window.scrollTo(0, document.body.scrollHeight);i++;}setTimeout(repeatScroll,1000);}repeatScroll();

than, when you reached the bottom of the page:

javascript:var txt="";e=document.getElementsByClassName("img"); for(var i=0; i<e.length; i++) {v=e[i].getAttribute("src"); if(v) txt+="<img src='"+v+"'>\n"}document.body.innerHTML="<textarea>"+txt+"</textarea>";

To display photos: create a HTML page and first insert these lines into that file:

<meta charset="utf-8">
<style>img { width:21px; margin:-1px; }</style>
<div style="width:851px; height:315px;background-color:white;">
<!-- PASTE HERE PHOTOS' CODE YOU GET -->
<span style="color:#3B5998;font-weight:bold;font-size:20px;margin-bottom:4px;">600 like, thank you!</span>
<!-- PASTE HERE PHOTOS' CODE YOU GET -->    
</div>
Share:
45,874

Related videos on Youtube

MrRay
Author by

MrRay

Updated on July 09, 2022

Comments

  • MrRay
    MrRay over 1 year

    I was wondering if it was possible to query the following:

    • List of (all) users who like my facebook page, and
    • Additional information those users have made publicly available (beyond first and last name)

    Basically looking to generate detailed marketing stats of users who like my facebook page, if possible. Any suggestions or alternatives welcome.

    Thank you.

  • B_.
    B_. almost 13 years
    I agree that this is not possible. I've tried every possible permutation of api calls, permissions, access tokens etc that might possibly provide you with a list of a page's fans/likes over the past couple days with no success. Anyone who says they are able to do this either hasn't actually tried it or must have somehow lucked in to a beta test of the ability as described in your link to the bug page.
  • Igy
    Igy over 11 years
    You shouldn't really advocate breaking Facebook's TOS by scraping the site
  • Philihp Busby
    Philihp Busby over 11 years
    that gets the things that chickfila likes; not who likes chickfila.
  • Rajesh Meniya
    Rajesh Meniya about 11 years
    Yeah, you are right. But we get user_id which is used for get name

Related