Docs

Query parameters

Filter, sort, and paginate any collection endpoint straight from the URL. The parameters match json-server, so anything you already know works here — no config, no setup, and nothing to define per endpoint.

GET https://acme.mockmydata.io/api/products?category=tools

200 OK · X-Total-Count: 4

[
  {
    "id": 1,
    "name": "Cordless Drill",
    "category": "tools",
    "price": 129.99,
    "inStock": true
  },
  {
    "id": 2,
    "name": "Hammer",
    "category": "tools",
    "price": 24.5,
    "inStock": true
  },
  {
    "id": 4,
    "name": "Drill Bit Set",
    "category": "tools",
    "price": 45,
    "inStock": true
  },
  {
    "id": 6,
    "name": "Circular Saw",
    "category": "tools",
    "price": 189,
    "inStock": true
  }
]

4 of 4 rows. X-Total-Count always reports the count before pagination, so you can size your pager.

Filtering

Any parameter without an underscore prefix filters on a field. The two spellings below are interchangeable — every operator accepts both, and they return identical results.

OperatorUnderscoreColonWhat it does
Equalscategory=toolscategory=toolsField matches exactly
Not equalcategory_ne=toolscategory:ne=toolsField is anything else
Greater thanprice_gt=50price:gt=50Numbers and ISO dates
Greater or equalprice_gte=50price:gte=50Inclusive lower bound
Less thanprice_lt=50price:lt=50Numbers and ISO dates
Less or equalprice_lte=50price:lte=50Inclusive upper bound
Containsname_like=drillname:contains=drillSubstring, case-insensitive
Starts withname_startswith=Cordname:startswith=CordCase-insensitive prefix
Ends withname_endswith=Setname:endswith=SetCase-insensitive suffix
In listid_in=1,2,3id:in=1,2,3Matches any value listed
  • Different keys combine with AND: ?category=tools&price_gte=50
  • Repeating one key means OR: ?id=1&id=3
  • Reach nested fields with a dot path: ?vendor.name=Bosch
  • A field your data doesn't have returns 400 and names the typo, rather than an empty array.
  • _like and _contains are two names for the same operator.

Sorting and pagination

These start with an underscore so they can never collide with a field actually named sort or page.

ParameterExampleWhat it does
_page_page=2Page number, starting at 1. Defaults to 10 per page.
_limit_limit=25Rows per page. Capped by your plan.
_per_page_per_page=25Same as _limit. json-server v1 spelling.
_sort_sort=-priceSort field. Prefix with - for descending. Comma-separate for multiple.
_order_order=descasc or desc. Pairs with _sort, positionally for multiple fields.
qq=drillFull-text across every top-level string and number field.

Rows per request are capped at 100 on the free plan and 1,000 on Pro. Ask for more and you get the cap, not an error.

In your app

This is the point: the fetch you write against the mock is the fetch you keep when the real backend lands. Nothing to delete at swap time.

const params = new URLSearchParams({
  _page: String(page),
  _limit: "20",
  _sort: "-createdAt",
  category,
});

const res = await fetch(`${API_URL}/api/products?${params}`, {
  headers: { "X-API-Key": key },
});

const total = Number(res.headers.get("X-Total-Count"));
const rows = await res.json();

setPageCount(Math.ceil(total / 20));

Try it on your own data

Create an endpoint and every parameter above works on it immediately.

Create free account
© 2026 MockMyData.io
support@mockmydata.io