Skip to main content

Overview

The Zochil API uses cursor-based pagination for efficient navigation through large datasets. This approach provides consistent performance regardless of dataset size and handles real-time data changes gracefully.

Pagination Parameters

Most list endpoints accept the following pagination parameters:
integer
default:"20"
Number of items to return (1-100)
integer
default:"0"
Number of items to skip (cursor-based)
string
Cursor for the next page (when available)

Response Format

Paginated responses include metadata to help you navigate:

Basic Pagination

First Page Request

Next Page Request

Using offset-based pagination:

Advanced Pagination Patterns

Iterating Through All Pages

For real-time data and better performance:

Pagination with Filtering and Sorting

Combine pagination with filters and sorting:

React Hook Example

Here’s a custom hook for handling pagination in React:

Performance Tips

Optimal Page Sizes - Use 20-50 items per page for most use cases - Use smaller pages (10-20) for complex items with large payloads - Use larger pages (50-100) for simple list items
Cursor vs Offset - Prefer cursor-based pagination for real-time data - Use offset-based pagination when users need random page access - Cursor pagination performs better with large datasets
Avoid Deep Pagination Very high offset values (>10,000) may have performance impacts. Consider using search filters or cursor-based pagination instead.

Common Patterns by Endpoint

Next Steps

API Reference

Explore all paginated endpoints

Webhooks

Real-time notifications and events