Filtering, Sorting & Pagination
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Most endpoints that return arrays can have filters, sorting, and paginations informations added in the query to help you buid on them
Filtering
You can add filtering to the request you are making it will check if the field you are checking contains the defined string element or number
It is constructed like so : object.key=value
ex: name=pikachu
Example
Request:
Response:
Sorting
Sorting is done by default in the API depending on the array returned releaseDate > localId > id
You can override the default sorting algorithm by adding parameters to your request :
query parameter | default value | possible values | description |
---|---|---|---|
sort:field | releaseDate > localId > id | key of the object | change the field that is used to sort (MUST be the name of one of the field of the object) |
sort:order | ASC | ASC , DESC | change the ordering done on the field |
Example
Request:
Response:
Pagination
Pagination is not done automatically to speed requests on your end.
you can still add it back by using the following query parameters:
query parameter | default value | possible values | description |
---|---|---|---|
pagination:page | 1 | Number | Indicate on which page you are at |
pagination:itemsPerPage | 100 (when pagination:page is set) | Number | indicate the number of items displayed on each pages |
Example
Request:
Response: