Pagination
How pagination works across list endpoints.
Updated
On this page
Overview
List endpoints return paginated results. Use limit and offset parameters to page through data.
Parameters
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | number | 20 | 100 | Items per page |
offset | number | 0 | — | Number of items to skip |
page | number | 1 | — | Page number (alternative to offset) |
Response Format
{
"products": [...],
"pagination": {
"total": 150,
"limit": 20,
"offset": 0,
"has_more": true
}
}
Example: Page Through All Products
let offset = 0
const limit = 20
let allProducts = []
while (true) {
const { products, pagination } = await dash.products.list({ limit, offset })
allProducts.push(...products)
if (!pagination.has_more) break
offset += limit
}
REST API Example
# Page 1
GET /storefront/products?limit=20&offset=0
# Page 2
GET /storefront/products?limit=20&offset=20
# Page 3
GET /storefront/products?limit=20&offset=40
Next Steps
- Filtering & Sorting — Narrowing results
- Common Patterns — Pagination in components