I’m trying to fetch all comments for a particular Facebook post via the FB Graph API.
The call for the post itself:
graph.facebook.com/129047777209815_279367092177882/?access_token=XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXX
yields that there are 5278 comments.
Querying for the comments with offset=900, limit=100:
https://graph.facebook.com/129047777209815_279367092177882/comments?limit=100&offset=900&value=1&base_amount=1&access_token=XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXX&__after_id=129047777209815_279367092177882_1122143
yields
"paging": {
"next": "https://graph.facebook.com/129047777209815_279367092177882/comments?limit=100&offset=1000&value=1&base_amount=1&access_token=XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXX&__after_id=129047777209815_279367092177882_1122270"}
Yet querying
graph.facebook.com/129047777209815_279367092177882/comments?limit=100&offset=1000&value=1&base_amount=1&access_token=XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXX&__after_id=129047777209815_279367092177882_1122270
doesn’t give me any comments at all.
It’s not just this post, I’ve noticed consistently that I can never retrieve more than 999 comments.
Can anyone tell me how to get more than 999 comments? Is this a Facebook limit? I can’t find it in the docs.
Thanks,
Paul
Why are you using the
__after_idtoken?The following seems to work perfectly in the Graph API Explorer.
The above retrieves the 5278th comment. Try it out in the Graph API Explorer.
The limit of 999 might apply to the
__after_idparameter. It doesn’t seem to be well-documented. (Related Bug)