Agent skill · Databases

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.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-pagination --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 2 KB
Bundled scripts: none
Path: skills/api/api-pagination/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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, limit, total, totalPages: Math.ceil(total / limit) } }); }); ``` ## Cursor Pagination ```javascript app.get('/posts', async (req, res) => { const limit = 20; const cursor = req.query.cursor; const query = cursor ? { _id: { $gt: Buffer.from(cursor, 'base64').toString() } } : {}; const posts = await Post.find(query).limit(limit + 1); const hasMore = posts.length > limit; if (hasMore) posts.pop(); res.json({ data: posts, nextCursor: hasMore ? Buffer.from(posts[posts.length - 1]._id

What's inside
Steps it walks through
  1. Pagination Strategies
  2. Offset Pagination
  3. Cursor Pagination
  4. Response Format
  5. Best Practices
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the api-pagination skill do?

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.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-pagination --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.

Keep going