Pagination
In this guide, we will look at how to work with paginated responses when querying the Verdantly API.
When an API response returns a list of objects, no matter the amount, pagination is supported. Paginated responses are returned in a consistent format, regardless of the endpoint you are using.
Responses have two parts: a data
attribute and a meta
attribute. The data attribute contains the actual objects, while the meta attribute contains information about the response, such as the total number of items and whether there are more pages to fetch.
The meta attribute contains the following properties:
totalCount
: The total number of items available.pages
: The total number of pages available.page
: The current page number.perPage
: The number of items per page.
Request
GET
/v1/plants/varieties/namecurl -G https://verdantly-gardening-api.p.rapidapi.com/v1/plants/varieties/name?q=ora&page=1 \
-H "X-RapidAPI-Host: verdantly-gardening-api.p.rapidapi.com" \
-H "X-RapidAPI-Key: {apiKey}" \