Skip to content

Pagination

List endpoints support pagination using query parameters.

Query Parameters

Parameter Type Required Description Default
page integer Yes Page number (starts at 1) -
count integer Yes Number of items per page -

Constraints

  • page must be greater than 0
  • count must be greater than 0
  • count cannot exceed 100

Response Format

Paginated responses include:

{
  "count": 150,
  "data": [
    // Array of items
  ]
}
  • count: Total number of items matching the query
  • data: Array of items for the current page

Example Request

GET /v1/products/brand/?page=1&count=20

Example Response

{
  "count": 45,
  "data": [
    {
      "id": 1,
      "name": "Brand Name",
      "image": "https://..."
    },
    // ... 19 more items
  ]
}

Pagination Best Practices

  1. Start with page 1 for the first request
  2. Use reasonable page sizes (10-50 items) for better performance
  3. Check the count to determine if more pages are available
  4. Handle empty results when count is 0 or data is empty

Calculating Total Pages

const totalPages = Math.ceil(response.count / pageSize);