I’m currently testing to get some posts from a media page for a specific time range:
- page: https://www.facebook.com/LExpress
- since: 2017-09-06 11:00:00 +0000 (strtotime -> 1504688400)
- until: 2017-09-06 18:00:00 +0000 (strtotime -> 1504713600)
But surprisingly some posts are missing from Facebook response.
Here is the facebook request used to get the posts list:
This returns only these three results:
"data": [
{
"created_time": "2017-09-06T15:05:00+0000",
"message": "Casernes de pompiers inondées, hôtels dévastés : l'ouragan Irma s'est abattu sur les îles de Saint-Barthélemy et Saint-Martin",
"id": "9359316996_10155287552551997"
},
{
"created_time": "2017-09-06T14:15:00+0000",
"message": "Le gouvernement aussi a fait sa rentrée des classes",
"id": "9359316996_10155287360111997"
},
{
"created_time": "2017-09-06T09:45:00+0000",
"message": "Persécutés, des dizaines de milliers de Rohingyas fuient la Birmanie",
"id": "9359316996_10155286897911997"
}
]
But where is the post published at 2017-09-06 12:56:32 ??
The following post has been published at 2017-09-06 12:56:32 +0000 and should be returned by Facebook in the specified date range:
- since: 2017-09-06 11:00:00 +0000
- until: 2017-09-06 18:00:00 +0000
{
"id": "10155287271171997",
"updated_time": "2017-09-06T12:56:32+0000",
"created_time": "2017-09-06T12:56:32+0000",
"name": "⭕ ALERTE — Ouragan Irma : black-out total sur les îles de Saint-Barthélémy et Saint-Martin
Centrales EDF hors-service, casernes de pompiers inondées
Suivez notre direct"
}
Why is that? Any thoughts?
Thx!
PS: as it is photos
I also tried to get it from /photos route, but we don’t get any results…
2
Answers
The answer is that Facebook will return a maximum of 600 posts per pages as explained in the page's feed
limitations
paragraph :https://developers.facebook.com/docs/graph-api/reference/v2.11/page/feed#read
Like what Ben Tazulev said, with the
/{page-id}/posts
endpoint there a limitation:-> https://developers.facebook.com/docs/graph-api/reference/v2.11/page/feed#read
But when I tried to gather all my post with the
/{page_id}/published_posts
it worked!-> https://developers.facebook.com/docs/graph-api/reference/page/published_posts/