Pagination
The vFairs API employs a pagination mechanism to efficiently manage large datasets and ensure API responses are both quick and manageable. Each paginated response includes a meta
section that provides key details about the current state of pagination. Here's how the pagination information is structured:
By including the
page
query parameter in the endpoint, you can retrieve data for the specified page. For example:"https://api.vfairs.com/rest/endpoint?page=3"
.
{
"status": true,
"message": "Successful retrieval of data.",
"data": [ ... ],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"path": "https://api.vfairs.com/rest/endpoint",
"per_page": 12,
"to": 18,
"total": 18
}
}
Response Structure
- current_page: The current page number of the dataset. For example,
"current_page": 1
indicates you are on the first page. - from: The position of the first record on the current page. For example,
"from": 1
means the first record on the page is at position 1. - last_page: The total number of available pages. For example,
"last_page": 5
indicates there are five pages in total. - path: The base URL of the API endpoint for data retrieval. Example:
"path": "https://event.vfairs.com/endpoint"
. - per_page: The number of records displayed per page. For example,
"per_page": 100
means each page contains up to 100 records. - to: The position of the last record on the current page. For example,
"to": 100
shows the last record on the page is the 100th. - total: The total number of records available across all pages. For example,
"total": 500
means there are 500 records in total.
Journey Starts here: APIs