Paging Through API Responses

Every endpoint in Finix's API supports cursor-based pagination.

Cursor-based pagination helps you fetch large lists of data from Finix's API and move through it quickly to find the info you're looking for. When you request a large list of data, Finix paginates the result to make the data more manageable.

While using cursor-based pagination, you move through data sets linearly, character by character, with a “cursor” that maintains position between API calls. From the position of the cursor, you can specify what data you need and how many pages to fetch.

To use cursor-based pagination, pass through after_cursor or before_cursor.

  • after_cursor returns every resource created after the cursor value.
  • before_cursor returns every resource created before the cursor value.

Using our /transfers endpoint, let's say we have several transfer resources with id values from 1-10. You can easily move through the resources using cursor-based pagination.

  • GET /transfers?limit=4 sets the cursor at resource 4 , and returns the values 1, 2, 3, 4, .
  • GET /transfers?limit=4&before_cursor=4 returns 3, 2, 1, which are the values before the cursor (resource 4 ).
  • GET /transfers?limit=4&after_cursor=4 returns 5, 6, 7, 8, which are the values after the cursor (resource 4 ).

For instructions on how to switch your requests to cursor-based pagination, see Migrating to Cursor Pagination.

For more info on pagination, see the following article about the Cursor Pagination Profile.