/api-pagination
Implements efficient API pagination using offset, cursor, and keyset strategies for large datasets. Use when building paginated endpoints, implementing infinite scroll, or optimizing database queries for collections.
One skill from claude-skills.
shell
$ npx -y skills add secondsky/claude-skills --skill api-pagination --agent claude-codeInstalls just this skill. Get the whole plugin for auto-invocation.
How it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/api-pagination
Context preview
The summary Claude sees to decide when to auto-load this skill.
Implements efficient API pagination using offset, cursor, and keyset strategies for large datasets. Use when building paginated endpoints, implementing infinite scroll, or optimizing database queries for collections.
Stats
Stars194
Forks29
LanguageTypeScript
LicenseMIT
Ships with claude-skills
SKILL.md
api-pagination.SKILL.md
--- name: api-pagination description: Implements efficient API pagination using offset, cursor, and keyset strategies for large datasets. Use when building paginated endpoints, implementing infinite scroll, or optimizing database queries for collections. license: MIT --- # API Pagination Implement scalable pagination strategies for handling large datasets efficiently. ## Pagination Strategies | Strategy | Best For | Performance | |----------|----------|-------------| | Offset/Limit | Small datasets, simple UI | O(n) | | Cursor | Infinite scroll, real-time | O(1) | | Keyset | Large datasets | O(1) | ## Offset Pagination ```javascript app.get('/products', async (req, res) => { const page = parseInt(req.query.page) || 1; const limit = Math.min(parseInt(req.query.limit) || 20, 100); const offset = (page - 1) * limit; const [products, total] = await Promise.all([ Product.find().skip(offset).limit(limit), Product.countDocuments() ]); res.json({ data: products, pagination: { page,
