API Pagination Patterns
Implement efficient pagination for API endpoints with the right strategy for your data and access patterns.
Usage
Describe your API endpoint and data characteristics, and this skill will recommend and implement the best pagination pattern.
Examples
- "Implement cursor-based pagination for a social media timeline"
- "Add offset pagination with total count to my product listing API"
- "Choose between cursor and offset pagination for my search results"
Guidelines
- Use cursor-based pagination for large, frequently changing datasets
- Include pagination metadata in responses for client navigation
- Set reasonable default and maximum page sizes
- Optimize total count queries or make them optional
- Document pagination behavior clearly in API documentation