Tradesync
Browse API reference
API reference

Pagination

Last updated

List endpoints use ID-based pagination. The default order is descending; the default and maximum limit is 1,000 records.

Request parameters

Field Type Accepted values / limits Description
limit integer 1 to 1000; default 1000 Maximum number of records in the response
order string asc, desc; default desc Order by resource ID
last_id integer — Exclusive cursor: return IDs above this value for asc, or below it for desc

Send these parameters in the URL query string with GET, or in the JSON body with QUERY. See Filtering.

Response metadata

The top-level meta object accompanies data on paginated responses.

Field Type Description
count integer Number of records returned, not the total number available
limit integer Requested record limit
order string asc or desc
last_id integer or null ID of the final returned record; null for an empty list

Retrieve subsequent pages

  1. Send the initial request with your filters, order, and limit.
  2. If count equals limit, repeat the request with the returned last_id, keeping the same filters and order.
  3. Stop when count is less than limit. An empty page also ends the sequence.

For example:

GET /trades?account_id=123&order=asc&limit=1000

If the response contains 1,000 records and meta.last_id is 9999, the next request is:

GET /trades?account_id=123&order=asc&limit=1000&last_id=9999

The equivalent QUERY request body is:

{
    "account_id": 123,
    "order": "asc",
    "limit": 1000,
    "last_id": 9999
}