M
M
MagnetonBora2016-03-28 18:35:01
Facebook
MagnetonBora, 2016-03-28 18:35:01

Why does time based pagination in Facebook GraphAPI return wrong result?

Faced the following problem. Using the Facebook GraphAPI, I want to extract all the comments from here for later analysis. There are quite a lot of comments on this post (about 50K). I'd like to be able to send HTTP requests with start_date and end_date parameters in order to be able to retrieve comments for a specific time interval.
Facebook GraphAPI provides the so-called time based paging - you can set the time period with the since and until parameters.
What is the problem
I want to get some amount of comments starting from 2013-08-01 (YYYY/MM/DD date format) in unix time this corresponds to 1375315200. By making the following HTTP request, I expect to receive data that has a created_time field greater than 1375315200 :

curl -i -X GET "https://graph.facebook.com/v2.5/10151775534413086/comments?fields=created_time&offset=0&since=1375315200&limit=5&access_token={MY_TOKEN_HERE}"

However, this query gives me the following result:
{
  "data": [
    {
      "created_time": "2013-07-09T14:17:20+0000",
      "id": SOME_ID_HERE
    },
    {
      "created_time": "2013-07-09T18:03:17+0000",
      "id": SOME_ID_HERE
    },
    {
      "created_time": "2013-07-09T14:13:52+0000",
      "id": SOME_ID_HERE
    },
    {
      "created_time": "2013-07-09T14:22:16+0000",
      "id": SOME_ID_HERE
    },
    {
      "created_time": "2013-07-09T14:13:26+0000",
      "id": SOME_ID_HERE
    }
  ],
  "paging": { CURSORS DATA HERE }
}

The comments I received as a result were made earlier than 2013-08-01, and should be later.
Why is this happening? How can I extract from all the comments on a post only those that fall within the time period specified in since/until ?
I did not find an answer to the question in the documentation ... I found relatively similar problems here , here and here , but this information is useless for my case.
PS Currently using Facebook GraphAPI version 2.5

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question