Pagination
Number of Records
Endpoints that return a list of resources will include a header indicating the total number of records available. This is specified with the X-Records header. E.g., for an endpoint with 14 records:
X-Records: 14
Next
The amount of records returns within a single API request defaults to 50. It may be changed to a maximum of 200 using a limit query parameter, e.g. to return 200 accounts at a time:
https://api.recurly.com/v2/accounts?limit=200
When there are more records remaining than fit in the current response, the Link header is specified with the URI to the next page of results.
Status: 200 OK X-Records: 204 Link: <https://api.recurly.com/v2/accounts?cursor=1304958672>; rel="next" ETag: "a4b0568a2278bc591ceb64b31547eb78"
Cursors
The cursor parameter is a time-based pointer indicating where to resume the results. By using a cursor instead of page numbers, the API avoids returning duplicate records in the case where additional resources are added between pagination requests.
Previous Pages
After paginating beyond the first page of results, the Link header will include a link to return to the first page of results (rel="start") and the previous page (rel="prev"):
Status: 200 OK X-Records: 204 Link: <https://api.recurly.com/v2/transactions>; rel="start", <https://api.recurly.com/v2/transactions?cursor=-1318344434>; rel="prev" <https://api.recurly.com/v2/transactions?cursor=1318388868>; rel="next" ETag: "c7431fcfc386fd59ee6c3c2e9ac2a30c"
