I am trying to download all the posts and the comments(and replies to comments) for that post in a public facebook page. Here is the code that I am using:
from facepy import GraphAPI
import json
page_id = "Google"
access_token = "access_token"
graph = GraphAPI(access_token)
data = graph.get(page_id + "/feed", page=True, retry=3, limit=100,fields='message,likes')
i = 0
for p in data:
print 'Downloading posts', i
with open('facepydata/content%i.json' % i, 'w') as outfile:
json.dump(p, outfile, indent = 4)
i += 1
First of all (1) this code is giving me this exception:
facepy.exceptions.FacebookError: [1] Please reduce the amount of data you're asking for, then retry your request
How should I solve this problem?
Second: (2)How can I get all the likes,comments and replies at the same time of getting the posts (paging is also required in likes,comments and replies to get all of them). page=True not working for these fields.
Thank you!