Pagination
Most of our list queries support pagination to make fetching large sets of data responsive and fast. Examples of such queries are vehicles, stations, operators and reviews.
Implementing pagination is easy because of the structure. Each list query has a size
and page
argument. The size
argument sets the number of items that will be received per page
. The page
argument is a pointer that incrementally fetches new data. Both are of type int
.
Limits & defaults
There are size limits in place to keep up the performance of the API and prevent overfetching. By default the limit is set to a maximum of 100. Exceptions to this rule are the vehicle and review query. These both accept a maximum of 1000. If the size argument is greater than the maximum, it will throw an error.
Next to limits, the following defaults will be used when they are not set on the query;
Argument | Type | Default |
---|---|---|
size | int | Default is set to 10 |
page | int | Default is set to 0 |