api-pagination
Implement efficient pagination strategies for large datasets using offset/limit, cursor-based, and keyset pagination. Use when returning collections, managing large result sets, or optimizing query performance.
npx skills add majiayu000/claude-skill-registry --skill api-pagination-aj-geddes-useful-ai-prompts --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Pagination ## Overview Implement scalable pagination strategies for handling large datasets with efficient querying, navigation, and performance optimization. ## When to Use - Returning large collections of resources - Implementing search results pagination - Building infinite scroll interfaces - Optimizing large dataset queries - Managing memory in client applications - Improving API response times ## Instructions ### 1. **Offset/Limit Pagination** ```javascript // Node.js offset/limit implementation app.get('/api/users', async (req, res) => { const page = parseInt(req.query.page) || 1; const limit = Math.min(parseInt(req.query.limit) || 20, 100); // Max 100 const offset = (page - 1) * limit; try { const [users, total] = await Promise.all([ User.find() .skip(offset) .limit(limit) .select('id email firstName lastName createdAt'), User.countDocuments() ]); const totalPages = Math.ceil(total / limit); res.json({ data: users, pagination: { page, limit, total, totalPages, hasNext: page < totalPages, hasPrev: page > 1 }, links: { self: `/api/users?page=${page}&limit=${limit}`, first: `/api/users?page=1&limit=${limit}`, last: `/api/users?page=${totalPages}&limit=${limit}`, ...(page
- Overview
- When to Use
- Instructions
- 1. Offset/Limit Pagination
- 2. Cursor-Based Pagination
- 3. Keyset Pagination
- 4. Search Pagination
- 5. Pagination Response Formats
- 6. Python Pagination (SQLAlchemy)
- Best Practices
- ✅ DO
- ❌ DON'T
- Performance Tips
What does the api-pagination skill do?
Implement efficient pagination strategies for large datasets using offset/limit, cursor-based, and keyset pagination. Use when returning collections, managing large result sets, or optimizing query performance.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-pagination-aj-geddes-useful-ai-prompts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
