API Pagination Debugging
Systematic methodology for debugging pagination issues in API integrations, especially when switching between API versions or endpoints. Auto-activates when pagination stops early, returns duplicate results, or fails to iterate through complete datasets. Covers cursor-based vs page-based pagination, API response structure verification, and efficiency optimization. Trigger keywords: pagination bug, API not paginating, stuck at one page, cursor pagination, nextPageCursor, page-based pagination. (project)
npx skills add majiayu000/claude-skill-registry --skill api-pagination-debugging --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 Debugging > **Purpose**: Systematically diagnose and fix pagination failures that prevent complete data import from APIs ## Core Principles ### 1. Verify API Response Structure Before Assuming Never assume pagination fields based on documentation or other endpoints. Always test actual responses: ```bash curl -s API_ENDPOINT | jq 'keys' ``` Different API versions or endpoints may use different pagination patterns even within the same service. ### 2. Match Pagination Logic to API Design APIs use distinct pagination patterns that require different implementations: - **Cursor-based**: `{nextPageCursor, results}` - use cursor param - **Page-based**: `{page, total_pages, results}` - use page number param - **Offset-based**: `{offset, limit, total}` - use offset/limit params - **Link-based**: `{next, previous, results}` - follow next URL Using the wrong pattern causes pagination to stop after first page. ### 3. Optimize Page Size for Efficiency Most APIs support configurable page sizes (e.g., 50-1000 items per page). Using maximum page_size: - Reduces total API calls (20x fewer calls with 1000 vs 50) - Decreases network overhead - Minimizes rate limit exposure - Speeds up
- Core Principles
- 1. Verify API Response Structure Before Assuming
- 2. Match Pagination Logic to API Design
- 3. Optimize Page Size for Efficiency
- 4. Test Pagination Flow Before Implementation
- Systematic Debugging Workflow
- Step 1: Reproduce the Issue
- Step 2: Inspect Actual API Response
- Step 3: Compare Expected vs Actual Fields
- Step 4: Test Second Page Manually
- Step 5: Fix Pagination Logic
- Step 6: Verify Fix with Logging
- Step 7: Optimize Page Size
- ✅ REQUIRED Patterns
curl -s API_ENDPOINT | jq 'keys' Fetch first page and check structure curl -s -H "Authorization: Token $TOKEN" \ Expected output reveals actual fields: NOT ["count", "next", "previous", "results"] Get page 1 Extract cursor Get page 2 using cursor curl -s API_ENDPOINT | jq '.' curl API | jq 'keys'
What does the API Pagination Debugging skill do?
Systematic methodology for debugging pagination issues in API integrations, especially when switching between API versions or endpoints. Auto-activates when pagination stops early, returns duplicate results, or fails to iterate through complete datasets. Covers cursor-based vs page-based pagination, API response structure verification, and efficiency optimization. Trigger keywords: pagination bug, API not paginating, stuck at one page, cursor pagination, nextPageCursor, page-based pagination. (project)
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-pagination-debugging --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.
