Guides
Pagination & query parameters
Pagination
| Parameter | Default | Rules |
|---|---|---|
| limit | 30 | Integer from 1 to 100 |
| skip | 0 | Integer, 0 or more. Skipping past the end returns an empty array. |
Every list response includes metadata so you can build pagers and infinite scroll:
{
"users": [
"…"
],
"total": 100,
"skip": 0,
"limit": 2
}To get page n (1-based) with page size s, request limit=s&skip=(n-1)*s. There are more pages while skip + limit < total.
curl 'https://test.naimulhassan.me/api/v1/products?limit=10&skip=20'Sorting
sortBy picks a sortable field (each resource lists its own) and order is asc (default) or desc. Ties are broken by id so pagination stays stable.
curl 'https://test.naimulhassan.me/api/v1/products?sortBy=price&order=desc&limit=5'Selecting fields
select takes a comma-separated list of top-level fields. id is always included. Unknown fields return 400 INVALID_PARAMETER.
curl 'https://test.naimulhassan.me/api/v1/users?select=firstName,email&limit=3'Search
Searchable resources expose /<resource>/search?q=term. Matching is case-insensitive and finds the term anywhere in the searchable fields. Special characters are matched literally. When nothing matches you get 200 with an empty array and total: 0. Search endpoints also accept pagination, sorting, and select.
curl 'https://test.naimulhassan.me/api/v1/recipes/search?q=pasta'Filters
List endpoints accept resource-specific filters. Combine as many as you like; all of them must match.
| Resource | Filters |
|---|---|
| /users | role, gender, city, minAge, maxAge |
| /products | category, brand, availabilityStatus, minPrice, maxPrice, minRating |
| /posts | userId, tag |
| /comments | postId, userId |
| /todos | completed, userId |
| /carts | userId |
| /recipes | cuisine, difficulty, mealType, tag |
| /quotes | author |
curl 'https://test.naimulhassan.me/api/v1/products?category=smartphones&maxPrice=500'Delaying responses
Add delay=<ms> (0 to 5000) to any data, auth, or relation endpoint to simulate a slow network and test loading states. Delayed requests have a stricter rate limit. For a dedicated endpoint see /test/delay.
curl 'https://test.naimulhassan.me/api/v1/posts?limit=5&delay=1500'Validation rules
What returns 400
- Values outside the documented range, such as
limit=0,limit=101, orskip=-1. - Non-numeric numbers such as
limit=ten, or invalid enum values such asorder=sideways. - Unknown parameters such as
page=2, which usually indicate a typo. - Repeating a parameter, e.g.
limit=1&limit=2.
Error messages name the offending parameter, e.g. limit must be at most 100. See Errors.