# API pagination filtering sorting

> API pagination filtering sorting is an open-source agent skill for developer tools. Standard query parameter and response metadata conventions for paginated list endpoints. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ajyadav013/claude-kit/tree/main/providers/codex/claude-kit/skills/api-pagination-filtering-sorting
- **Repository:** https://github.com/ajyadav013/claude-kit
- **GitHub stars:** 13
- **License:** MIT
- **Skill name:** api-pagination-filtering-sorting
- **Collection:** https://github.com/ajyadav013/claude-kit
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill gives the agent a consistent set of conventions for list endpoints: how to name and validate pagination, filter, sort and search parameters, and what metadata to return alongside the records. It covers choosing between page-based and limit/offset pagination, computing offsets, and deriving total pages and next-page flags from a total count.

It also describes how to structure the code behind the endpoint. The guidance covers a query builder that returns parameterized SQL for both data and count queries, a repository that runs them together, and a service that assembles the response. Sorting uses a mapping from public field names to column names, and search applies case-insensitive substring matching across several fields. The material further explains why cursor-based pagination avoids skipped or duplicated rows when data changes between requests, and when it is the better choice.

The examples are written in Python with FastAPI, Pydantic and asyncpg-style PostgreSQL placeholders, so the agent should expect to adapt them to other stacks. The skill is plain instructional content with no bundled scripts.

## When your agent uses it

> HTTP query parameter conventions for pagination, filtering, sorting, and search with standardized response metadata. Use when designing list endpoints or building repositories that turn query params into SQL.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ajyadav013/claude-kit/tree/HEAD/providers/codex/claude-kit/skills/api-pagination-filtering-sorting)
- [License: MIT](https://github.com/ajyadav013/claude-kit/tree/HEAD/providers/codex/claude-kit/skills/api-pagination-filtering-sorting)

## Features

- **Pagination styles:** Guidance on choosing page/page_size or limit/offset and keeping one style per service.
- **Response metadata:** Standard fields for total counts, total pages and next/previous flags returned with records.
- **Multi-value and hierarchical filters:** Patterns for repeated query params, comma-separated values and level-by-level product or location filters.
- **Sorting with validated fields:** Maps public sort names to columns and restricts sort direction to asc or desc.
- **Parameterized query builder:** Separates data and count query construction while binding values as SQL placeholders.
- **Cursor pagination guidance:** Explains keyset pagination with opaque cursors and a stable tiebreaker sort key.

## Good for

- Design a paginated list endpoint with filters and sorting
- Add a search parameter across several columns of a list API
- Turn query parameters into a safe parameterized SQL query
- Standardize pagination metadata across existing REST endpoints
- Switch a large, frequently changing list to cursor-based pagination

## Install

### Claude Code

This skill ships in the `claude-kit` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ajyadav013/claude-kit
/plugin install claude-kit@claude-kit
```

Or copy only this skill to `~/.claude/skills/api-pagination-filtering-sorting`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/api-pagination-filtering-sorting &&
cp -R "$tmp/providers/codex/claude-kit/skills/api-pagination-filtering-sorting" ~/.claude/skills/api-pagination-filtering-sorting &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/api-pagination-filtering-sorting` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/api-pagination-filtering-sorting` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/api-pagination-filtering-sorting &&
cp -R "$tmp/providers/codex/claude-kit/skills/api-pagination-filtering-sorting" ~/.agents/skills/api-pagination-filtering-sorting &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/api-pagination-filtering-sorting` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/api-pagination-filtering-sorting` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/api-pagination-filtering-sorting &&
cp -R "$tmp/providers/codex/claude-kit/skills/api-pagination-filtering-sorting" ~/.cursor/skills/api-pagination-filtering-sorting &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/api-pagination-filtering-sorting` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ajyadav013/claude-kit.git --path providers/codex/claude-kit/skills/api-pagination-filtering-sorting
```

Or copy the folder to `~/.gemini/skills/api-pagination-filtering-sorting` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/api-pagination-filtering-sorting`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/api-pagination-filtering-sorting &&
cp -R "$tmp/providers/codex/claude-kit/skills/api-pagination-filtering-sorting" ~/.copilot/skills/api-pagination-filtering-sorting &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/api-pagination-filtering-sorting` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git
```

Then copy `claude-kit/providers/codex/claude-kit/skills/api-pagination-filtering-sorting` into your agent's skills folder as `api-pagination-filtering-sorting`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does API pagination filtering sorting need to run?

It has no scripts or tool requirements. It is a set of instructions and reference code examples that the agent reads when a list endpoint task matches.

### When does API pagination filtering sorting trigger?

It applies when designing list endpoints, building repositories that turn query parameters into SQL, adding search or sorting to lists, or standardizing pagination responses.

### Which languages and frameworks do the examples use?

The examples are Python with FastAPI and Pydantic, and use PostgreSQL-style numbered placeholders.

### Does API pagination filtering sorting change any files on its own?

The skill only provides guidance to the agent. It does not include scripts that modify files.

### How do I install API pagination filtering sorting in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/api-pagination-filtering-sorting to use it in all your projects, or to .claude/skills/api-pagination-filtering-sorting in one project. Or install the claude-kit plugin, which includes it: /plugin marketplace add ajyadav013/claude-kit, then /plugin install claude-kit@claude-kit.

### Does API pagination filtering sorting run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use API pagination filtering sorting?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to API pagination filtering sorting?

The closest alternatives to API pagination filtering sorting are API design, API design, API design, API design and Python backend.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [API design](https://ai-powered.com/skills/api-design): API design is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-fmarzochi): API design is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-abdullayevtemurmalik): API design is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-nabwinsaud): API design is an open-source agent skill for developer tools.
- [Python backend](https://ai-powered.com/skills/python-backend): Python backend is an open-source agent skill for developer tools.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns): Backend patterns is an open-source agent skill for developer tools.
- [Backend repo architecture](https://ai-powered.com/skills/backend-repo-architecture): Backend repo architecture is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-majiayu000): API design is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/api-pagination-filtering-sorting
