pagination

Implement cursor-based and offset pagination strategies for API endpoints.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill pagination-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pagination
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/pagination
Command: npx skills add https://github.com/dadbodgeoff/drift --skill pagination-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of efficiently retrieving large datasets from APIs without overwhelming the server or database, ensuring a smooth user experience for data-intensive applications.

Core Features & Use Cases

  • Cursor-Based Pagination: Implements a robust cursor-based pagination strategy for fast and consistent data retrieval, especially suitable for real-time data.
  • Offset Pagination: Provides a simpler offset-based approach for scenarios where direct page jumping is required.
  • Database Optimization: Includes guidance on essential database indexing for optimal pagination performance.
  • Frontend Integration: Demonstrates how to integrate cursor pagination with frontend data fetching libraries like react-query.
  • Use Case: Powering infinite scroll feeds on social media platforms or displaying paginated lists of products in an e-commerce application.

Quick Start

Use the pagination skill to implement cursor-based pagination for your API's user list endpoint.

Frequently Asked Questions about pagination

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement cursor-based pagination for an API in TypeScript or Python?

Cursor-based pagination is implemented by using a stable sort field as a cursor to fetch subsequent data chunks. This Skill provides scripts for both TypeScript and Python to retrieve large datasets efficiently without skipping records during real-time updates.

What is the best way to choose between cursor and offset pagination for large datasets?

Offset pagination suits direct page jumping, while cursor pagination ensures fast, consistent retrieval for real-time data. This Skill implements both API strategies and includes database indexing recommendations to optimize query performance for your specific use case.

Does this pagination approach work with frontend data fetching libraries like react-query?

Yes, cursor pagination integrates seamlessly with frontend data fetching libraries like react-query. The Skill provides integration examples demonstrating how to connect API endpoints to infinite scroll feeds on platforms such as social media or e-commerce applications.

Why does my database pagination slow down with large offset values?

Database pagination slows down because large offsets require scanning and discarding many rows before returning results. This Skill addresses the issue by providing cursor-based pagination strategies and essential database indexing guidance for optimal query performance.

When do I need to add database indexes for API pagination?

You need database indexing for API pagination whenever retrieving large datasets to prevent full table scans and ensure stable sorting. This Skill includes specific database indexing recommendations required for optimal cursor and offset pagination performance.

Can I use offset pagination for an infinite scroll feed?

Offset pagination is generally not recommended for infinite scroll feeds because data insertions can cause records to shift and duplicate. Cursor pagination is the preferred strategy for infinite scroll, providing consistent retrieval for real-time data.