Pagination, filtering, and sorting
Pagination, filtering and sorting
Pagination
Offset or page pagination
Use limit and offset or page:Cursor pagination
Sorting
Use ’+’ (ASC) or ’-’ (DESC) as a prefix for each field. If not specified, default is ASC.Filtering
Filtering allows clients to narrow down results by specifying conditions on fields. Two supported approaches:- Basic filters: simple key-value pairs, useful for direct or indirect matching in smaller or performance-sensitive APIs
- Advanced filters: a filter parameter allowing multiple field expressions
Basic filtering
Use flat key-value parameters. Example: retrieve all plugs with phase AC:Advanced filtering
Use thefilter parameter (inspired by JSON:API).
- Advanced filters must always be bound to actual fields on the resource
- Operators (
=, LIKE, <, >, etc.) are decided by the API implementation and must be documented