title: Pagination

description: Navigate large result sets with cursor-based and offset pagination.

Pagination

All list endpoints return paginated results. Wontopos supports both offset and cursor-based pagination.

Cursor-based pagination (recommended)

Use the after parameter with the cursor from the previous response for stable, consistent pagination:

# First page
GET /v1/marketplace/apis?limit=20

# Next page
GET /v1/marketplace/apis?limit=20&after=api_xyz

Response format

{
  "object": "list",
  "data": [],
  "next_cursor": "api_xyz",
  "has_more": true,
  "total": 142
}

Parameters

ParameterTypeDefaultDescription
limitinteger20Number of items per page (1-100)
afterstringCursor for the next page
offsetinteger0Number of items to skip (offset pagination)

Offset pagination

Use limit and offset for simple page-based navigation:

GET /v1/marketplace/apis?limit=20&offset=0   # Page 1
GET /v1/marketplace/apis?limit=20&offset=20  # Page 2
GET /v1/marketplace/apis?limit=20&offset=40  # Page 3

Use cursors for large datasets

Offset pagination can become inconsistent when data changes between requests. Use cursor-based pagination for production workloads.

SDK auto-pagination

The SDKs provide auto-paginating iterators that handle cursor management automatically:

// JavaScript
for await (const api of client.marketplace.listAutoPaging()) {
  console.log(api.name);
}
# Python
for api in client.marketplace.list_auto_paging(category="payments"):
    print(api.name)
// Go
iter := client.Marketplace.ListAutoPaging(ctx, wontopos.MarketplaceListParams{})
for iter.Next() {
    fmt.Println(iter.Current().Name)
}