api-filtering-sorting
Builds flexible API filtering and sorting systems with query parameter parsing, validation, and security. Use when implementing search endpoints, building data grids, or creating dynamic query APIs.
npx skills add majiayu000/claude-skill-registry --skill api-filtering-sorting-secondsky-claude-skills-3 --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 Filtering & Sorting Build flexible filtering and sorting systems that handle complex queries efficiently. ## Query Parameter Syntax ``` GET /products?category=electronics&price[gte]=100&price[lte]=500&sort=-price,name ``` ## Implementation (Node.js) ```javascript const allowedFilters = ['category', 'status', 'price', 'createdAt']; const allowedSorts = ['name', 'price', 'createdAt']; app.get('/products', async (req, res) => { const filter = {}; const sort = {}; // Parse filters for (const [key, value] of Object.entries(req.query)) { if (key === 'sort') continue; const match = key.match(/^(\w+)\[(\w+)\]$/); if (match) { const [, field, operator] = match; if (!allowedFilters.includes(field)) continue; filter[field] = { [`$${operator}`]: parseValue(value) }; } else if (allowedFilters.includes(key)) { filter[key] = value; } } // Parse sort if (req.query.sort) { for (const field of req.query.sort.split(',')) { const direction = field.startsWith('-') ? -1 : 1; const name = field.replace(/^-/, ''); if (allowedSorts.includes(name)) sort[name] = direction; } } const products = await Product.find(filter).sort(sort); res.json({ data: products }); }); function parseValue(value) { if (valu
- Query Parameter Syntax
- Implementation (Node.js)
- Filter Operators
- Security
- Best Practices
What does the api-filtering-sorting skill do?
Builds flexible API filtering and sorting systems with query parameter parsing, validation, and security. Use when implementing search endpoints, building data grids, or creating dynamic query APIs.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-filtering-sorting-secondsky-claude-skills-3 --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.
