Skip to main content
When querying historical financial data or large lists of instruments from the TradeWatch API, responses are paginated to keep individual payloads manageable. When handling large result sets, we use cursor-based pagination. This technique segments the results into pages of a defined size, allowing you to move forward and backward through the pages efficiently.

Cursor Pagination

Our API uses cursor-based pagination provides the following fields in the response:
  • current_page: The encoded cursor representing the current page
  • current_page_backwards: The encoded cursor for the current page when navigating backwards
  • previous_page: The encoded cursor for the previous page (null if you’re on the first page)
  • next_page: The encoded cursor for the next page (null if you’re on the last page)

Example Response

{
  // ...result data...
  "current_page": "Pg%3D%3D",
  "current_page_backwards": "PGR0OjIwMjUtMDMtMTMgMTA6NDY6MDQuMTE2MjQyKzAwOjAw",
  "previous_page": null,
  "next_page": "PmR0OjIwMjUtMDMtMTMgMTA6NDY6MDQuMTE2MjY1KzAwOjAw"
}

How to Use Pagination

  1. For the initial request, you don’t need to provide any pagination parameters.
  2. To retrieve the next page, use the value from next_page in your subsequent request.
  3. To retrieve the previous page, use the value from previous_page in your subsequent request.