Skip to main content
List endpoints return a single page of results plus a pagination block on the response envelope:
{
  "data": [ ... ],
  "pagination": {
    "has_more": true,
    "pagination_key": "abc123"
  }
}
Two strategies are available for walking through pages: cursor pagination with pagination_key, and offset pagination with offset. Pass the pagination_key from the previous response as a query parameter in your next request. Keep going until has_more is false or pagination_key is null. Cursor pagination stays fast no matter how deep you go, because the server resumes from the cursor instead of counting past the rows you skipped. Use it for any programmatic consumer: data syncs, backfills, agents, and background jobs.
curl "https://api.struct.to/v1/markets?pagination_key=abc123" \
  -H "X-API-Key: YOUR_API_KEY"

Offset pagination

Some endpoints (currently the trader trades and PnL endpoints) also accept an offset query parameter, which skips a fixed number of rows from the start of the result set. Offset exists for one specific case: server-rendered, deep-linkable pages. An SSR page at ?page=42 can map directly to offset=4100&limit=100 and render that slice on the first request, without first replaying every page to obtain a cursor.
cURL
curl "https://api.struct.to/v1/trader/trades?limit=100&offset=4100" \
  -H "X-API-Key: YOUR_API_KEY"
offset is capped at a few thousand rows (typically in the 3,000 to 5,000 range). To read past that point, or to walk the whole dataset, switch to pagination_key.
When both offset and pagination_key are supplied on the same request, offset takes precedence and the cursor is ignored.

Which one to use

Cursor (pagination_key)Offset (offset)
Fetch the entire datasetYesNot recommended
Jump to an arbitrary pageNoYes
Best forProgrammatic consumers, syncs, agentsSSR pages with deep-linkable page numbers
Default to pagination_key. Reach for offset only when you need to render an arbitrary page directly from a URL, and even then prefer the cursor once a user is paging sequentially.
Using the TypeScript SDK? The paginate helper handles cursor iteration for you.
Related guide: Fetching an entire dataset walks through paging every row with the cursor for a complete backfill.
Last modified on June 8, 2026