Reputation: 7867
I'm getting limited number of posts (for a Facebook page, here 'Walmart') while querying using Facebook Graph API. I'm using https://github.com/pythonforfacebook/facebook-sdk
graph = facebook.GraphAPI(oath_access_token)
feed = graph.get_object('/walmart/' + 'posts', since='2013-01-01', until='2014-01-10', limit=500)
If I don't use limit, I get only 25 posts, which is default. If I put limit to some high value like 500, I only get 168 posts. These 168 posts are from '2013-12-20' to '2014-01-09'. So effectively I'm missing posts between '2013-01-01' to '2013-12-19'.
Upvotes: 0
Views: 2740
Reputation: 20753
According to the documentation:
When you make an API request to a node or edge, you will usually not receive all of the results of that request in a single response. This is because some responses could contain thousands and thousands of objects, and so most responses are paginated by default.
You can always fetch ALL the results by making the request to the url in the key: paging -> next
Result is of format-
{
"data": [
... Endpoint data is here
],
"paging": {
"previous": "https://graph.facebook.com/me/feed?limit=25&since=1364849754",
"next": "https://graph.facebook.com/me/feed?limit=25&until=1364587774"
}
}
(Search for the "Time-based Pagination" in the link I've mentioned for the more details)
Upvotes: 2