I have a problem with API call on Facebook Graph API. This API call (with the php-sdk):
$posts = $facebook->api('/me/posts?since=2010-1-1&until=2010-3-31T23:59:59');
returns empty array, that looks like this using var_dump : { ["data"]=> array(0) { } }
If I modify the call like this:
$posts = $facebook->api('/me/posts?since=2010-1-1');
it returns the right posts. If I modify it like this:
$posts = $facebook->api('/me/posts?until=2010-3-31');
It returns empty array again. However, this
$posts = $facebook->api('/me/posts?until=2010-12-31');
works fine (but for different posts, than I want).
All of the above, with “statuses” or “links” instead of “posts”, return non-empty array.
What is going on?
I think you are hitting infamous 5000 limit. Facebook acts like if you always have only latest 5000 records. So if your 5000th entry from top was newer than
2010-3-31it won’t return anything for/me/posts?until=2010-3-31query.Run
/me/postsquery and look at the bottom item. Facebook won’t return anything older than it no matter what extra query parameters you supply (undocumented feature).