1

I am trying to retrieve a list of all users of a fairly large Facebook group (just over ten thousand members). However, the script stops downloading just before five thousand members. I don't get any error messages, so I now wonder if my code is wrong or if Facebook has a limit (without giving errors) that I keep hitting? Here is my code:

from facepy import GraphAPI
from django.core.serializers.json import DjangoJSONEncoder
import json

group_id =""
access_token = ""

graph = GraphAPI(access_token)
# "limit" can be altered, but won't change how much I can download
pages = graph.get(group_id + "/members", page=True, retry=3, limit=10000) 
i = 0
for p in pages:
    print('Downloading page', i)
    with open('%scontent%i.json' % (group_id, i), 'w') as outfile:
        json.dump(p, outfile, indent = 4, cls=DjangoJSONEncoder, ensure_ascii=False)
    i += 1
chrisk
  • 487
  • 1
  • 4
  • 10

1 Answers1

1

There is an old bug about this: https://developers.facebook.com/bugs/267362886791339/

As you can see, it is a well known bug, but Facebook will not fix it.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • 1
    Thank you! This explains the problem. To add a little precision, my the script will stop at exactly 4944 members. – chrisk May 06 '16 at 09:26