Can I get a list (name - email) of fans who likes a public page using the facebook SDK and python?
<p>I was trying to get a list of fans who likes a public page.</p>

<p>If that is not possible a list of people who likes comments made in that public page.</p>

<p>This link make me thing that in fact it is possible:</p>

<p><a href="https://www.facebook.com/search/102381354573/likers?ref=about" rel="nofollow">https://www.facebook.com/search/102381354573/likers?ref=about</a></p>

<p>Here's what I tried with Python and Facebook SDK </p>

<pre><code>"""
A simple example script to get all posts on a user's timeline.
Originally created by Mitchell Stewart.
&lt;https://gist.github.com/mylsb/10294040&gt;
"""
import facebook
import requests


def some_action(post, row):
    """ Here you might want to do something with each post. E.g. grab the
    post's message (post['message']) or the post's picture (post['picture']).
    """

# You'll need an access token here to do anything.  You can get a temporary one
# here: https://developers.facebook.com/tools/explorer/
access_token = 'EAATASQOiIDABAC367RRjcCNY8SHWkNaeaZBEByStOCx6arJcMZAsLHvAwBzHmVpzNR9kjaM5G4GsoiEzEkr0YXYoA0rSHdtXXSGMn8RQgrA3ZB2nmBGYQ0rUGFKL6dtAZCEjkfuMFy5hBHLKqDiDs95CiUBcbkKYZCAFA559qiAZDZD'
# Look at Bill Gates's profile for this example by using his Facebook id.
user = 'biligates'



graph = facebook.GraphAPI(access_token)
profile = graph.get_object(user)


likes = graph.get_connections('102381354573', 'likes')



posts = graph.get_connections(profile['id'], 'posts')




while True:
    try:
        [print_friends(friends=friend) for friend in likes['data']]

        likes = requests.get(likes['paging']['next']).json()
    except KeyError:
                # When there are no more pages (['paging']['next']), break from the
                # loop and end the script.
                print ('--------------------')
                print ('No more data comming')
                print ('--------------------')
                break
</code></pre>

<p>The result of this script is:</p>

<pre><code>{u'name': u'Washington Redskins', u'id': u'102381354573'}
32237381874 - Kings Dominion
328084609453 - Pierre Thomas
164582060550453 - Papa John's Pizza DMV
112733772094151 - CSN Mid-Atlantic
758770517542315 - Matt Jones
291800575745 - Andre Roberts
546765258765348 - Stephen Paea
487760671369099 - DeSean Jackson
110815543982 - DeAngelo Hall
386180624733248 - Robert Griffin III
1397352627212077 - Dashon Goldson
155219064665 - Pierre GarÃ§on
1557530721156959 - Akeem Davis
159691050732 - Kirk Cousins
1433685776950292 - Redskins Salute
89972093868 - Omni Hotels
525973260837198 - Redskins Team Store
678000172307735 - Family of 3
120167766006 - FanDuel
161882187173357 - Bradenton Redskins Fan Club
668604919890894 - Redskins Facts
188327264572436 - Bob's Discount Furniture
164933623547236 - PrimeSport
352567624896549 - True Health Diagnostics
218158744892220 - Women of Washington Redskins
503110669738004 - Bon Secours Washington Redskins Training Center
267502171241 - NFL Ticket Exchange
174705179277205 - Washington Redskins Cheerleaders
370174424170 - NFL Network
68680511262 - NFL
--------------------
No more data comming
--------------------
</code></pre>

<p>No, there is no API to get a list of fans. You can only get a list of users who commented or liked something on your Page, but there is no way to get their email. It would be weird anyway, what would you want to do with the email? Without explicit approval of the user, you would not even be allowed to store the email, and any email you send to them would be spam.</p>

<p>You get the email of a user only by authorizing that user with the <code>email</code> permission.</p>

python json facebook facebook-graph-api sdk