Skip to content

Pagination and filters

Lists come in three shapes. The reference for each endpoint says which it uses.

GET /v1/investments, GET /v1/accounts/{id}/orders and GET /v1/firms/{firmId}/strategies/universe take limit and offset and return total, how many match across all pages.

Terminal window
curl "$IDEALX_API/v1/accounts/$ACCOUNT/orders?status=done&limit=50&offset=100" -H "Authorization: Bearer $IDEALX_API_KEY"
{ "orders": [ … ], "total": 412 }

GET /v1/accounts/{id}/orders without any filter returns the latest 100 orders; with any filter, limit or offset it is filtered and paged on the server (up to 5,000 matching). The strategy universe answers total: null with more: true when it cannot count cheaply; keep paging while more is true.

The activity feeds, GET /v1/accounts/{id}/activity and GET /v1/accounts/{id}/digital-assets/activity, use a cursor. Pass the previous page’s nextCursor as cursor until it is null. Ask for facets=false on later pages.

async function* activity(accountId: string, params: Record<string, string> = {}) {
let cursor: string | null = null;
do {
const q = new URLSearchParams({ ...params, limit: "200", ...(cursor ? { cursor, facets: "false" } : {}) });
const res = await fetch(`${base}/v1/accounts/${accountId}/activity?${q}`, { headers });
const page = await res.json();
yield* page.items;
cursor = page.nextCursor;
} while (cursor);
}
for await (const item of activity("acc_…", { period: "fy" })) console.log(item.at, item.title);

The cursor is opaque and tied to the filters it was made with: keep the same filters for every page.

Statements, tax and accounting reports take a from/to window (or a tax year) and return everything in it. GET /v1/accounts/{id}/transactions takes a limit (up to 200) for the newest transactions. Short lists, such as accounts, clients, proposals and strategies, come complete.

  • Comma-separated lists filter on any of their values: kind=buy,sell, status=pending,approval.
  • Days are YYYY-MM-DD; to is included.
  • Lists of states and kinds can grow within v1: ignore values you do not know rather than failing.