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.


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.

curl -X POST https://sandbox-api.violet.io/v1/<pagination_enabled_API>?page=1&size=20 \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \


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 elements

Total number of elements matching query criteria.


Boolean denoting whether or not this is the last page.

total pages

Total number of pages based on size input from query parameter.


Sorting details for ordering returned in content.

number of elements

Number of elements present in current page.


Boolean denoting whether or not this is the first page.

Input size from query parameter.

Boolean denoting whether or not content is present.

    "content": [ ... ],
    "pageable": {
        "sort": {
            "unsorted": true,
            "sorted": false,
            "empty": true
        "page_number": 0,
        "page_size": 1,
        "offset": 0,
        "paged": true,
        "unpaged": false
    "total_elements": 133,
    "last": false,
    "total_pages": 133,
    "sort": {
        "unsorted": true,
        "sorted": false,
        "empty": true
    "number_of_elements": 1,
    "first": true,
    "size": 1,
    "number": 0,
    "empty": false

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.