Pagination
In general, listing enpoints enforce pagination, as the number of queried resources could be very large. For this, offset-based pagination is used.
You can control the page number and the number of items per page with the query parameters page
and per_page
.
The latter parameter has an upper limit to avoid abuse of the API.
To ease navigation, paginated responses include the following HTTP headers:
Total-Count
Next-Page
Previous-Page
Total-Pages
If you only need the count of queries use HEAD
requests and the Total-Count
header.
For instance, let's say that we want to know how many forest operations belong to a given forest property. We can make a HEAD
request, indicating one element per page.
/forest_operations?forest_property_id=53fc933e-42fa-4a2c-91ea-83d5cee540ec&per_page=1
The response body will be empty —saving bandwidth and processing— with the count being in the header Total-Count
of the response.
For convenience, non-paginated listings also include Total-Count
.