3

In the Faceboook API, is there a way to get paginated API responses in reverse order? Or take only recent results or something?

Using the "next" link as discussed here (https://developers.facebook.com/docs/graph-api/using-graph-api/v2.1#paging), I can click through, but if there's a ton of results since all the way from 2013, that takes very long.

tscizzle
  • 11,191
  • 15
  • 54
  • 88

1 Answers1

0

You can use time based pagination, this is from facebook documentation:

Time-based Pagination

Time pagination is used to navigate through results data using Unix timestamps which point to specific times in a list of data.

When using an endpoint that uses time-based 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"
  }
}

A time-paginated edge supports the following parameters:

  • until: A Unix timestamp or strtotime data value that points to the end of the range of time-based data.

  • since: A Unix timestamp or strtotime data value that points to the start of the range of time-based data.

  • limit: This is the number of individual objects that are returned in each page. A limit of 0 will return no results. Some edges have an upper maximum on the limit value, for performance reasons. We will return the correct pagination links if that happens. next : The Graph API endpoint that will return the next page of data. previous : The Graph API endpoint that will return the previous page of data.

  • I saw that, but it says "When using an endpoint that uses time-based pagination", but the endpoint of interest in my case appears to use cursor-based pagination. – tscizzle Oct 02 '14 at 13:59