Pagination
Overview
The Violet APIs provide you with access to immense amounts of data. Through pagination, you can easily navigate through this data using the page
and size
query parameters.
Requests
Query Parameters:
The starting position for which this API should return data.
Limit to the number of items returned by this request. Default value of 20 if field not set.
Response
Responses for calls that support pagination include additional information designed to let you quickly navigate through our datasets. The following information is returned:
Content you are requesting from the call.
Custom object that stores information about details for the current page, such as page number, sort, etc.
Total number of elements matching query criteria.
Boolean denoting whether or not this is the last page.
Total number of pages based on size input from query parameter.
Sorting details for ordering returned in content.
Number of elements present in current page.
Boolean denoting whether or not this is the first page.
Boolean denoting whether or not content is present.
As seen above, Violet uses page
and total_elements
in the response object to give you details on the total number of elements present in our datasets matching your criteria as well as the number of total pages you need to go through for all data. You can pass these page numbers through the request query parameters to fetch the next set of data.
Since Violet uses more than next
and previous
cursors to let you traverse through the dataset, you can even use page numbers and size to make parallel calls to our system to retrieve information as quickly as you need to for your application.