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