Pagination

For some of our resources (eg. transactions), a "list" endpoint exists to fetch resources in bulk.

These endpoints use a "cursor-based pagination", which means you can use the per_page and cursor query parameters to step through large collections page by page.

Requests

Requests to paginated "list" endpoints accept the following query parameters:

ParameterTypeDescription
cursorString (optional)Cursor pointing to the beginning of a page
per_pageInteger (optional)Amount of resources that should be returned. (1-100. Default: 100)

Responses

All requests to those paginated "list" endpoints have the following response properties:

PropertyTypeDescription
itemsArrayArray containing the listed resources (eg. transactions)
hasMoreBooleanWhether or not there are more resources to be fetched after this page
perPageIntegerAmount of resources returned per page
countIntegerAmount of resources on the current page
nextCursorString | NullCursor pointing to the beginning of the next page (Use the cursor query parameter value to get the next page of resources)
nextPageUrlString | NullURL pointing to the next page of resources (prebuilt for your convenience)

Example Response:

{
  "items": [
    {...},
    {...}
  ],
  "hasMore": true,
  "perPage": 50,
  "count": 50,
  "nextCursor": "kdfhh87sdkfjslasdf7hsbadf",
  "nextPageUrl": "https://api.procuros.io/v2/transactions?cursor=kdfhh87sdkfjslasdf7hsbadf"
}

Workflow

  1. Make a request to the "list" endpoint without the cursor query parameter to fetch the first page of resources. Optionally use the per_page query parameter to limit the number of resources to fetch.
    Example: GET https://api.procuros.io/v2/transactions

  2. From the response, read the hasMore property to determine if there are more resources to fetch on subsequent pages.

  3. If more resources are available, use the nextCursor property on the response to build the URL of your next request. Alternatively, use the nextPageUrl that we've prebuilt for you.
    Example: GET https://api.procuros.io/v2/transactions?cursor=kdfhh87sdkfjslasdf7hsbadf

  4. Continue with step 2.