Paginated response Facebook API

Is there a way in the Faceboook API to get the API response responses in reverse order? Or take just recent results or something else?

Using the following link as described here ( https://developers.facebook.com/docs/graph-api/using-graph-api/v2.1#paging ) I can click, but if there is a ton of results since then until 2013, it takes a very long time.

+3


source to share


1 answer


You can use temporary pagination, this is from facebook docs:

Temporary pagination

Time Stamps are used to navigate the results data using Unix timestamps that point to a specific time in the data list.

When using an endpoint that uses temporary pagination, you will see the following JSON response:



{
  "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"
  }
}

      

Time staking supports the following options:

  • to : A Unix timestamp or strtotime value indicating the end of a range of time-based data.

  • because : a Unix timestamp value or strtotime indicating the start of a time-based data range.

  • limit . This is the number of individual objects that are returned on each page. Limit 0 returns no results. For performance reasons, some edges have an upper limit on the cutoff value. We will return the correct page links if this happens. next: The endpoint of the Graph API that will return the next page of data. previous: The endpoint of the Graph API that will return the previous page of data.

0


source







All Articles