Skip to main content

Pagination

All list endpoints use cursor-based pagination for efficient traversal of large datasets.

Request Parameters

ParameterTypeDescription
cursorstringPagination cursor from previous response
limitintegerResults per page (default: 20, max: 100)

Response Format

{
  "items": [...],
  "nextCursor": "eyJpZCI6Ind...",
  "hasMore": true
}
FieldDescription
itemsArray of results (field name varies by endpoint)
nextCursorCursor for next page (empty if no more results)
hasMoreBoolean indicating if more results exist

Example

First Page

curl -X GET "https://api.axonvault.io/v1/server/wallets?limit=10" \
  -H "X-Access-Key: ak_live_abc123" \
  -H "X-Signature: ..." \
  -H "X-Timestamp: 2024-01-15T10:30:00Z"
Response:
{
  "wallets": [
    { "walletId": "wlt_1", "walletName": "Wallet 1" },
    { "walletId": "wlt_2", "walletName": "Wallet 2" }
  ],
  "nextCursor": "eyJpZCI6Ind...",
  "hasMore": true
}

Next Page

curl -X GET "https://api.axonvault.io/v1/server/wallets?limit=10&cursor=eyJpZCI6Ind..." \
  -H "X-Access-Key: ak_live_abc123" \
  -H "X-Signature: ..." \
  -H "X-Timestamp: 2024-01-15T10:30:00Z"

Iterating All Results

async function getAllItems(endpoint, headers) {
  const items = [];
  let cursor = null;
  
  do {
    const url = cursor 
      ? `${endpoint}?cursor=${cursor}&limit=100`
      : `${endpoint}?limit=100`;
    
    const response = await fetch(url, { headers });
    const data = await response.json();
    
    // Get items array (field name varies)
    const itemsKey = Object.keys(data).find(k => Array.isArray(data[k]));
    items.push(...data[itemsKey]);
    
    cursor = data.hasMore ? data.nextCursor : null;
  } while (cursor);
  
  return items;
}

Best Practices

  • Small pages (10-20) for UI pagination
  • Large pages (100) for data export
  • Balance between latency and throughput
Cursors may expire or become invalid. Always start fresh for new sessions.
Always check hasMore before using nextCursor.